Encodings: constructed Gödel / Ackermann, constructed quotient bijection #
fromNat/toNatis the Ackermann coding of hereditarily finite sets.toNat (fromNat n) = nis a theorem; the other direction holds asExtEq(syntactic HF trees are not unique).subToNat/natToSubis a Gödel numbering of the ISK fragment.layerToNat/natToLayeris a constructednoncomputablebijectionNat ≃ InvariantLayer: enumerate OperEq classes in min-Gödel order (k-th least code of a class). Notcanonical_rep.natToLayer_inverseis notrflon raw Gödel numbers of non-minimal terms (godelClass 3).
ISK Gödel numbering via Mathlib pairing #
Equations
- ISAR.iskToNat ISAR.ITerm.norm = 0
- ISAR.iskToNat ISAR.ITerm.konst = 1
- ISAR.iskToNat ISAR.ITerm.sₛ = 2
- ISAR.iskToNat (f · x_1) = Nat.pair (ISAR.iskToNat f) (ISAR.iskToNat x_1) + 3
- ISAR.iskToNat (ISAR.ITerm.var a) = 0
- ISAR.iskToNat ISAR.ITerm.dup = 0
- ISAR.iskToNat ISAR.ITerm.swap = 0
- ISAR.iskToNat ISAR.ITerm.comp = 0
Instances For
@[irreducible]
Equations
Instances For
Equations
- ISAR.fromNatInsert n rec 0 = HF.empty
- ISAR.fromNatInsert n rec k.succ = if h : k < n then if n.testBit k = true then (rec k h).insert (ISAR.fromNatInsert n rec k) else ISAR.fromNatInsert n rec k else ISAR.fromNatInsert n rec k
Instances For
@[irreducible]
Equations
- ISAR.fromNat n = ISAR.fromNatInsert n (fun (m : ℕ) (x : m < n) => ISAR.fromNat m) n
Instances For
Countable bijection on the OperEq quotient (min-Gödel enumeration) #
The OperEq class of the ISK term with Gödel number n. Surjective, not injective.
Equations
Instances For
n is the least Gödel number of its class.
Equations
- ISAR.isMinCode n = ∀ m < n, ISAR.godelClass m ≠ ISAR.godelClass n
Instances For
Rank of a min-code among all strictly smaller min-codes.
Equations
Instances For
theorem
ISAR.minCodeRank_inj
{n m : ℕ}
(hn : isMinCode n)
(hm : isMinCode m)
(heq : minCodeRank n = minCodeRank m)
:
theorem
ISAR.exists_minCode_of_rank_aux
{N k : ℕ}
(hk : k < (Finset.filter isMinCode (Finset.range N)).card)
:
∃ n < N, isMinCode n ∧ minCodeRank n = k
Equations
Instances For
Equations
- ISAR.kSpineSub n = ⟨ISAR.kSpine n, ⋯⟩
Instances For
theorem
ISAR.kSpine_layer_inj
{i j : ℕ}
(h : toInvariantLayer (kSpineSub i) = toInvariantLayer (kSpineSub j))
:
theorem
ISAR.minCode_kSpine_inj
{i j : ℕ}
(h : minCode (toInvariantLayer (kSpineSub i)) = minCode (toInvariantLayer (kSpineSub j)))
:
k-th least min-Gödel code (enumeration of distinct OperEq classes).
Equations
Instances For
Index of an OperEq class in min-Gödel order. Not the raw Gödel number.
Equations
Instances For
Raw Gödel number 3 is norm · norm, which joins to norm (code 0). The inverse
is therefore not rfl on non-minimal codes.
Equations
- ISAR.HF_encode c = ISAR.natToLayer (toNat c)