Main Program Extraction Theorem for Classical Proofs (Corollary 5.3)
OpenBBS2002.corollary_5_3Corollary 5.3 (p. 14): For definite formulas D⃗ = D₁, ..., Dₙ and a goal formula G, there exist terms t₁, ..., tₙ, s determined by D⃗, G only such that for every Z_0-derivation M of D⃗ → ∀y(G → ⊥) → ⊥, Z ⊢ D⃗ → G[y := ⟦M^X⟧ t₁ ... tₙ s].
Superseded by BBS2002.V2.corollary_5_3. The original interface used comprehension-dependent admissibility that excluded parameterized inputs. V2 uses the corrected convention, records formula-parameter support, and explicitly exhibits successful raw extraction.
import Definitions.Def_BBS2002_Extraction
namespace BBS2002
/-- Corollary 5.3 (Refined Program Extraction from Classical Proofs, Section 5, p. 14):
Let `D⃗ = D₁, ..., Dₙ` be definite formulas and `G` a goal formula, and let `y` be an object variable
(with a closed dummy term `dummy` of type `y.ty`, and `y` not free in `D₁, ..., Dₙ`).
Then there exist `t₁, ..., tₙ` (`ts : List (Option Term)`) and `s : Term` — determined by
`D⃗, G` (and `y, dummy`) only — such that for every closed `Z_0`-derivation `M` of
`D⃗ → ∀y(G → ⊥) → ⊥` (admissible for extraction with respect to `A := λy. G`),
the extracted term `⟦M^X⟧ t₁ ... tₙ s` (`extractClassicalTerm y.ty dummy M ts s`) has type `y.ty`
and satisfies:
`Z ⊢ D⃗ → G[y := ⟦M^X⟧ t₁ ... tₙ s]`. -/
theorem corollary_5_3
(Ds : List Formula) (G : Formula) (y : Var) (dummy : Term)
(hDs : ∀ D ∈ Ds, IsDefiniteFormula D)
(hG : IsGoalFormula G)
(hyDs : ∀ D ∈ Ds, y ∉ freeVarsFormula D)
(hDummyTy : HasType dummy y.ty)
(hDummyClosed : IsClosedTerm dummy) :
∃ (ts : List (Option Term)) (s : Term),
ts.length = Ds.length ∧
(∀ (M : ProofTerm) (compG : CompTerm y.ty),
compG.var = y →
compG.body = G →
Derivable SysConfig.Z0 M (Formula.impMany Ds (goalImpliesBot [y] [G])) →
freeAssumpVars M = [] →
AdmissibleForExtraction y.ty dummy compG (substBotProof M) →
HasType (extractClassicalTerm y.ty dummy M ts s) y.ty ∧
Provable SysConfig.Z
(Formula.impMany Ds
(substFormula G y (extractClassicalTerm y.ty 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_corollary_5_3.lean
corollary_5_3 (Main Program Extraction Theorem for Classical Proofs).
For any finite list of formulas , any formula , any typed object variable , and any fallback term , assume:
- (
hDs) every formula is a definite formula (IsDefiniteFormula D); - (
hG) is a goal formula (IsGoalFormula G); - (
hyDs) the variable does not occur free in any (); - (
hDummyTy,hDummyClosed) is a closed System term of type (HasType dummy y.tyandIsClosedTerm dummy).
Then there exist a list of optional System terms and a System term (depending only on , , , and , and independent of the derivation ) such that:
- ; and
- for every natural deduction proof term and every comprehension term satisfying and (representing ), if:
- derives the classical existence formula
(`Formula.impMany Ds (goalImpliesBot [y] [G])`) in minimal arithmetic $Z_0$ (`Derivable SysConfig.Z0`),
- has no free assumption variables (), and
- satisfies the variable-hygiene condition
AdmissibleForExtraction y.ty dummy compG (substBotProof M), then the extracted classical program term
has type (HasType t_ext y.ty), and intuitionistic arithmetic proves (Provable SysConfig.Z)
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.