Download lean/HyperKitty/Isomorphism.lean from Snapkitty/hyperkitty-constraint-dsl: direct link, hf CLI and curl.
- Browser
- Download file 5.02 kB
-
https://huggingface.co/Snapkitty/hyperkitty-constraint-dsl/resolve/main/lean/HyperKitty/Isomorphism.lean
- Command line
-
hf download hf://Snapkitty/hyperkitty-constraint-dsl/lean/HyperKitty/Isomorphism.lean
-
curl -L -o Isomorphism.lean https://huggingface.co/Snapkitty/hyperkitty-constraint-dsl/resolve/main/lean/HyperKitty/Isomorphism.lean
5.02 kB
Lean 4 · 13
declarations statementsfull
def glyphToQLG (g : Glyph) : Vec3 := body · 1 line
Vec3.ofGlyph gdef glyphToLedger (g : Glyph) : Ledger := body · 2 lines
let v := Vec3.ofGlyph g
Ledger.mkBalanced (v.x ^ 2 + v.y ^ 2 + v.z ^ 2) v.x (v.y * v.z)def ledgerToGlyph (λ : Ledger) : Option Glyph := body · 10 lines
if λ.balance then
if λ.δ = 1 && λ.ω = 0 then some Glyph.Pi
else if λ.δ = -1 && λ.ω = 0 then some Glyph.Gamma
else if λ.δ = 0 && λ.ω = 1 then some Glyph.Delta
else if λ.δ = 0 && λ.ω = -1 then some Glyph.Psi
else if λ.δ = 0 && λ.ω = 0 then some Glyph.Lambda
else if λ.δ = 0 && λ.ω = 0 then some Glyph.Omega
else none
else
nonetheorem iso_pi_qlg_sla :
let v := Vec3.ofGlyph Glyph.Pi proof · 4 lines
let λ := glyphToLedger Glyph.Pi
QLG.canonical v ∧ λ.balance := by
simp [Vec3.ofGlyph, glyphToLedger, QLG.canonical, Ledger.balance, Ledger.mkBalanced]
omegatheorem iso_gamma_qlg_sla :
let v := Vec3.ofGlyph Glyph.Gamma proof · 4 lines
let λ := glyphToLedger Glyph.Gamma
QLG.canonical v ∧ λ.balance := by
simp [Vec3.ofGlyph, glyphToLedger, QLG.canonical, Ledger.balance, Ledger.mkBalanced]
omegatheorem iso_delta_qlg_sla :
let v := Vec3.ofGlyph Glyph.Delta proof · 4 lines
let λ := glyphToLedger Glyph.Delta
QLG.canonical v ∧ λ.balance := by
simp [Vec3.ofGlyph, glyphToLedger, QLG.canonical, Ledger.balance, Ledger.mkBalanced]
omegatheorem iso_identity_sla_qra :
let λ := Ledger.mkBalanced 1 0 0 proof · 4 lines
let g := Glyph.Lambda
λ.balance ∧ g = Glyph.Lambda := by
simp [Ledger.balance, Ledger.mkBalanced]
omegatheorem iso_absorber_sla_qra :
let λ := Ledger.mkBalanced 1 0 0 proof · 4 lines
let g := Glyph.Omega
λ.balance ∧ g = Glyph.Omega := by
simp [Ledger.balance, Ledger.mkBalanced]
omegatheorem iso_roundtrip_identity (g : Glyph) :
∃ g' : Glyph,
ledgerToGlyph (glyphToLedger g) = some g' ∧
(g = Glyph.Pi ∨ g = Glyph.Gamma ∨ g = Glyph.Delta ∨
g = Glyph.Psi ∨ g = Glyph.Lambda ∨ g = Glyph.Omega) := by proof · 7 lines
cases g <;> simp [glyphToLedger, ledgerToGlyph, Ledger.mkBalanced, Ledger.balance, Vec3.ofGlyph]
· use Glyph.Pi; simp
· use Glyph.Gamma; simp
· use Glyph.Delta; simp
· use Glyph.Omega; simp
· use Glyph.Lambda; simp
· use Glyph.Psi; simptheorem iso_preserves_balance (g : Glyph) :
(glyphToLedger g).balance := by proof · 2 lines
simp [glyphToLedger, Ledger.balance, Ledger.mkBalanced]
omegatheorem iso_preserves_sphere_invariant (g : Glyph) :
QLG.canonical (Vec3.ofGlyph g) := by proof · 1 line
exact qlg_all_glyphs_on_sphere g
theorem iso_preserves_transitions (g1 g2 : Glyph) :
∀ g3 : Glyph, g3 = g1.next g2 → (glyphToLedger g1).balance ∧ (glyphToLedger g2).balance := by proof · 2 lines
intro g3 _
constructor <;> (simp [glyphToLedger, Ledger.balance, Ledger.mkBalanced]; omega)theorem iso_central_isomorphism :
∀ g : Glyph,
QLG.K = 1 ∧
(glyphToLedger g).ω ∈ ({-1, 0, 1} : Set ℤ) ∧
(g.idx : ℤ) < 6 := by proof · 5 lines
intro g
refine ⟨?_, ?_, ?_⟩
· rfl
· cases g <;> simp [glyphToLedger, Ledger.mkBalanced, Vec3.ofGlyph]; omega
· cases g <;> simp [Glyph.idx]; omegaOutline
- def
glyphToQLG22 - def
glyphToLedger34 - def
ledgerToGlyph42 - theorem
iso_pi_qlg_sla57 - theorem
iso_gamma_qlg_sla67 - theorem
iso_delta_qlg_sla77 - theorem
iso_identity_sla_qra87 - theorem
iso_absorber_sla_qra97 - theorem
iso_roundtrip_identity108 - theorem
iso_preserves_balance125 - theorem
iso_preserves_sphere_invariant134 - theorem
iso_preserves_transitions142 - theorem
iso_central_isomorphism152