Uniform realizers with free parameters (Theorem 5.2, corrected)
ProvedBBS2002.V2.theorem_5_2mathematical-logicprogram-extractionrealizabilitytype-theory
For a definite formula , a goal formula , an assigned type , and a typed closed dummy term, there are well-typed realizers and chosen independently of the comprehension term. Every object variable free in is free in , and every object variable free in is free in . For every comprehension term , . Also, for appropriately typed auxiliary variables fresh for and the free comprehension parameters, . The variable and the corresponding argument of are omitted when has omitted type. The terms are allowed to depend on the formulas' free object parameters; uniformity in does not require them to be closed.
Preamble
import Definitions.Def_BBS2002_V2_Realizability
Formal statement
namespace BBS2002.V2
/-- The realizers for a definite formula and a goal formula retain only their formulas'
free object parameters. The comprehension term is arbitrary; its free parameters need not
be disjoint from the free parameters of either formula. -/
theorem theorem_5_2
(ν : Ty) (dummy : Term)
(hDummyTy : HasType dummy ν)
(hDummyClosed : IsClosedTerm dummy)
(D G : Formula)
(hD : IsDefiniteFormula D)
(hG : IsGoalFormula G) :
(∃ t : Realizer (tau ν (substBotWithX D)),
t.Typed ∧
(∀ t₀ ∈ t.toOption, ∀ x ∈ freeVars t₀, x ∈ freeVarsFormula D) ∧
∀ comp : CompTerm ν,
Provable SysConfig.Z (.imp D (mrFormula ν comp (substBotWithX D) t))) ∧
(∃ s : Term,
HasType s
(match tau ν (substBotWithX G) with
| none => .arr ν ν
| some ρ => .arr ρ (.arr ν ν)) ∧
(∀ x ∈ freeVars s, x ∈ freeVarsFormula G) ∧
∀ (comp : CompTerm ν) (w : Option Var) (v : Var),
v.ty = ν →
(hw : w.map Var.ty = tau ν (substBotWithX G)) →
(∀ wVar ∈ w,
wVar ≠ v ∧
wVar ∉ freeVarsFormula G ∧
(wVar = comp.var ∨ wVar ∉ freeVarsFormula comp.body)) →
v ∉ freeVarsFormula G →
(v = comp.var ∨ v ∉ freeVarsFormula comp.body) →
Provable SysConfig.Z
(.imp
(mrFormula ν comp (substBotWithX G)
(Realizer.ofOption (w.map Term.var)
(by simpa only [Option.isSome_map] using congrArg Option.isSome hw)))
(.imp
(.imp G (comp.apply (.var v)))
(comp.apply (applyGoalRealizer s w (.var v)))))) := by
sorry
end BBS2002.V2Source
Ulrich Berger, Wilfried Buchholz, and Helmut Schwichtenberg, Refined program extraction from classical proofs, Annals of Pure and Applied Logic 114 (2002), pp. 3–25, https://doi.org/10.1016/S0168-0072(01)00073-2; page references below use the author's preprint pagination. Theorem 5.2, equations (12)–(13) and their canonical construction, preprint pp. 13–14.