Lemma 2.11 — Type and free-variable preservation
OpenABHS2004V2.lemma_2_11One-step reduction of an affinely typed term preserves the type and introduces no new free variables.
import Definitions.Def_ABHS2004V2_TermSystem
namespace ABHS2004V2
/-- Lemma 2.11. One-step reduction preserves the program's type and introduces no
new free variables. -/
theorem lemma_2_11 {r s : Term} {ρ : Ty}
(ht : HasType r ρ) (hred : RedStep r s) :
HasType s ρ ∧ ∀ v ∈ freeVarOccurrences s, v ∈ freeVarOccurrences r := by sorry
end ABHS2004V2Read-back
What the Lean code literally says, in plain math · OpenAI Codex (GPT-6)
For every pair of terms and type , assume has type by the term typing rules and reduces to in one step. Then has the same type , and for every variable occurring free in , occurs free in . The latter conclusion compares membership of typed variables in the free-occurrence lists.
The typing judgment gives a variable its recorded type, a constant its declared type, and the type when has type . To type at , the rules require at , at , and disjoint free-variable lists in the sense of no shared member. To type at , they require at and a closed at , with arrows associated to the right. A variable is a pair of a natural-number identifier and a type. Its sole occurrence is free as a variable term. Constants contribute no occurrences, abstractions remove all occurrences of the binder, and applications and iterators concatenate their children's free-occurrence lists.
A step contracts one of the following syntactic conversions at the root or inside either child of an application or iterator. With application associating to the left, denotes the iterator with list term and step term . Write for the tensor introduction, tensor elimination, product introduction, two product projections, two sum injections, and sum elimination constants. For any type parameters , the conversions are with capture-avoiding substitution, , , , and , with and in the right-branch rule. The list conversions are and , the latter when is a chain of fully applied cons constants ending in a nil constant. The step contexts consist exactly of the root and descendants reached by those application and iterator rules.