Shared generic support for the EM term-model constructions #
Language-independent lemmas consumed by BOTH the original skolemColim-based EM term model
(EMTermModel.lean) and the countable local stack (LocalEMFamily.lean /
LocalEMContext.lean) — extracted here (2026-07-02) so the local stack does not have to import
EMTermModel.lean:
- two Mathlib-gap
Termlemmas:Term.varFinset_relabelandTerm.realize_eq_of_eq_on_varFinset; - the ordered-support rank machinery
deepRank(the 0-indexed position of an element in a finiteJ-support, in increasing order) with its inverse/monotonicity lemmas againstFinset.orderEmbOfFin.
The variables of a relabeled term are the image of the original variables (a Mathlib gap).
A term's realization depends only on the assignment of the variables that actually appear (a Mathlib gap).
Ordered support (ranks) #
The rank of j in a finite support S: the number of support elements below it, i.e. its
0-indexed position in the increasing J-order. So a support {j₀ < j₁ < …} has ranks 0, 1, …
and the deep interpretation sends it to a_d, a_{d+1}, … (a strictly-increasing deep tuple).
Equations
- FirstOrder.Language.deepRank J S j = {x ∈ S | x < j}.card
Instances For
On the support, ranks strictly increase with J-order: the deep tuple is strictly increasing,
hence injective on the support.
The rank of the i-th support element (in increasing order) is i: the enumeration
orderEmbOfFin and the rank are mutually inverse. The elements of S strictly below the i-th
are exactly the first i.
The rank of a support element is below the cardinality: a valid Fin S.card position.