Lemma 4.7 — Substitution bound for the step measure
OpenAehligSchwichtenberg2002V2.lemma_4_7For two typed terms with disjoint typing contexts and a variable , the bound is at most pointwise.
import Definitions.Def_AehligSchwichtenberg2002V2_Bounds
namespace AehligSchwichtenberg2002V2
theorem lemma_4_7 {Γ₁ Γ₂ : Context} {t s : Term} {τ ρ : Ty} (x : Var)
(ht : HasType Γ₁ t τ)
(hs : HasType Γ₂ s ρ)
(hdj : DisjointCtx Γ₁ Γ₂) :
PolyLe (theta (substTerm t x s)) (fun m => theta t m + theta s m) := by sorry
end AehligSchwichtenberg2002V2Read-back
What the Lean code literally says, in plain math · OpenAI Codex (GPT-6)
For all contexts , terms , types and variables , assume , , and and are disjoint. Then for every , . The type may differ from 's type, and may be absent from and from . The parameter includes . 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. For a term , is the maximum of and every variable identifier in , including the identifiers of abstraction binders. For variables and a term , renaming free to in replaces each variable node equal to by , leaves constants as they are and recurses into pairs, applications and braces. At an abstraction with binder it returns that abstraction as it is. At other abstractions it keeps the binder and recurses into the body, which permits the new occurrences of to be bound by an existing binder. For a natural bound , term , variable and replacement term , the substitution auxiliary function replaces a variable node by exactly when its variable equals , preserves constants, and recurses with bound into both children of pairs and applications and into the contents of braces. At a binder it returns the whole abstraction if . If and occurs free in , it gives the binder a new identifier and keeps its type. It renames free occurrences of in the body to the new variable, and recurses on the renamed body with bound . In the remaining case it preserves the binder and recurses on the body with bound . Write for substitution of for in , starting the auxiliary function with bound . A binder may be freshened by this operation even when has no free occurrence in its body. 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. The term length gives a variable or constant , an application the sum of its two lengths, an abstraction its body length plus , a pair the maximum of its two lengths plus , and a brace . For each , the weight is on variables and constants, uses the body weight on abstractions, uses the maximum of the two weights on pairs, and gives weight . The weight of is the sum of the weights of when the argument is other than a brace. The weight of is , with if returns and when the count is undefined. In particular, all terms have weight at .