Structural Classification of Subterms of `r = nf(t F₁ ... Fₖ α)`
ProvedSchwichtenberg1976V2.normal_subterm_structureIn any β-normal term r of type 0 → 0 whose free variables lie in {F₁, ..., Fₖ : ν} ∪ {α : 0 → 0}, every subterm has type 0, 0 → 0, or ν; the only subterms of type ν are the variables Fᵢ; and every subterm of type 0 → 0 belongs to the inductive grammar IsType00Subterm (clauses (1)-(3), p. 114).
import Definitions.Def_Schwichtenberg1976V2_Lambda
namespace Schwichtenberg1976V2
/-- Structural classification of subterms of a β-normal term `r` of type `0 → 0`
whose free variables are contained in `F₁, ..., Fₖ` (of type `ν`) and `α` (of type `0 → 0`)
(p. 114, lines 3–13):
1. Every well-typed subterm `s` of `r` has type `0`, `0 → 0`, or `ν`.
2. Every subterm `s` of `r` of type `ν` is one of the variables `Fᵢ ∈ Fs`.
3. Every subterm `s` of `r` of type `0 → 0` is generated by clauses (1)–(3)
(`IsType00Subterm Fs α s`). -/
theorem normal_subterm_structure
(Fs : List Var) (α : Var) (r : Term)
(hFs : ∀ F ∈ Fs, F.ty = Ty.nu)
(hα : α.ty = Ty.endo)
(hr_ty : HasType r Ty.endo)
(hr_norm : IsBetaNormal r)
(hr_fv : ∀ v ∈ freeVars r, v ∈ Fs ∨ v = α) :
(∀ s τ, IsSubterm s r → HasType s τ → τ = .zero ∨ τ = Ty.endo ∨ τ = Ty.nu) ∧
(∀ s, IsSubterm s r → HasType s Ty.nu → ∃ F ∈ Fs, s = .var F) ∧
(∀ s, IsSubterm s r → HasType s Ty.endo → IsType00Subterm Fs α s) := by
sorry
end Schwichtenberg1976V2Read-back
What the Lean code literally says, in plain math · Gemini 4 Argon (Independent Blind Auditor)
The theorem normal_subterm_structure is universally quantified over a list of variables , a variable , and a term in the simply typed Church-style -calculus (where types Ty are built from base type and arrow , with and , and each variable is a pair ). It assumes the following five hypotheses:
hFs: For every variable , . (The list may be empty and may contain duplicate entries.)hα: .hr_ty: has type under the inductive typing relationHasType(where.var xhas type ,.app t shas type if has type and has type , and.lam x thas type if has type ).hr_norm: is -normal (IsBetaNormal r), meaninghasBetaRedex r = false, i.e., contains no subterm of the form .hr_fv: For every variable (where is the deduplicated list of free variable occurrences of , with filtering out occurrences equal to in both and ), either or .
Under these hypotheses, the theorem asserts the conjunction of three structural properties for all syntactic subterms of , where is the reflexive-transitive closure of passing from to or and from to (without renaming bound variables):
- Subterm types: For every term and type , if and has type (
HasType s τ), then , , or . - Subterms of type : For every term , if and has type (
HasType s Ty.nu), then there exists a variable such that is literally the variable term (). (In particular, if , no subterm of can have type .) - Subterms of type : For every term , if and has type (
HasType s Ty.endo), then holds, where the mutually inductive predicates , , and are defined by:- holds if and only if either , or for some variable and some term satisfying ;
- holds if and only if is a variable with and is obtained from by zero or more left-applications with each satisfying , i.e., for some ;
- holds if and only if either holds, or for some variables with and (not required to satisfy ) such that holds.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.