Theorems 2 & 3 (V5): Semantic Soundness of Sizes, Higher-Kinded Kinding, Subtyping, and the Fundamental Reducibility Lemma
ProvedNishtAbel2024V5.theorems_2_and_3Establishes the core semantic soundness theorems of System (Chapter 5, Sections 5.3–5.4 of Nisht and Abel 2024):\n\n1. Theorem 2 — Soundness of Size Judgments: Let be a size context and be valid ordinal valuations of satisfying for all . Then:\n
\n2. Theorem 2 — Soundness of Higher-Kinded Kinding and Polarized Subtyping: In any closed run-time world , well-formed size context , and valid valuation of , if then , and if then .\n3. Theorem 3 — Fundamental Lemma of Reducibility: If is a closed world, is semantically valid in , and all local calls into permitted by are semantically valid at their instantiated size arguments, then every well-typed closed expression satisfies , and every well-typed copattern clause list at type satisfies .\n\nThese results form the semantic bridge from syntactic typing and subtyping derivations in to strong normalization via ordinal-indexed reducibility candidates.
import Definitions.Def_NishtAbel2024V5_Syntax import Definitions.Def_NishtAbel2024V5_Semantics import Definitions.Def_NishtAbel2024V5_Inference
namespace NishtAbel2024V5
theorem theorems_2_and_3 :
(∀ (Ψ : SizeCtx) (ρ ρ' : SizeVal),
ValidVal Ψ ρ →
ValidVal Ψ ρ' →
(∀ i ∈ Ψ.dom, ρ i ≤ ρ' i) →
(∀ a : Size, SizeWf Ψ a → sizeVal ρ SzEnv.zero a ≤ sizeVal ρ' SzEnv.zero a) ∧
(∀ a b : Size, SizeLe Ψ a b → sizeVal ρ SzEnv.zero a ≤ sizeVal ρ' SzEnv.zero b) ∧
(∀ a b : Size, SizeLt Ψ a b → sizeVal ρ SzEnv.zero a < sizeVal ρ' SzEnv.zero b)) ∧
(∀ (W : World) (Ψ : SizeCtx) (ρ : SizeVal),
(∀ d ∈ W, (Tm.lam d.clauses).Closed) →
SizeCtxWf Ψ →
ValidVal Ψ ρ →
(∀ (F : Ty) (κ : Kind),
KindingC Ψ [] F κ →
Good W κ (interp W ρ TEnv.empty F κ.erase SzEnv.zero Env.empty)) ∧
(∀ (A B : Ty) (κ : Kind),
SubTy Ψ [] A B κ →
SemLe W κ (interp W ρ TEnv.empty A κ.erase SzEnv.zero Env.empty)
(interp W ρ TEnv.empty B κ.erase SzEnv.zero Env.empty))) ∧
(∀ (W : World) (Ω : TypingEnv) (Ψ : SizeCtx) (ρ : SizeVal),
(∀ d ∈ W, (Tm.lam d.clauses).Closed) →
SemValid W Ω.sig →
(∀ (Ψ' : SizeCtx) (ρ' : SizeVal) (g : FunDecl) (as : List Size),
g ∈ Ω.block → Ω.localOK Ψ' g.name as → ValidVal Ψ' ρ' →
∀ ρg : SizeVal, ValidVal g.sizeParams ρg →
g.sizeParams.map (fun p => ρg p.1) = as.map (sizeVal ρ' SzEnv.zero) →
Tm.fn g.name ∈ interpT W ρg TEnv.empty g.ty SzEnv.zero Env.empty) →
SizeCtxWf Ψ →
ValidVal Ψ ρ →
(∀ (t : Tm) (A : Ty),
ExprTy Ω Ψ [] [] t A →
KindingC Ψ [] A .star ∧ t ∈ interpT W ρ TEnv.empty A SzEnv.zero Env.empty) ∧
(∀ (D : List Clause) (A : Ty),
KindingC Ψ [] A .star →
(∀ cl ∈ D, ClauseTy Ω Ψ [] [] cl A) →
Tm.lam D ∈ interpT W ρ TEnv.empty A SzEnv.zero Env.empty)) := by sorry
end NishtAbel2024V5