Soundness of Modified Realizability (Theorem 4.1)
OpenBBS2002.theorem_4_1Theorem 4.1 (p. 12): If M is a Z^X-derivation of B, then the extracted program ⟦M⟧ has type τ(B) and there is a Z-derivation of ⟦M⟧ mr_A B from { u^{τ(C)} mr_A C | u^C ∈ FA(M) }.
Superseded by BBS2002.V2.theorem_4_1. The original realizability translation could capture free comprehension parameters after formula conversion. The V2 definition renames bound variables and enforces the realizer's option shape.
import Definitions.Def_BBS2002_Extraction
namespace BBS2002
/-- Theorem 4.1 (Soundness of Modified Realizability, Section 4, p. 12):
Assume that `M` is a `Z^X`-derivation of `B` (`Derivable SysConfig.ZX M B`) satisfying
`AdmissibleForExtraction ν dummy comp M`. Then:
1. If `τ(B) = some ρ`, then `⟦M⟧ = some t` for a term `t` of type `ρ`; if `τ(B) = *`, then `⟦M⟧ = ε` (`none`).
2. There is a `Z`-derivation `N` of `⟦M⟧ mr_A B` whose free assumption variables have formulas in
`{ u^{τ(C)} mr_A C | u^C ∈ FA(M) }`. -/
theorem theorem_4_1
(ν : Ty) (dummy : Term) (comp : CompTerm ν)
(M : ProofTerm) (B : Formula)
(hDeriv : Derivable SysConfig.ZX M B)
(hAdm : AdmissibleForExtraction ν dummy comp M) :
(match tau ν B with
| none => extractProgram ν dummy M B = none
| some ρ => ∃ t : Term, extractProgram ν dummy M B = some t ∧ HasType t ρ) ∧
(∃ N : ProofTerm,
Derivable SysConfig.Z N (mrFormula ν comp (extractProgram ν dummy M B) B) ∧
∀ v ∈ freeAssumpVars N,
∃ u ∈ freeAssumpVars M,
v.formula = mrFormula ν comp (assumpRealizerTerm ν u) u.formula) := by
sorry
end BBS2002Read-back
What the Lean code literally says, in plain math · Gemini 3.1 Pro (Independent Blind Auditor)
Independent Mathematical Read-Back: Thm_BBS2002_theorem_4_1.lean
theorem_4_1 (Soundness of Modified Realizability for ).
For any simple type , any fallback term , any comprehension term (representing where has type and is a well-typed -formula), any natural deduction proof term , and any formula , assume:
- (
hDeriv) is a valid derivation of in intuitionistic arithmetic (Derivable SysConfig.ZX M B); - (
hAdm) satisfiesAdmissibleForExtraction ν dummy comp M, namely:- is a closed term of type ( and );
- for every assumption variable and every object variable , ;
- for all assumption variables , if then ;
- for every object variable , either or .
Then both of the following hold for the extracted program :
- Typing of the extracted program:
- If (), then ().
- If , then there exists a System term such that and ().
- Realizability derivation in : There exists a natural deduction proof term such that:
- derives the modified realizability formula (
mrFormula ν comp (extractProgram ν dummy M B) B) in intuitionistic arithmetic (Derivable SysConfig.Z, over without ); and - for every free assumption variable , there exists a free assumption variable such that
- derives the modified realizability formula (
where $\mathrm{assumpRealizerTerm}(\nu, u)$ is $\mathrm{some}(\mathrm{var}\,\langle u.\mathrm{id}, \rho\rangle)$ if $\tau_\nu(u.\mathrm{formula}) = \mathrm{some}\,\rho$ and $\mathrm{none}$ ($\varepsilon$) if $\tau_\nu(u.\mathrm{formula}) = \mathrm{none}$. (In particular, if $\mathrm{freeAssumpVars}(M) = [\,]$, then $\mathrm{freeAssumpVars}(N) = [\,]$, so $Z \vdash \llbracket M \rrbracket \;\mathsf{mr}_{\mathcal{A}}\; B$.)
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.