Proposition 3.4: unique readability of terms
ProvedMSKleene.term_charUnique readability of terms (Proposition 3.4).
For every sort and every , exactly one of the following holds, and the data is unique in each case: (1) for a unique variable ; (2) for a unique constant symbol ; (3) for a unique non-empty arity , a unique , and a unique family .
import Definitions.Def_MSKleene_Term
namespace MSKleene
/-- **Unique readability of terms** (Proposition 3.4).
For every sort `s` and every term `P ∈ T_Σ(X)_s`, there is a unique
decomposition belonging to exactly one of the following cases:
1. `P = var x` for a unique variable `x ∈ X_s`;
2. `P = app σ .nil` for a unique constant symbol `σ ∈ Σ_{[],s}`;
3. `P = app σ ts` for a unique non-empty arity `w`, a unique `σ ∈ Σ_{w,s}`, and
a unique argument vector `ts`. -/
theorem term_char {S : Type} (sig : Signature S) (X : SSet S) {s : S}
(P : Term sig X s) :
∃! c : X s ⊕ (sig [] s ⊕ ((w : List S) × sig w s × TermVec sig X w)),
match c with
| .inl x => P = Term.var x
| .inr (.inl σ) => P = Term.app σ TermVec.nil
| .inr (.inr p) => p.1 ≠ [] ∧ P = Term.app p.2.1 p.2.2 := by
sorry
end MSKleene
Read-back
What the Lean code literally says, in plain math · gpt-5
For every type of sorts, every -sorted signature assigning a type of operation symbols to each finite list of input sorts and output sort , every -indexed family , every sort , and every term of sort , there exists exactly one tagged datum
satisfying its corresponding condition: if is tagged as a variable , then ; if is tagged as a nullary symbol , then ; and if is tagged as , where and is a heterogeneous vector containing one term of each successive sort in , then and . Here terms are generated inductively from variables and applications, and term vectors are generated from the empty vector and by prepending a term of the required sort. No finiteness, nonemptiness, or decidable-equality assumption is imposed on , , or ; empty components and empty collections of symbols are therefore included wherever the supplied term permits them.
Confirmed by the mission captain (proposal self-audit).