Skeleton compression: finite-support term codes #
The generic compression layer of the countably-many-types project (issue #11 unit 3a),
independent of the local EM quotient: a closed Λ[[J]]-term supported in a finite S : Finset J
is coded by replacing each skeleton constant with its RANK in the increasing enumeration of S
(locJCompress), forgetting the actual J-values while retaining the term shape and the
equality/order pattern of the support. The inverse is expansion along any increasing embedding
(locJExpand). The round trips:
locJExpand_compress— expanding alongS's own enumeration recovers the term;locJCompress_expand— compressing an expansion recovers the code;locJRename_expand— ife ∘ s = tpointwise then renaming alongecarries thes-expansion to thet-expansion (the lemma the orbit theorem consumes);locJSupport_locJExpand— the support of an expansion is the image of the code's support.
The tuple-code type LocalEMTupleCode Λ n (Σ k, Fin n → Λ[[Fin k]].Term Empty) is COUNTABLE
for a countable base language (countable_localEMTupleCode) — the quotient-tuple coding and
the orbit theorem are unit 3b (LocalEMTupleOrbit.lean).
Skeleton compression: replace each skeleton constant of an S-supported closed term by
its rank in the increasing enumeration of S.
Equations
- Λ.locJCompress J S (FirstOrder.Language.var e) x_2 = e.elim
- Λ.locJCompress J S (FirstOrder.Language.func (Sum.inl f') ts) h = FirstOrder.Language.func (Sum.inl f') fun (i : Fin l) => Λ.locJCompress J S (ts i) ⋯
- Λ.locJCompress J S (FirstOrder.Language.func (Sum.inr j) _ts) h = FirstOrder.Language.func (have this := Sum.inr ⟨FirstOrder.Language.deepRank J S j, ⋯⟩; this) Fin.elim0
- Λ.locJCompress J S (FirstOrder.Language.func (Sum.inr c) _ts) x_2 = PEmpty.elim c
Instances For
Skeleton expansion along an increasing embedding: interpret the Fin k constants by the
embedded skeleton points.
Equations
- Λ.locJExpand J s u = (Λ.lhomWithConstantsMap ⇑s).onTerm u
Instances For
The support of an expansion is the image of the code's support.
Round trip 1: expanding along S's own increasing enumeration recovers the term.
Round trip 2: compressing an expansion along S's enumeration recovers the code.
Round trip 3 (the orbit-theorem workhorse): if e carries the embedding s pointwise
to t, then renaming along e carries the s-expansion to the t-expansion.
The countable tuple-code type #
The code of an n-tuple: a compression arity k together with n closed terms over the
compressed skeleton Fin k.
Equations
- Λ.LocalEMTupleCode n = ((k : ℕ) × (Fin n → (Λ.withConstants (Fin k)).Term Empty))
Instances For
Countability of the code type: for a countable base language, there are only countably many tuple codes at each arity.