{"id":25882073,"url":"https://github.com/groupoid/dan","last_synced_at":"2026-05-15T05:13:54.338Z","repository":{"id":278915897,"uuid":"937164161","full_name":"groupoid/dan","owner":"groupoid","description":"🧊 Сімпліціальна теорія типів","archived":false,"fork":false,"pushed_at":"2026-03-10T17:16:43.000Z","size":390,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-21T22:11:04.747Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://dan.groupoid.space/","language":"OCaml","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/groupoid.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-02-22T13:46:11.000Z","updated_at":"2026-03-10T17:16:48.000Z","dependencies_parsed_at":"2025-04-24T09:44:01.728Z","dependency_job_id":null,"html_url":"https://github.com/groupoid/dan","commit_stats":null,"previous_names":["groupoid/dan"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/groupoid/dan","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/groupoid%2Fdan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/groupoid%2Fdan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/groupoid%2Fdan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/groupoid%2Fdan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/groupoid","download_url":"https://codeload.github.com/groupoid/dan/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/groupoid%2Fdan/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33054592,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-15T02:00:06.351Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-02T15:57:07.855Z","updated_at":"2026-05-15T05:13:54.322Z","avatar_url":"https://github.com/groupoid.png","language":"OCaml","funding_links":[],"categories":[],"sub_categories":[],"readme":"Dan Kan: Simplicial HoTT\n========================\n\nGroupoid Infinity Simplicial HoTT Computer Algebra System is a pure algebraїc implementation\nwith explicit syntaxt for fastest type checking. It supports following extensions: `Chain`,\n`Cochain`, `Simplex`, `Simplicial`, `Category`, `Monoid`, `Group`, `Ring`.\nSimplicial HoTT is a Rezk/GAP replacement incorporated into CCHM/CHM/HTS Agda-like Anders/Dan\nwith Kan, Rezk and Segal simplicial modes for computable ∞-categories.\n\n\u003cimg src=\"styles/Daniel_Kan.JPG\"/\u003e\n\n## Abstract\n\nWe present a domain-specific language (DSL), the extension to Cubical Homotopy Type Theory (CCHM) for simplicial structures,\ndesigned as a fast type checker with a focus on algebraic purity. Built on the Cohen-Coquand-Huber-Mörtberg (CCHM)\nframework, our DSL employs a Lean/Anders-like sequent syntax `П (context) ⊢ k (v₀, ..., vₖ | f₀, ..., fₗ | ... )` to define \nk-dimensional `0, ..., n, ∞` simplices via explicit contexts, vertex lists, and face relations, eschewing geometric coherence terms\nin favor of compositional constraints (e.g., `f = g ∘ h`). The semantics, formalized as inference rules in a Martin-Löf\nType Theory MLTT-like setting, include Formation, Introduction, Elimination, Composition, Computational, and\nUniqueness rules, ensuring a lightweight, deterministic computational model with linear-time type checking (O(k + m + n),\nwhere k is vertices, m is faces, and n is relations). Inspired by opetopic purity, our system avoids cubical\npath-filling (e.g., `PathP`), aligning with syntactic approaches to higher structures while retaining CCHM’s\ntype-theoretic foundation. Compared to opetopic sequent calculi and the Rzk prover, our DSL balances algebraic\nsimplicity with practical efficiency, targeting simplicial constructions over general ∞-categories,\nand achieves a fast, pure checker suitable for formal proofs and combinatorial reasoning.\n\n## Setup\n\n```\n$ ocamlopt -o dan src/simplicity.ml \u0026\u0026 ./dan\n```\n\n## Syntax\n\nIncorporating into CCHM/CHM/HTS Anders/Dan core.\n\n### Definition\n\nNew sequent contruction:\n\n```\ndef \u003cname\u003e : \u003ctype\u003e := П (context), conditions ⊢ \u003cn\u003e (elements | constraints)\n```\n\nInstances:\n\n```\ndef chain : Chain := П (context), conditions ⊢ n (C₀, C₁, ..., Cₙ | ∂₀, ∂₁, ..., ∂ₙ₋₁)\ndef simplicial : Simplicial := П (context), conditions ⊢ n (s₀, s₁, ..., sₙ | facemaps, degeneracies)\ndef group : Group := П (context), conditions ⊢ n (generators | relations)\ndef cat : Category := П (context), conditions ⊢ n (objects | morphisms | coherence)\n```\n\n### BNF\n\n```\n\u003cprogram\u003e ::= \u003cdefinition\u003e | \u003cdefinition\u003e \u003cprogram\u003e\n\u003cdefinition\u003e ::= \"def\" \u003cid\u003e \":\" \u003ctype-name\u003e \":=\" \u003ctype-term\u003e\n\u003ctype-name\u003e ::= \"Simplex\" | \"Simplicial\" | \"Chain\" | \"Cochain\"\n                          | \"Category\"  | \"Group\" | \"Monoid\" | \"Ring\" | \"Field\"\n\u003ctype-term\u003e ::= \"П\" \"(\" \u003ccontext\u003e \")\" \"⊢\" \u003cn\u003e \"(\" \u003celements\u003e \"|\" \u003cconstraints\u003e \")\"\n\u003cdigit\u003e ::= \"0\" | \"1\" | \"2\" | \"3\" | \"4\" | \"5\" | \"6\" | \"7\" | \"8\" | \"9\"\n\u003csuperscript\u003e ::= \"¹\" | \"²\" | \"³\" | \"⁴\" | \"⁵\" | \"⁶\" | \"⁷\" | \"⁸\" | \"⁹\"\n\u003cn\u003e ::= \u003cdigit\u003e | \u003cdigit\u003e \u003cn\u003e | \"∞\"\n\u003ccontext\u003e ::= \u003chypothesis\u003e | \u003chypothesis\u003e \",\" \u003ccontext\u003e\n\u003chypothesis\u003e ::= \u003cid\u003e \":\" \u003ctype-term\u003e               % Single declaration, e.g., a : Simplex\n               | \"(\" \u003cid-list\u003e \":\" \u003ctype-term\u003e \")\"  % Grouped declaration, e.g., (a b c : Simplex)\n               | \u003cid\u003e \"=\" \u003ct\u003e \"\u003c\" \u003ct\u003e               % Map, e.g., ∂₁ = C₂ \u003c C₃\n               | \u003cid\u003e \"=\" \u003ct\u003e                        % Equality, e.g., x = 2\n               | \u003cid\u003e \"=\" \u003ct\u003e \"∘\" \u003ct\u003e               % Monoid composition, e.g., ac = ab ∘ bc\n               | \u003cid\u003e \"=\" \u003ct\u003e \"+\" \u003ct\u003e               % Ring addition, e.g., x + y = s\n               | \u003cid\u003e \"=\" \u003ct\u003e \"⋅\" \u003ct\u003e               % Ring multiplication, e.g., x ⋅ y = p\n               | \u003cid\u003e \"=\" \u003ct\u003e \"/\" \u003ct\u003e               % Field division, e.g., x / y = d\n\u003cid-list\u003e ::= \u003cid\u003e | \u003cid\u003e \u003cid-list\u003e                 % e.g., a b c\n\u003celements\u003e ::= \u003celement-list\u003e | ε\n\u003celement-list\u003e ::= \u003cid\u003e | \u003cid\u003e \",\" \u003celement-list\u003e\n\u003cconstraints\u003e ::= \u003cconstraint-list\u003e | ε\n\u003cconstraint-list\u003e ::= \u003cconstraint\u003e | \u003cconstraint\u003e \",\" \u003cconstraint-list\u003e\n\u003cconstraint\u003e ::= \u003ct\u003e \"=\" \u003ct\u003e                        % Equality, e.g., a = 2\n               | \u003ct\u003e \"∘\" \u003ct\u003e \"=\" \u003ct\u003e                % Monoid composition, e.g., a ∘ a = e\n               | \u003ct\u003e \"+\" \u003ct\u003e \"=\" \u003ct\u003e                % Ring addition, e.g., x + y = s\n               | \u003ct\u003e \"⋅\" \u003ct\u003e \"=\" \u003ct\u003e                % Ring multiplication, e.g., x ⋅ y = p\n               | \u003ct\u003e \"/\" \u003ct\u003e \"=\" \u003ct\u003e                % Field division, e.g., x / y = d\n               | \u003cid\u003e \"\u003c\" \u003cid\u003e                      % Map, e.g., ∂₁ \u003c C₂\n\u003ct\u003e ::= \u003cid\u003e                                        % e.g., a\n      | \u003ct\u003e \"∘\" \u003ct\u003e                                 % e.g., a ∘ b\n      | \u003ct\u003e \"+\" \u003ct\u003e                                 % e.g., x + y\n      | \u003ct\u003e \"⋅\" \u003ct\u003e                                 % e.g., x ⋅ y\n      | \u003ct\u003e \"/\" \u003ct\u003e                                 % e.g., x / y\n      | \u003ct\u003e \"^-1\"                                   % e.g., a^-1\n      | \u003ct\u003e \"^\" \u003csuperscript\u003e                       % e.g., a³\n      | \"e\"                                         % identity\n      | \u003cnumber\u003e                                    % e.g., 2\n      | \u003cmatrix\u003e                                    % e.g., [[1,2],[3,4]]\n\u003cnumber\u003e ::= \u003cdigit\u003e | \u003cdigit\u003e \u003cnumber\u003e             % e.g., 123\n\u003cmatrix\u003e ::= \"[\" \u003crow-list\u003e \"]\"                     % e.g., [[1,2],[3,4]]\n\u003crow-list\u003e ::= \u003crow\u003e | \u003crow\u003e \",\" \u003crow-list\u003e\n\u003crow\u003e ::= \"[\" \u003cnumber-list\u003e \"]\"                     % e.g., [1,2]\n\u003cnumber-list\u003e ::= \u003cnumber\u003e | \u003cnumber\u003e \",\" \u003cnumber-list\u003e  % e.g., 1,2\n```\n\nMeaning of `\u003cn\u003e` Across Types:\n\n* Simplex: Dimension of the simplex—e.g., n=2 for a triangle (2-simplex).\n* Group: Number of generators—e.g., n=1 for Z/3Z (one generator a).\n* Simplicial: Maximum dimension of the simplicial set—e.g., n=1 for S1 (up to 1-simplices).\n* Chain: Length of the chain (number of levels minus 1)—e.g., n=2 for a triangle chain (0, 1, 2 levels).\n* Category: Number of objects—e.g., n=2 for a path category (two objects x,y).\n* Monoid: Number of generators—e.g., n=2 for N (zero and successor).\n\n## Semantics\n\n### Chain\n\n* Formation. Γ ⊢ Chain : Set\n* Intro. Γ ⊢ n (S `|` R) : Chain  if  Γ = s₀₁, …, sₙₘₙ : Simplex, r₁, …, rₚ ∧ S₀, S₁, …, Sₙ = (s₀₁, …, s₀ₘ₀), …, (sₙ₁, …, sₙₘₙ) ∧ ∀ rⱼ = tⱼ = tⱼ', Γ ⊢ rⱼ : tⱼ = tⱼ' ∧ ∀ ∂ᵢⱼ \u003c sₖₗ, Γ ⊢ ∂ᵢⱼ : sₖₗ → sₖ₋₁,ₘ\n* Elim Face. Γ ⊢ ∂ᵢⱼ s : Simplex  if  Γ ⊢ n (S `|` R) : Chain ∧ r = ∂ᵢⱼ \u003c s ∧ r ∈ R ∧ s ∈ S\n* Comp Face. ∂ᵢⱼ (n (S `|` R)) → s'  if  r = ∂ᵢⱼ \u003c s' ∧ r ∈ R ∧ s' ∈ S\n* Uniq Face. Γ ⊢ ∂ᵢⱼ s ≡ ∂ᵢⱼ s'  if  Γ ⊢ n (S `|` R) : Chain ∧ n (S' `|` R') : Chain ∧ s ∈ S ∧ s' ∈ S' ∧ ∀ r = ∂ᵢⱼ \u003c s ∈ R ∧ r' = ∂ᵢⱼ \u003c s' ∈ R'\n\n### Cochain\n\n* Formation. Γ ⊢ Cochain : Set\n* Intro. Γ ⊢ n (S `|` R) : Cochain  if  Γ = s₀₁, …, sₙₘₙ : Simplex, r₁, …, rₚ ∧ S₀, S₁, …, Sₙ = (s₀₁, …, s₀ₘ₀), …, (sₙ₁, …, sₙₘₙ) ∧ ∀ rⱼ = tⱼ = tⱼ', Γ ⊢ rⱼ : tⱼ = tⱼ' ∧ ∀ σᵢⱼ \u003c sₖₗ, Γ ⊢ σᵢⱼ : sₖₗ → sₖ₊₁,ₘ\n* Elim Degeneracy. Γ ⊢ σᵢⱼ s : Simplex  if  Γ ⊢ n (S `|` R) : Cochain ∧ r = σᵢⱼ \u003c s ∧ r ∈ R ∧ s ∈ S\n* Comp Degeneracy. σᵢⱼ (n (S `|` R)) → s'  if  r = σᵢⱼ \u003c s' ∧ r ∈ R ∧ s' ∈ S\n* Uniq Degeneracy. Γ ⊢ σᵢⱼ s ≡ σᵢⱼ s'  if  Γ ⊢ n (S `|` R) : Cochain ∧ n (S' `|` R') : Cochain ∧ s ∈ S ∧ s' ∈ S' ∧ ∀ r = σᵢⱼ \u003c s ∈ R ∧ r' = σᵢⱼ \u003c s' ∈ R'\n\n### Category\n\n* Formation. Γ ⊢ Category : Set\n* Intro. Γ ⊢ n (O `|` M `|` R) : Category  if  Γ = o₁, …, oₙ, m₁, …, mₖ : Simplex, r₁, …, rₚ ∧ O = (o₁, …, oₙ) ∧ M = (m₁, …, mₙ) ∧ ∀ rⱼ = tⱼ = tⱼ', Γ ⊢ rⱼ : tⱼ = tⱼ' ∧ ∀ tⱼ = mₐ ∘ mᵦ, mₐ, mᵦ ∈ Γ\n* Elim Comp. Γ ⊢ c : Simplex  if  Γ ⊢ n (O `|` M `|` R) : Category ∧ r = c = m₁ ∘ m₂ ∧ r ∈ R ∧ m₁, m₂ ∈ Γ\n* Comp Comp. (m₁ ∘ m₂) (n (O `|` M `|` R)) → c  if  r = c = m₁ ∘ m₂ ∧ r ∈ R ∧ m₁, m₂ ∈ Γ\n* Uniq Comp. Γ ⊢ c ≡ c'  if  Γ ⊢ n (O `|` M `|` R) : Category ∧ n (O' `|` M' `|` R') : Category ∧ r = c = m₁ ∘ m₂ ∈ R ∧ r' = c' = m₁' ∘ m₂' ∈ R' ∧ m₁, m₂ ∈ Γ ∧ m₁', m₂' ∈ Γ'\n\n### Monoid\n\n* Formation. Γ ⊢ Monoid : Set\n* Intro. Γ ⊢ n (M `|` R) : Monoid  if  Γ = m₁, …, mₙ : Simplex, r₁, …, rₚ ∧ M = (m₁, …, mₙ) ∧ ∀ rⱼ = tⱼ = tⱼ', Γ ⊢ rⱼ : tⱼ = tⱼ' ∧ ∀ tⱼ = mₐ ∘ mᵦ, mₐ, mᵦ ∈ M\n* Elim Comp. Γ ⊢ c : Simplex  if  Γ ⊢ n (M `|` R) : Monoid ∧ r = c = m₁ ∘ m₂ ∧ r ∈ R ∧ m₁, m₂ ∈ M\n* Comp Comp. (m₁ ∘ m₂) (n (M `|` R)) → c  if  r = c = m₁ ∘ m₂ ∧ r ∈ R ∧ m₁, m₂ ∈ M\n* Uniq Comp. Γ ⊢ c ≡ c'  if  Γ ⊢ n (M `|` R) : Monoid ∧ n (M' `|` R') : Monoid ∧ r = c = m₁ ∘ m₂ ∈ R ∧ r' = c' = m₁' ∘ m₂' ∈ R' ∧ m₁, m₂ ∈ M ∧ m₁', m₂' ∈ M'\n   \n### Simplex\n\n* Formation. Γ ⊢ Simplex : Set\n* Intro. Γ ⊢ n (S `|` R) : Simplex  if  Γ = s₀, …, sₙ : Simplex, r₁, …, rₚ ∧ `|`S`|` = n + 1 ∧ ∀ rⱼ = tⱼ = tⱼ', Γ ⊢ rⱼ : tⱼ = tⱼ' ∧ ∀ ∂ᵢ \u003c sₖ, Γ ⊢ ∂ᵢ : sₖ → sₖ₋₁ ∧ ∀ σᵢ \u003c sₖ, Γ ⊢ σᵢ : sₖ → sₖ₊₁\n* Elim Face. Γ ⊢ ∂ᵢ s : Simplex  if  Γ ⊢ n (S `|` R) : Simplex ∧ r = ∂ᵢ \u003c s ∧ r ∈ R ∧ s ∈ S\n* Elim Degeneracy. Γ ⊢ σᵢ s : Simplex  if  Γ ⊢ n (S `|` R) : Simplex ∧ r = σᵢ \u003c s ∧ r ∈ R ∧ s ∈ S\n* Comp Face. ∂ᵢ (n (S `|` R)) → s'  if  r = ∂ᵢ \u003c s' ∧ r ∈ R ∧ s' ∈ S\n* Comp Degeneracy. σᵢ (n (S `|` R)) → s'  if  r = σᵢ \u003c s' ∧ r ∈ R ∧ s' ∈ S\n* Uniq Face. Γ ⊢ ∂ᵢ s ≡ ∂ᵢ s'  if  Γ ⊢ n (S `|` R) : Simplex ∧ n (S' `|` R') : Simplex ∧ s ∈ S ∧ s' ∈ S' ∧ ∀ r = ∂ᵢ \u003c s ∈ R ∧ r' = ∂ᵢ \u003c s' ∈ R'\n* Uniq Degeneracy. Γ ⊢ σᵢ s ≡ σᵢ s'  if  Γ ⊢ n (S `|` R) : Simplex ∧ n (S' `|` R') : Simplex ∧ s ∈ S ∧ s' ∈ S' ∧ ∀ r = σᵢ \u003c s ∈ R ∧ r' = σᵢ \u003c s' ∈ R'\n\n### Simplicial\n\n#### Simplicial Modes\n\n* Γ ⊢ Δₙ : Type (Simplex)\n* Γ ⊢ Δₙᵏᵃⁿ : Type\n* Γ ⊢ Δₙʳᵉᶻᵏ : Type\n* Γ ⊢ Δₙˢᵉᵍᵃˡ : Type\n\n#### Formation\n\nThe simplicial type is declared as a set within the context Γ without any premises.\n\n```\nΓ ⊢ Δ : Type\n```\n\n#### Introduction\n\nA simplicial set of rank n with elements S and constraints R is formed from context Γ if simplices, equalities, face maps, and degeneracy maps are properly defined.\n\n```\nΓ ⊢ n (S | R) : Simplicial if\nΓ = s₀₁, …, sₙₘₙ : Simplex, r₁, …, rₚ ∧\n    S₀, S₁, …, Sₙ = (s₀₁, …, s₀ₘ₀), …, (sₙ₁, …, sₙₘₙ) ∧\n    rⱼ = tⱼ = tⱼ',\nΓ ⊢ rⱼ : tⱼ = tⱼ' ∧\n    ∂ᵢⱼ \u003c sₖₗ,\nΓ ⊢ ∂ᵢⱼ : sₖₗ → sₖ₋₁,ₘ ∧\n    σᵢⱼ \u003c sₖₗ,\nΓ ⊢ σᵢⱼ : sₖₗ → sₖ₊₁,ₘ\n```\n\n#### Elim Face\n\nThe face map ∂ᵢⱼ extracts a simplex from s in a simplicial set if the constraint r defines the face relation.\n\n```\nΓ ⊢ ∂ᵢⱼ s : Simplex if\nΓ ⊢ n (S | R) : Simplicial ∧\n    r = ∂ᵢⱼ \u003c s ∧\n    r ∈ R ∧\n    s ∈ S                                  \n```\n\n#### Elim Composition\n\nThe composition s₁ ∘ s₂ yields a simplex c in a simplicial set if the constraint r defines it and s1 and s2 are composable.\n\n```\nΓ ⊢ c : Simplex if\nΓ ⊢ n (S | R) : Simplicial ∧\n    r = c = s₁ ∘ s₂ ∧\n    r ∈ R ∧ s₁, s₂ ∈ S ∧\nΓ ⊢ ∂ᵢᵢ₋₁ s₁ = ∂ᵢ₀ s₂\n```\n\n#### Elim Degeneracy\n\nThe degeneracy map σᵢⱼ lifts a simplex s to a higher simplex in a simplicial set if the constraint r defines the degeneracy relation.\n\n```\nΓ ⊢ σᵢⱼ s : Simplex if\nΓ ⊢ n (S | R) : Simplicial ∧\n    r = σᵢⱼ \u003c s,\n    r ∈ R,\n    s ∈ S\n```\n\n#### Face Computation\n\nThe face map ∂ᵢⱼ applied to a simplicial set reduces to the simplex s′ specified by the constraint r in R.\n\n```\n∂ᵢⱼ (n (S | R)) → s' if\n    r = ∂ᵢⱼ \u003c s' ∧\n    r ∈ R ∧\n    s' ∈ S\n```\n\n#### Composition Computation.\n\nThe composition s₁ ∘ s₂ applied to a simplicial set reduces to the simplex c specified by the constraint r in R, given s1 and s2 are composable.\n\n```\n(s₁ ∘ s₂) (n (S | R)) → c if\n    r = c = s₁ ∘ s₂ ∧\n    r ∈ R ∧\n    s₁, s₂ ∈ S ∧\nΓ ⊢ ∂ᵢᵢ₋₁ s₁ = ∂ᵢ₀ s₂\n```\n\n#### Degeneracy Computation.\n\nThe degeneracy map σᵢⱼ applied to a simplicial set reduces to the simplex s′ specified by the constraint r in R.\n\n```\nσᵢⱼ (n (S | R)) → s' if\n    r = σᵢⱼ \u003c s' ∧ \n    r ∈ R ∧ \n    s' ∈ S\n```\n\n#### Face Uniqueness\n\nTwo face maps ∂ᵢⱼ s and ∂ᵢⱼ s′ are equal if they are defined by constraints r and r′ across two simplicial sets with matching elements.\n\n```\nΓ ⊢ ∂ᵢⱼ s ≡ ∂ᵢⱼ s'  if  \nΓ ⊢ n (S | R) : Simplicial ∧ \n    n (S' | R') : Simplicial ∧ \n    s ∈ S ∧ s' ∈ S' ∧ \n    r = ∂ᵢⱼ \u003c s ∈ R ∧ \n    r' = ∂ᵢⱼ \u003c s' ∈ R'\n```\n\n#### Uniqueness of Composition.\n\nTwo composed simplices c and c′ are equal if their constraints r and r′ define compositions of matching pairs s₁, s₂ and s₁′, s₂′ across two simplicial sets with composability conditions.\n\n```\nΓ ⊢ c ≡ c' if\nΓ ⊢ n (S | R) : Simplicial ∧\n    n (S' | R') : Simplicial ∧ \n    r = c = s₁ ∘ s₂ ∈ R ∧\n    r' = c' = s₁' ∘ s₂' ∈ R' ∧\n    s₁, s₂ ∈ S ∧ \n    s₁', s₂' ∈ S' ∧ \nΓ ⊢ ∂ᵢᵢ₋₁ s₁ = ∂ᵢ₀ s₂ ∧ \nΓ ⊢ ∂ᵢᵢ₋₁ s₁' = ∂ᵢ₀ s₂'\n```\n\n#### Uniqueness of Degeneracy.\n\nTwo degeneracy maps σᵢⱼ s and σᵢⱼ s′ are equal if they are defined by constraints r and r′ across two simplicial sets with matching elements.\n\n```\nΓ ⊢ σᵢⱼ s ≡ σᵢⱼ s' if\nΓ ⊢ n (S | R) : Simplicial ∧\n    n (S' | R') : Simplicial ∧\n    s ∈ S ∧\n    s' ∈ S' ∧\n    r = σᵢⱼ \u003c s ∈ R ∧\n    r' = σᵢⱼ \u003c s' ∈ R'\n```\n\n## Examples\n\n### N-Monoid\n\n```\ndef nat_monoid : Monoid\n := П (z s : Simplex),\n      s ∘ z = s, z ∘ s = s\n    ⊢ 2 (z s | s ∘ z = s, z ∘ s = s)\n```\n\nO(5).\n\n### Category with Group (Path Category with Z/2Z)\n\n```\ndef path_z2_category : Category\n := П (x y : Simplex),\n      (f g h : Simplex),\n      (z2 : Group(П (e a : Simplex), a² = e ⊢ 1 (a | a² = e))),\n      f ∘ g = h\n    ⊢ 2 (x y | f g h | f ∘ g = h)\n```\n\nO(8)—5 context + 2 nested group + 1 constraint—linear with nesting.\n\n### Triangle Chain\n\n```\ndef triangle_chain : Chain\n := П (v₀ v₁ v₂ e₀₁ e₀₂ e₁₂ t : Simplex),\n      ∂₁₀ = e₀₁, ∂₁₁ = e₀₂, ∂₁₂ = e₁₂, ∂₂ \u003c e₀₁ e₀₂ e₁₂\n    ⊢ 2 (v₀ v₁ v₂, e₀₁ e₀₂ e₁₂, t | ∂₁₀ ∂₁₁ ∂₁₂, ∂₂)\n```\n\nO(11).\n\n### Simplicial Circle\n\n```\ndef circle : Simplicial\n := П (v e : Simplex),\n       ∂₁₀ = v, ∂₁₁ = v, s₀ \u003c v\n     ⊢ 1 (v, e | ∂₁₀ ∂₁₁, s₀)\n```\n\nO(5).\n\n### Z/3Z\n\n```\ndef z3 : Group\n := П (e a : Simplex),\n      a³ = e\n    ⊢ 1 (a | a³ = e)\n```\n\nO(4).\n\n### Triangle\n\n```\ndef triangle : Simplex := П (a b c : Simplex),\n         (ab bc ca : Simplex), ac = ab ∘ bc\n         ⊢ 2 (a b c | ab bc ca)\n```\n\nO(7).\n\n### Singular Cone\n\n```\ndef singular_cone : Simplex\n := П (p q r s : Simplex),\n      (qrs prs pqs : Simplex), pqr = pqs ∘ qrs\n    ⊢ 3 (p q r s | qrs prs pqs pqr)\n```\n\nContext: p, q, r, s: Simplex (vertices), qrs, prs, pqs : Simplex (faces), pqr = pqs ∘ qrs.\n\nSimplex: Dimension 3, 4 faces.\n\n### Möbius Piece\n\n```\ndef Möbius : Simplex\n := П (a b c : Simplex),\n      (bc ac : Simplex), ab = bc ∘ ac\n    ⊢ 2 (a b c | bc ac ab)\n```\n\nContext: a, b, c : Simplex (vertices), bc, ac : Simplex (faces), ab = bc ∘ ac (relation).\n\nSimplex: Dimension 2, 3 faces.\n\n### Degenerate Tetrahedron\n\n```\ndef degen_tetra : Simplex\n := П (p q r s : Simplex, q = r),\n      (qrs prs pqs : Simplex), pqr = pqs ∘ qrs\n    ⊢ 3 (p q r s | qrs prs pqs pqr)\n```\n\nContext: p, q, r, s : Simplex, q = r (degeneracy), qrs, prs, pqs : Simplex, pqr = pqs ∘ qrs.\n\nSimplex: Dimension 3, 4 faces—degeneracy implies a collapsed edge.\n\nNon-Triviality: q = r flattens the structure algebraically, testing composition under equality.\n\n### Twisted Annulus\n\n```\ndef twisted_annulus : Simplex\n := П (a b c d : Simplex),\n      (bc ac bd : Simplex), ab = bc ∘ ac, cd = ac ∘ bd\n    ⊢ 2 (a b c | bc ac ab), 2 (b c d | bc bd cd)\n```\n\nContext:\n* Vertices:  a, b, c, d.\n* Faces: bc, ac, bd.\n* Relations: ab = bc ∘ ac,  cd = ac ∘ bd  (twist via composition).\n  \nSimplices:\n* (a b c `|` bc, ac, ab ): First triangle.\n* (b c d `|` bc, bd, cd ): Second triangle, sharing bc.\n  \nChecking:\n* Vertices: a, b, c, d ∈ Γ — O(4).\n* Faces: bc, ac, ab (O(3)), bc, bd, cd (O(3)) — total O(6).\n* Relations: ab = bc ∘ ac (O(1)), cd = ac ∘ bd (O(1)) — O(2).\n* Total: O(12) — linear, fast.\n\n### Degenerate Triangle (Collapsed Edge)\n\n```\ndef degen_triangle : Simplex\n := П (a b c : Simplex, b = c),\n      (bc ac : Simplex), ab = bc ∘ ac\n    ⊢ 2 (a b c | bc ac ab)\n```\n\nContext: \n* Vertices: a, b, c, with b = c.\n* Faces: bc, ac.\n* Relation: ab = bc ∘ ac.\n\nSimplex:\n* (a b c `|` bc, ac, ab ) — 3 faces, despite degeneracy.\n\nChecking:\n* Vertices: a, b, c ∈ Γ, b = c — O(3).\n* Faces: bc, ac, ab ∈ Γ — O(3).\n* Relation: ab = bc ∘ ac — O(1).\n* Total: O(7)—efficient, handles degeneracy cleanly.\n\n### Singular Prism (Degenerate Face)\n\n```\ndef singular_prism : Simplex\n := П (p q r s t : Simplex),\n      (qrs prs pqt : Simplex, qrs = qrs), pqr = pqt ∘ qrs\n    ⊢ 3 (p q r s | qrs prs pqt pqr)\n```\n\nContext: \n* Vertices: p, q, r, s, t.\n* Faces: qrs, prs, pqt.\n* Relations: qrs = qrs (degenerate identity), pqr = pqt ∘ qrs.\n\nSimplex: \n* (p q r s `|` qrs, prs, pqt, pqr ) — 4 faces, one degenerate.\n\nChecking:\n* Vertices: p, q, r, s ∈ Γ (t unused, valid) — O(4).\n* Faces: qrs, prs, pqt, pqr ∈ Γ — O(4).\n* Relations: qrs = qrs (O(1)), pqr = pqt ∘ qrs (O(1)) — O(2).\n* Total: O(10) — linear, fast despite degeneracy.\n\n### S¹ as ∞-Groupoid\n\n```\ndef s1_infty : Simplicial\n := П (v e : Simplex),\n      ∂₁₀ = v, ∂₁₁ = v, s₀ \u003c v,\n      ∂₂₀ = e ∘ e, s₁₀ \u003c ∂₂₀\n    ⊢ ∞ (v, e, ∂₂₀ | ∂₁₀ ∂₁₁, s₀, ∂₂₀, s₁₀)\n```\n\nAST:\n\n```\n(* Infinite S¹ ∞-groupoid *)\nlet s1_infty = {\n  name = \"s1_infty\";\n  typ = Simplicial;\n  context = [\n    Decl ([\"v\"; \"e\"], Simplex);  (* Base point and loop *)\n    Equality (\"∂₁₀\", Id \"v\", Id \"∂₁₀\");\n    Equality (\"∂₁₁\", Id \"v\", Id \"∂₁₁\");\n    Equality (\"s₀\", Id \"e\", Id \"s₀\");\n    Equality (\"∂₂₀\", Comp (Id \"e\", Id \"e\"), Id \"∂₂₀\");  (* 2-cell: e ∘ e *)\n    Equality (\"s₁₀\", Id \"∂₂₀\", Id \"s₁₀\")  (* Degeneracy for 2-cell *)\n  ];\n  rank = Infinite;  (* Unbounded dimensions *)\n  elements = [\"v\"; \"e\"; \"∂₂₀\"];  (* Finite truncation: 0-, 1-, 2-cells *)\n  constraints = [\n    Eq (Id \"∂₁₀\", Id \"v\");\n    Eq (Id \"∂₁₁\", Id \"v\");\n    Map (\"s₀\", [\"v\"]);\n    Eq (Id \"∂₂₀\", Comp (Id \"e\", Id \"e\"));\n    Map (\"s₁₀\", [\"∂₂₀\"])\n  ]\n}\n```\n\n### ∞-Category with cube fillers\n\n```\ndef cube_infty : Category := П (a b c : Simplex),\n       (f g h : Simplex), cube2 = g ∘ f, cube2 : Simplex,\n       cube3 = cube2 ∘ f, cube3 : Simplex\n       ⊢ ∞ (a b c | cube2 cube3)\n```\n\n### Matrix Ring Spectrum\n\n```\ndef matrix_ring_spectrum : Ring\n := П (a b s p : Simplex),\n      a + b = s, a ⋅ b = p,\n      a = [[1,2],[3,4]], b = [[0,1],[1,0]], s = [[1,3],[4,4]], p = [[2,1],[4,3]]\n    ⊢ 4 (a b s p | a + b = s, a ⋅ b = p, a = [[1,2],[3,4]], b = [[0,1],[1,0]],\n                   s = [[1,3],[4,4]], p = [[2,1],[4,3]])\n```\n\n### HZ spectrum\n\n```\ndef hz_spectrum : Ring\n := П (x y p : Simplex),\n      x ⋅ y = p,\n      x = 2, y = 3, p = 6\n    ⊢ 3 (x y p | x ⋅ y = p, x = 2, y = 3, p = 6)\n```\n\n### Poly Ring spectrum\n\n```\ndef poly_ring_zx : Ring\n := П (f g s p : Simplex),\n      f + g = s, f ⋅ g = p,\n      f = x + 1, g = 2 ⋅ x, s = 3 ⋅ x + 1, p = 2 ⋅ x ⋅ x + 2 ⋅ x\n    ⊢ 4 (f g s p | f + g = s, f ⋅ g = p, f = x + 1, g = 2 ⋅ x,\n                   s = 3 ⋅ x + 1, p = 2 ⋅ x ⋅ x + 2 ⋅ x)\n```\n\n### GF(2⁴) Finite Field\n\n```\ndef gf16 : Field\n := П (x y s p d : Simplex),\n      x + y = s, x ⋅ y = p, x / y = d,\n      x = Z(2^4), y = Z(2^4)^2,\n      s = Z(2^4) + Z(2^4)^2,\n      p = Z(2^4)^3, d = Z(2^4)^14\n    ⊢ 5 (x y s p d | x + y = s, x ⋅ y = p, x / y = d,\n                     x = Z(2^4), y = Z(2^4)^2,\n                     s = Z(2^4) + Z(2^4)^2,\n                     p = Z(2^4)^3,\n                     d = Z(2^4)^14)\n```\n\n### GF(7) Prime Field\n\n```\ndef gf7 : Field\n := П (x y s p d : Simplex),\n      x + y = s, x ⋅ y = p, x / y = d,\n      x = 2, y = 3, s = 5, p = 6, d = 3\n    ⊢ 5 (x y s p d | x + y = s, x ⋅ y = p,\n         x / y = d, x = 2, y = 3,\n         s = 5, p = 6, d = 3)\n```\n\n## Bibliography\n\n* Daniel Kan. Abstract Homotopy I. 1955.\n* Daniel Kan. Abstract Homotopy II. 1956.\n* Daniel Kan. On c.s.s. Complexes. 1957.\n* Daniel Kan. A Combinatorial Definition of Homotopy Groups. 1958.\n* Daniel Kan, W. G. Dwyer. Adjoint functors. 1958.\n* Daniel Kan, W. G. Dwyer.  Simplicial Localizations of Categories. 1980.\n* Graeme Segal. Classifying spaces and spectral sequences. 1968.\n* Graeme Segal. Categories and cohomology theories. 1974.\n* Graeme Segal, R. Bott. Loop groups and their classifying spaces. 1988.\n* Charles Rezk. A model for the homotopy theory of homotopy theory. 2001.\n* Charles Rezk. A cartesian presentation of weak n-categories\". 2010.\n* Charles Rezk, S. Schwede, B. Shipley. Simplicial structures on model categories and functors. 2001.\n* Charles Rezk, J. Bergner. Comparison of models for (∞,n)-categories. 2013.\n\n## Conclusion\n\nDan Kan Simplicity HoTT, hosted at groupoid/dan, is a lightweight, pure type checker\nbuilt on Cubical Homotopy Type Theory (CCHM), named in tribute to Daniel Kan for\nhis foundational work on simplicial sets. With a unified syntax — \n`П (context) ⊢ n (elements | constraints)` — Dan supports a rich type\nsystem `Simplex`, `Group`, `Simplicial`, `Chain`, `Category`, `Monoid`, now extended with \n∞-categories featuring cube fillers.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgroupoid%2Fdan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgroupoid%2Fdan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgroupoid%2Fdan/lists"}