Proposition 3.6 — Canonical forms of normal almost closed terms
OpenAehligSchwichtenberg2002V2.proposition_3_6A normal term whose free variables all have token type has a canonical outer form at each of the following types. A list-typed term is a list spine, a Boolean is or , and a term of token type is a variable of token type.
import Definitions.Def_AehligSchwichtenberg2002V2_Syntax
namespace AehligSchwichtenberg2002V2
theorem proposition_3_6 {Γ : Context} {t : Term}
(hac : IsAlmostClosed t) (hnorm : IsNormal t) :
(∀ τ : Ty, HasType Γ t (.list τ) → IsListTerm t) ∧
(HasType Γ t .bool → t = .const .tt ∨ t = .const .ff) ∧
(HasType Γ t .diamond → ∃ x : Var, x.ty = .diamond ∧ t = .var x) := by sorry
end AehligSchwichtenberg2002V2Read-back
What the Lean code literally says, in plain math · OpenAI Codex (GPT-6)
For every context and raw term , assume every free variable of has type and is normal. The three conclusions hold together. For every type , if , there exists such that returns . If , is literally one of the constants and . If , there is a variable of type such that is literally the variable term . The free-variable premise includes terms with no free variables, and context entries may have any type. The typing premises of the three implications can all be false, as with . The types are generated by , , arrows , tensors , products , and lists . A variable is a pair of a natural-number identifier and a type. Equality of variables compares both entries. The terms are variables, constants, abstractions , pairs , applications , and braces . Successive applications associate to the left and arrow chains associate to the right. The constants and have declared type . For every type , the constants and have declared types and . For all types , has declared type . Contexts are lists of variables. A context is a union of two operand contexts if each variable belongs to the result exactly when it belongs to at least one operand. A disjoint union additionally requires that the operands have no common variable. These relations permit arbitrary ordering and repetitions within a context. The typing relation is generated by the variable rule in any context containing that variable, and the constant rule in any context with the declared constant type. An abstraction has type in if has declared type and has type in a union of and the singleton list . An application has type in a disjoint union of contexts typing at and at . The pair has type if has type and has type in the same context. A term of product type gives applications and of types and in its context. If has Boolean type and both and have type in a shared context disjoint from the context of , then has type in their disjoint union. For distinct variables of types , respectively, has type in a disjoint union of a context typing at and a context disjoint from , provided has type in a union of and . If has type and has type in the empty context, has type in the context of . The free occurrences of a variable term are its singleton list and a constant contributes none. An abstraction filters the occurrences of its binder from those of its body, a pair or application concatenates the two occurrence lists from left to right, and braces use the occurrence list of their contents. The list retains the first occurrence of each distinct variable in the resulting list. The optional list entry count returns on any , returns on if returns a number, and is undefined otherwise. It looks at the rightmost tail argument of each fully applied , permits any parameters on the constructors along that chain, and ignores the contents of the other two arguments. A term is normal when none of the nodes reached from its root through only application nodes, including the root itself, has any of these forms. The forms are an applied abstraction, a pair applied to or , or applied to a pair, applied to two terms and a double abstraction whose distinct binders have types , applied to a brace and another term, and a fully applied with a countable tail further applied to a brace and another term. Abstractions, pairs and braces are normal at the root regardless of their contents.