[step:Interpret the propositional rules using product, sum, and function terms]For conjunction introduction, use $(R_A,R_B):|A|\times |B|$. The conjunction clause says that this term realizes $A\land B$ exactly when $R_A\Vdash_{\mathrm{mr}}A$ and $R_B\Vdash_{\mathrm{mr}}B$. For conjunction elimination, use the projections $\pi_1$ and $\pi_2$.
For implication introduction, suppose the derivation of $B$ has an additional discharged assumption $A$. Let $y:|A|$ be the corresponding realizer variable. The induction hypothesis gives a term $S(X,y):|B|$ and proves
\begin{align*}
\mathrm{HA}^{\omega}_{\mathrm{int}}\vdash (X\Vdash_{\mathrm{mr}}\Gamma)\to (y\Vdash_{\mathrm{mr}}A)\to S(X,y)\Vdash_{\mathrm{mr}}B.
\end{align*}
Define $R_{A\to B}:=\lambda y.S(X,y):|A|\to |B|$. By the implication clause, $R_{A\to B}\Vdash_{\mathrm{mr}}A\to B$ is precisely the statement that every realizer of $A$ is sent to a realizer of $B$. For implication elimination, use application: if $F:|A|\to |B|$ realizes $A\to B$ and $R_A:|A|$ realizes $A$, then $F(R_A):|B|$ realizes $B$.
For disjunction introduction, use $\operatorname{inl}(R_A):|A|+|B|$ or $\operatorname{inr}(R_B):|A|+|B|$. For [disjunction elimination](/theorems/4625), let $D:|A|+|B|$ realize $A\lor B$, let $S_A(X,a):|C|$ realize $C$ from $a:|A|$ realizing $A$, and let $S_B(X,b):|C|$ realize $C$ from $b:|B|$ realizing $B$. Define
\begin{align*}
R_C:=\operatorname{case}(D,\lambda a.S_A(X,a),\lambda b.S_B(X,b)).
\end{align*}
The sum-elimination clause for modified realizability proves $R_C\Vdash_{\mathrm{mr}}C$ in the left and right cases.
For falsity elimination, first define by structural recursion a closed default realizer $e_A:|A|$ for every formula $A$. For atomic formulas and $\bot$, take the unit term. For conjunctions take pairs, for disjunctions take the left injection, for implications and universal formulas take constant functions, and for existential formulas take $(d_\sigma,e_{A(d_\sigma)})$, using the stipulated closed default term $d_\sigma:\sigma$. If the induction hypothesis gives a realizer of $\bot$, then the formula realized is $\bot$ itself, so intuitionistic ex falso proves $e_A\Vdash_{\mathrm{mr}}A$.[/step]