Let's build a <REDACTED> HoTT extension to CCHM/CHM/HTS type systems targeting GAP…
Private research annotation
Sign in to add a private research label or note.
- User
Let's build a HoTT extension to CCHM/CHM/HTS type systems targeting GAP replacement, infinity-gategorical framework like prover (Riehl, Shulman) for Simplex and types built into type checker. Then gradually extent type inference rules for Group, Monoid, Category, Chain, Ring, Field. As eliminators I propose Face, , Composition, as Introduction inference rule I propose Simplicial Object with common syntax: def : := П (context), conditions ⊢ (elements | constraints) def chain : Chain := П (context), conditions ⊢ n (, C₁, ..., Cₙ | ∂₀, , ..., ∂ₙ₋₁) def simplicial : Simplicial := П (context), conditions ⊢ n (s₀, s₁, ..., sₙ | facemaps, degeneracies) def group : Group := П (context), conditions ⊢ n (generators | relations) def cat : Category := П (context), conditions ⊢ n (objects | morphisms | coherence) Consider examples: def Möbius : Simplex := П (a b c : Simplex), (bc ac : Simplex), ab = bc ∘ ac ⊢ 2 (a b c | bc ac ab) def s1_infty : Simplicial := П (v e : Simplex), ∂₁₀ = v, ∂₁₁ = v, s₀ < v, ∂₂₀ = e ∘ e, s₁₀ < ∂₂₀ ⊢ ∞ (v, e, ∂₂₀ | ∂₁₀ ∂₁₁, s₀, ∂₂₀, s₁₀) def z3 : Group := П (e a : Simplex), a³ = e ⊢ 1 (a | a³ = e)
- Assistant
- User
Simulate a type-checking for the given examples.
- Assistant
- User
Could I give you more examples and my version of type checker for you to verify?
- Assistant
Absolutely, I’d love to see more examples and your version of the type checker! Feel free to share as many examples as you’d like, along with your type checker design—whether it’s a formal set of rules, pseudocode, or a conceptual outline. I’ll verify them against the simplicial framework we’ve been discussing, check for consistency, and offer feedback or refinements. Go ahead and lay out what you’ve got!
- User
Category with Group (Path Category with Z/2Z): def path_z2_category : Category := П (x y : Simplex), (f g h : Simplex), (z2 : Group(П (e a : Simplex), a² = e ⊢ 1 (a | a² = e))), f ∘ g = h ⊢ 2 (x y | f g h | f ∘ g = h) GF(2⁴) Finite Field: def : Field := П (x y s p d : Simplex), x + y = s, x ⋅ y = p, x / y = d, x = ^4), y = ^4)^2, s = ^4) + Z(2^4)^2, p = ^4)^3, d = ^4)^14 ⊢ 5 (x y s p d | x + y = s, x ⋅ y = p, x / y = d, x = ^4), y = ^4)^2, s = ^4) + Z(2^4)^2, p = ^4)^3, d = ^4)^14) GF(7) Prime Field: def gf7 : Field := П (x y s p d : Simplex), x + y = s, x ⋅ y = p, x / y = d, x = 2, y = 3, s = 5, p = 6, d = 3 ⊢ 5 (x y s p d | x + y = s, x ⋅ y = p, x / y = d, x = 2, y = 3, s = 5, p = 6, d = 3) Poly Ring spectrum: def poly_ring_zx : Ring := П (f g s p : Simplex), f + g = s, f ⋅ g = p, f = x + 1, g = 2 ⋅ x, s = 3 ⋅ x + 1, p = 2 ⋅ x ⋅ x + 2 ⋅ x ⊢ 4 (f g s p | f + g = s, f ⋅ g = p, f = x + 1, g = 2 ⋅ x, s = 3 ⋅ x + 1, p = 2 ⋅ x ⋅ x + 2 ⋅ x)
- Assistant
- User
The type checker AST Types: type superscript = S1 | S2 | S3 | S4 | S5 | S6 | S7 | S8 | S9 | S1 | S2 | S3 | S4 | S5 | S6 | S7 | S8 | S9 | S1 | S2 | S3 | S4 | S5 | S6 | S7 | S8 | S9 | S1 | S2 | S3 | S4 | S5 | S6 | S7 | S8 | S9 | S1 | S2 | S3 | S4 | S5 | S6 | S7 | S8 | S9 | S1 | S2 | S3 | S4 | S5 | S6 | S7 | S8 | S9 | S1 | S2 | S3 | S4 | S5 | S6 | S7 | S8 | S9 | S1 | S2 | S3 | S4 | S5 | S6 | S7 | S8 | S9 | S1 | S2 | S3 | S4 | S5 | S6 | S7 | S8 | S9 type type_name = Simplex | Group | Simplicial | Chain | Category | | Ring | Field type term = | Id of string | Comp of term * term | Inv of term | Pow of term * superscript | E | Matrix of int list list | Add of term * term (* r₁ + r₂ r₁ ⋅ r₂ r₁ / r₂ e.g., (a b c : Simplex) e.g., ac = ab ∘ bc e.g., ∂₁ = C₂ < C₃ Updated to support ∞ Optional: only for Parsing helpers *) let parse_superscript = function | "¹" -> S1 | "²" -> S2 | "³" -> S3 | "⁴" -> S4 | "⁵" -> S5 | "⁶" -> S6 | "⁷" -> S7 | "⁸" -> S8 | "⁹" -> S9 | _ -> failwith "Invalid superscript" let parse_n s = match s with | "∞" -> Infinite | n -> Finite (int_of_string n) Example: let mobius = { name = ""; typ = Simplex; context = [ (["a"; "b"; "c"], Simplex); (["ab"; "bc"; "ac"], Simplex); Equality ("ab", Comp (Id "bc", Id "ac"), Id "ab") ]; rank = Finite 2; elements = ["a"; "b"; "c"]; faces = Some ["bc"; "ac"; "ab"]; constraints = [ (Id "ab", Comp (Id "bc", Id "ac"))] }
- Assistant