Computational Content of Classical Proofs under Realizer Assumptions (Theorem 5.1)
OpenBBS2002.theorem_5_1Theorem 5.1 (pp. 12-13): Under realizability assumptions (7)-(9) for t₁, ..., tₙ, s₁, ..., sₘ, r, any closed Z_0-derivation M of D⃗ → ∀y⃗(G⃗ → ⊥) → ⊥ yields Z ⊢ D⃗ → A(⟦M^X⟧ t₁ ... tₙ s) where s := λy⃗ λw⃗. s₁ w₁ (... (sₘ wₘ (r y⃗)) ...).
Superseded by BBS2002.V2.theorem_5_1. The original declaration omitted freshness of quantified variables for external assumptions and excluded legitimate parameter dependence of goal combinators. V2 corrects both and uses capture-avoiding realizability.
import Definitions.Def_BBS2002_Extraction
namespace BBS2002
/-- Theorem 5.1 (Computational Content of Classical Proofs, Section 5, pp. 12–13):
Let `D⃗ = D₁, ..., Dₙ` and `G⃗ = G₁, ..., Gₘ` be well-typed `L`-formulas, and assume (7)–(9) hold
for `t₁, ..., tₙ`, `s₁, ..., sₘ`, `r`. Then for any closed `Z_0`-derivation `M` of
`D⃗ → ∀y⃗(G⃗ → ⊥) → ⊥` and `s := λy⃗ λw⃗. s₁ w₁ (... (sₘ wₘ (r y⃗)) ...)`,
we have `Z ⊢ D⃗ → A(⟦M^X⟧ t₁ ... tₙ s)`. -/
theorem theorem_5_1
(ν : Ty) (dummy : Term) (comp : CompTerm ν)
(Ds Gs : List Formula) (ys : List Var)
(ts : List (Option Term)) (ws : List (Option Var)) (ss : List Term) (vs : List Var)
(r : Term) (M : ProofTerm)
(hDs : ∀ D ∈ Ds, FormulaWellTyped D ∧ isLFormula D = true)
(hGs : ∀ G ∈ Gs, FormulaWellTyped G ∧ isLFormula G = true)
(htsLen : ts.length = Ds.length)
(hwsLen : ws.length = Gs.length)
(hssLen : ss.length = Gs.length)
(hvsLen : vs.length = Gs.length)
(hrTy : HasType r (Ty.arrMany (ys.map Var.ty) ν))
(htsTy : ∀ j : Fin Ds.length,
match tau ν (substBotWithX (Ds.get j)), ts.get (j.cast htsLen.symm) with
| none, none => True
| some ρ, some t => HasType t ρ
| _, _ => False)
(hwssTy : ∀ i : Fin Gs.length,
(vs.get (i.cast hvsLen.symm)).ty = ν ∧
match tau ν (substBotWithX (Gs.get i)), ws.get (i.cast hwsLen.symm) with
| none, none => HasType (ss.get (i.cast hssLen.symm)) (.arr ν ν)
| some ρ, some w => w.ty = ρ ∧ HasType (ss.get (i.cast hssLen.symm)) (.arr ρ (.arr ν ν))
| _, _ => False)
(hBindersFresh :
let wVars := ws.filterMap id
(ys ++ wVars ++ vs).Nodup ∧
(∀ z ∈ ys ++ wVars, ∀ s_i ∈ ss, z ∉ freeVars s_i) ∧
(∀ z ∈ ys ++ wVars, z ∉ freeVars r) ∧
(∀ z ∈ wVars ++ vs, ∀ D ∈ Ds, z ∉ freeVarsFormula D) ∧
(∀ z ∈ wVars ++ vs, ∀ G ∈ Gs, z ∉ freeVarsFormula G) ∧
(∀ z ∈ ys ++ wVars ++ vs, z = comp.var ∨ z ∉ freeVarsFormula comp.body) ∧
(∀ v ∈ vs, ∀ s_i ∈ ss, v ∉ freeVars s_i))
(h7 : ∀ j : Fin Ds.length,
Provable SysConfig.Z
(Formula.impMany Ds
(mrFormula ν comp (ts.get (j.cast htsLen.symm)) (substBotWithX (Ds.get j)))))
(h8 : ∀ i : Fin Gs.length,
let G_i := Gs.get i
let w_i := ws.get (i.cast hwsLen.symm)
let s_i := ss.get (i.cast hssLen.symm)
let v_i := vs.get (i.cast hvsLen.symm)
Provable SysConfig.Z
(Formula.impMany Ds
(.imp
(mrFormula ν comp (w_i.map Term.var) (substBotWithX G_i))
(.imp
(.imp G_i (comp.apply (.var v_i)))
(comp.apply (applyGoalRealizer s_i w_i (.var v_i)))))))
(h9 : Provable SysConfig.Z
(Formula.impMany Ds
(Formula.allMany ys
(Formula.impMany Gs (comp.apply (Term.appMany r (ys.map Term.var)))))))
(hM : Derivable SysConfig.Z0 M (Formula.impMany Ds (goalImpliesBot ys Gs)))
(hMClosed : freeAssumpVars M = [])
(hMAdm : AdmissibleForExtraction ν dummy comp (substBotProof M)) :
let s := buildGoalCombinatorTerm ys ws ss r
Provable SysConfig.Z
(Formula.impMany Ds (comp.apply (extractClassicalTerm ν dummy M ts s))) := 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_5_1.lean
theorem_5_1 (Computational Content of Classical Proofs).
Given a simple type , a fallback term , a comprehension term (representing where has type and is a well-typed -formula), lists of formulas and , a list of object variables , a list of optional terms , a list of optional variables , a list of terms , a list of object variables , a term , and a natural deduction proof term , assume:
- (
hDs,hGs) Every and every is a well-typed -formula (FormulaWellTypedandisLFormula = true, containing no ). - (
htsLen,hwsLen,hssLen,hvsLen) The lists satisfy and . - (
hrTy) The term has the iterated function type (HasType r (Ty.arrMany (ys.map Var.ty) ν)). - (
htsTy) For every index :- if , then ;
- if , then for a term of type (
HasType t ρ); - the mismatched cases and do not occur.
- (
hwssTy) For every index , the variable has type (), and:- if , then and has type ;
- if , then with , and has type ;
- the mismatched cases and do not occur.
- (
hBindersFresh) Letting be the list of variables extracted from the entries of :- the concatenated list has no duplicates (
Nodup); - no variable occurs free in any or in ;
- no variable occurs free in any or in any ;
- every variable satisfies or ;
- no variable occurs free in any .
- the concatenated list has no duplicates (
- (
h7) For every , intuitionistic arithmetic proves (Provable SysConfig.Z)
- (
h8) For every , intuitionistic arithmetic proves
where is if and if .
9. (h9) Intuitionistic arithmetic proves
- (
hM,hMClosed,hMAdm) is a closed derivation in minimal arithmetic (Derivable SysConfig.Z0with ) of
and $M^X = \mathrm{substBotProof}(M)$ satisfies `AdmissibleForExtraction ν dummy comp (substBotProof M)`.
Then, letting (with entries of omitted in both binder and argument positions), intuitionistic arithmetic proves
where .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.