An open API service indexing awesome lists of open source software.

https://github.com/groupoid/dan

🧊 Š”Ń–Š¼ŠæŠ»Ń–Ń†Ń–Š°Š»ŃŒŠ½Š° Ń‚ŠµŠ¾Ń€Ń–Ń типів
https://github.com/groupoid/dan

Last synced: 10 months ago
JSON representation

🧊 Š”Ń–Š¼ŠæŠ»Ń–Ń†Ń–Š°Š»ŃŒŠ½Š° Ń‚ŠµŠ¾Ń€Ń–Ń типів

Awesome Lists containing this project

README

          

Dan Kan: Simplicial HoTT
========================

Groupoid Infinity Simplicial HoTT Computer Algebra System is a pure algebraїc implementation
with explicit syntaxt for fastest type checking. It supports following extensions: `Chain`,
`Cochain`, `Simplex`, `Simplicial`, `Category`, `Monoid`, `Group`, `Ring`.
Simplicial HoTT is a Rezk/GAP replacement incorporated into CCHM/CHM/HTS Agda-like Anders/Dan
with Kan, Rezk and Segal simplicial modes for computable āˆž-categories.

## Abstract

We present a domain-specific language (DSL), the extension to Cubical Homotopy Type Theory (CCHM) for simplicial structures,
designed as a fast type checker with a focus on algebraic purity. Built on the Cohen-Coquand-Huber-Mƶrtberg (CCHM)
framework, our DSL employs a Lean/Anders-like sequent syntax `П (context) ⊢ k (vā‚€, ..., vā‚– | fā‚€, ..., fā‚— | ... )` to define
k-dimensional `0, ..., n, āˆž` simplices via explicit contexts, vertex lists, and face relations, eschewing geometric coherence terms
in favor of compositional constraints (e.g., `f = g ∘ h`). The semantics, formalized as inference rules in a Martin-Löf
Type Theory MLTT-like setting, include Formation, Introduction, Elimination, Composition, Computational, and
Uniqueness rules, ensuring a lightweight, deterministic computational model with linear-time type checking (O(k + m + n),
where k is vertices, m is faces, and n is relations). Inspired by opetopic purity, our system avoids cubical
path-filling (e.g., `PathP`), aligning with syntactic approaches to higher structures while retaining CCHM’s
type-theoretic foundation. Compared to opetopic sequent calculi and the Rzk prover, our DSL balances algebraic
simplicity with practical efficiency, targeting simplicial constructions over general āˆž-categories,
and achieves a fast, pure checker suitable for formal proofs and combinatorial reasoning.

## Setup

```
$ ocamlopt -o dan src/simplicity.ml && ./dan
```

## Syntax

Incorporating into CCHM/CHM/HTS Anders/Dan core.

### Definition

New sequent contruction:

```
def : := П (context), conditions ⊢ (elements | constraints)
```

Instances:

```
def chain : Chain := П (context), conditions ⊢ n (Cā‚€, 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)
```

### BNF

```
::= |
::= "def" ":" ":="
::= "Simplex" | "Simplicial" | "Chain" | "Cochain"
| "Category" | "Group" | "Monoid" | "Ring" | "Field"
::= "П" "(" ")" "⊢" "(" "|" ")"
::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"
::= "¹" | "²" | "³" | "⁓" | "⁵" | "⁶" | "⁷" | "⁸" | "⁹"
::= | | "āˆž"
::= | ","
::= ":" % Single declaration, e.g., a : Simplex
| "(" ":" ")" % Grouped declaration, e.g., (a b c : Simplex)
| "=" "<" % Map, e.g., āˆ‚ā‚ = Cā‚‚ < Cā‚ƒ
| "=" % Equality, e.g., x = 2
| "=" "∘" % Monoid composition, e.g., ac = ab ∘ bc
| "=" "+" % Ring addition, e.g., x + y = s
| "=" "ā‹…" % Ring multiplication, e.g., x ā‹… y = p
| "=" "/" % Field division, e.g., x / y = d
::= | % e.g., a b c
::= | ε
::= | ","
::= | ε
::= | ","
::= "=" % Equality, e.g., a = 2
| "∘" "=" % Monoid composition, e.g., a ∘ a = e
| "+" "=" % Ring addition, e.g., x + y = s
| "ā‹…" "=" % Ring multiplication, e.g., x ā‹… y = p
| "/" "=" % Field division, e.g., x / y = d
| "<" % Map, e.g., āˆ‚ā‚ < Cā‚‚
::= % e.g., a
| "∘" % e.g., a ∘ b
| "+" % e.g., x + y
| "ā‹…" % e.g., x ā‹… y
| "/" % e.g., x / y
| "^-1" % e.g., a^-1
| "^" % e.g., a³
| "e" % identity
| % e.g., 2
| % e.g., [[1,2],[3,4]]
::= | % e.g., 123
::= "[" "]" % e.g., [[1,2],[3,4]]
::= | ","
::= "[" "]" % e.g., [1,2]
::= | "," % e.g., 1,2
```

Meaning of `` Across Types:

* Simplex: Dimension of the simplex—e.g., n=2 for a triangle (2-simplex).
* Group: Number of generators—e.g., n=1 for Z/3Z (one generator a).
* Simplicial: Maximum dimension of the simplicial set—e.g., n=1 for S1 (up to 1-simplices).
* Chain: Length of the chain (number of levels minus 1)—e.g., n=2 for a triangle chain (0, 1, 2 levels).
* Category: Number of objects—e.g., n=2 for a path category (two objects x,y).
* Monoid: Number of generators—e.g., n=2 for N (zero and successor).

## Semantics

### Chain

* Formation. Ī“ ⊢ Chain : Set
* Intro. Ī“ ⊢ n (S `|` R) : Chain if Ī“ = s₀₁, …, sā‚™ā‚˜ā‚™ : Simplex, r₁, …, rā‚š ∧ Sā‚€, S₁, …, Sā‚™ = (s₀₁, …, sā‚€ā‚˜ā‚€), …, (sₙ₁, …, sā‚™ā‚˜ā‚™) ∧ āˆ€ rā±¼ = tā±¼ = tā±¼', Ī“ ⊢ rā±¼ : tā±¼ = tā±¼' ∧ āˆ€ āˆ‚įµ¢ā±¼ < sā‚–ā‚—, Ī“ ⊢ āˆ‚įµ¢ā±¼ : sā‚–ā‚— → sₖ₋₁,ā‚˜
* Elim Face. Ī“ ⊢ āˆ‚įµ¢ā±¼ s : Simplex if Ī“ ⊢ n (S `|` R) : Chain ∧ r = āˆ‚įµ¢ā±¼ < s ∧ r ∈ R ∧ s ∈ S
* Comp Face. āˆ‚įµ¢ā±¼ (n (S `|` R)) → s' if r = āˆ‚įµ¢ā±¼ < s' ∧ r ∈ R ∧ s' ∈ S
* Uniq Face. Ī“ ⊢ āˆ‚įµ¢ā±¼ s ≔ āˆ‚įµ¢ā±¼ s' if Ī“ ⊢ n (S `|` R) : Chain ∧ n (S' `|` R') : Chain ∧ s ∈ S ∧ s' ∈ S' ∧ āˆ€ r = āˆ‚įµ¢ā±¼ < s ∈ R ∧ r' = āˆ‚įµ¢ā±¼ < s' ∈ R'

### Cochain

* Formation. Ī“ ⊢ Cochain : Set
* Intro. Ī“ ⊢ n (S `|` R) : Cochain if Ī“ = s₀₁, …, sā‚™ā‚˜ā‚™ : Simplex, r₁, …, rā‚š ∧ Sā‚€, S₁, …, Sā‚™ = (s₀₁, …, sā‚€ā‚˜ā‚€), …, (sₙ₁, …, sā‚™ā‚˜ā‚™) ∧ āˆ€ rā±¼ = tā±¼ = tā±¼', Ī“ ⊢ rā±¼ : tā±¼ = tā±¼' ∧ āˆ€ σᵢⱼ < sā‚–ā‚—, Ī“ ⊢ σᵢⱼ : sā‚–ā‚— → sā‚–ā‚Šā‚,ā‚˜
* Elim Degeneracy. Ī“ ⊢ σᵢⱼ s : Simplex if Ī“ ⊢ n (S `|` R) : Cochain ∧ r = σᵢⱼ < s ∧ r ∈ R ∧ s ∈ S
* Comp Degeneracy. σᵢⱼ (n (S `|` R)) → s' if r = σᵢⱼ < s' ∧ r ∈ R ∧ s' ∈ S
* Uniq Degeneracy. Ī“ ⊢ σᵢⱼ s ≔ σᵢⱼ s' if Ī“ ⊢ n (S `|` R) : Cochain ∧ n (S' `|` R') : Cochain ∧ s ∈ S ∧ s' ∈ S' ∧ āˆ€ r = σᵢⱼ < s ∈ R ∧ r' = σᵢⱼ < s' ∈ R'

### Category

* Formation. Ī“ ⊢ Category : Set
* 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ᵦ ∈ Ī“
* Elim Comp. Ī“ ⊢ c : Simplex if Ī“ ⊢ n (O `|` M `|` R) : Category ∧ r = c = m₁ ∘ mā‚‚ ∧ r ∈ R ∧ m₁, mā‚‚ ∈ Ī“
* Comp Comp. (m₁ ∘ mā‚‚) (n (O `|` M `|` R)) → c if r = c = m₁ ∘ mā‚‚ ∧ r ∈ R ∧ m₁, mā‚‚ ∈ Ī“
* 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ā‚‚' ∈ Ī“'

### Monoid

* Formation. Ī“ ⊢ Monoid : Set
* 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
* Elim Comp. Ī“ ⊢ c : Simplex if Ī“ ⊢ n (M `|` R) : Monoid ∧ r = c = m₁ ∘ mā‚‚ ∧ r ∈ R ∧ m₁, mā‚‚ ∈ M
* Comp Comp. (m₁ ∘ mā‚‚) (n (M `|` R)) → c if r = c = m₁ ∘ mā‚‚ ∧ r ∈ R ∧ m₁, mā‚‚ ∈ M
* 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'

### Simplex

* Formation. Ī“ ⊢ Simplex : Set
* Intro. Ī“ ⊢ n (S `|` R) : Simplex if Ī“ = sā‚€, …, sā‚™ : Simplex, r₁, …, rā‚š ∧ `|`S`|` = n + 1 ∧ āˆ€ rā±¼ = tā±¼ = tā±¼', Ī“ ⊢ rā±¼ : tā±¼ = tā±¼' ∧ āˆ€ āˆ‚įµ¢ < sā‚–, Ī“ ⊢ āˆ‚įµ¢ : sā‚– → sₖ₋₁ ∧ āˆ€ σᵢ < sā‚–, Ī“ ⊢ σᵢ : sā‚– → sā‚–ā‚Šā‚
* Elim Face. Ī“ ⊢ āˆ‚įµ¢ s : Simplex if Ī“ ⊢ n (S `|` R) : Simplex ∧ r = āˆ‚įµ¢ < s ∧ r ∈ R ∧ s ∈ S
* Elim Degeneracy. Ī“ ⊢ σᵢ s : Simplex if Ī“ ⊢ n (S `|` R) : Simplex ∧ r = σᵢ < s ∧ r ∈ R ∧ s ∈ S
* Comp Face. āˆ‚įµ¢ (n (S `|` R)) → s' if r = āˆ‚įµ¢ < s' ∧ r ∈ R ∧ s' ∈ S
* Comp Degeneracy. σᵢ (n (S `|` R)) → s' if r = σᵢ < s' ∧ r ∈ R ∧ s' ∈ S
* Uniq Face. Ī“ ⊢ āˆ‚įµ¢ s ≔ āˆ‚įµ¢ s' if Ī“ ⊢ n (S `|` R) : Simplex ∧ n (S' `|` R') : Simplex ∧ s ∈ S ∧ s' ∈ S' ∧ āˆ€ r = āˆ‚įµ¢ < s ∈ R ∧ r' = āˆ‚įµ¢ < s' ∈ R'
* Uniq Degeneracy. Ī“ ⊢ σᵢ s ≔ σᵢ s' if Ī“ ⊢ n (S `|` R) : Simplex ∧ n (S' `|` R') : Simplex ∧ s ∈ S ∧ s' ∈ S' ∧ āˆ€ r = σᵢ < s ∈ R ∧ r' = σᵢ < s' ∈ R'

### Simplicial

#### Simplicial Modes

* Ī“ ⊢ Δₙ : Type (Simplex)
* Ī“ ⊢ Ī”ā‚™įµįµƒāæ : Type
* Ī“ ⊢ Ī”ā‚™Ź³įµ‰į¶»įµ : Type
* Ī“ ⊢ Ī”ā‚™Ė¢įµ‰įµįµƒĖ” : Type

#### Formation

The simplicial type is declared as a set within the context Ī“ without any premises.

```
Ī“ ⊢ Ī” : Type
```

#### Introduction

A 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 (S | R) : Simplicial if
Ī“ = s₀₁, …, sā‚™ā‚˜ā‚™ : Simplex, r₁, …, rā‚š ∧
Sā‚€, S₁, …, Sā‚™ = (s₀₁, …, sā‚€ā‚˜ā‚€), …, (sₙ₁, …, sā‚™ā‚˜ā‚™) ∧
rā±¼ = tā±¼ = tā±¼',
Ī“ ⊢ rā±¼ : tā±¼ = tā±¼' ∧
āˆ‚įµ¢ā±¼ < sā‚–ā‚—,
Ī“ ⊢ āˆ‚įµ¢ā±¼ : sā‚–ā‚— → sₖ₋₁,ā‚˜ ∧
σᵢⱼ < sā‚–ā‚—,
Ī“ ⊢ σᵢⱼ : sā‚–ā‚— → sā‚–ā‚Šā‚,ā‚˜
```

#### Elim Face

The face map āˆ‚įµ¢ā±¼ extracts a simplex from s in a simplicial set if the constraint r defines the face relation.

```
Ī“ ⊢ āˆ‚įµ¢ā±¼ s : Simplex if
Ī“ ⊢ n (S | R) : Simplicial ∧
r = āˆ‚įµ¢ā±¼ < s ∧
r ∈ R ∧
s ∈ S
```

#### Elim Composition

The composition s₁ ∘ sā‚‚ yields a simplex c in a simplicial set if the constraint r defines it and s1 and s2 are composable.

```
Ī“ ⊢ c : Simplex if
Ī“ ⊢ n (S | R) : Simplicial ∧
r = c = s₁ ∘ sā‚‚ ∧
r ∈ R ∧ s₁, sā‚‚ ∈ S ∧
Ī“ ⊢ āˆ‚įµ¢įµ¢ā‚‹ā‚ s₁ = āˆ‚įµ¢ā‚€ sā‚‚
```

#### Elim Degeneracy

The degeneracy map σᵢⱼ lifts a simplex s to a higher simplex in a simplicial set if the constraint r defines the degeneracy relation.

```
Ī“ ⊢ σᵢⱼ s : Simplex if
Ī“ ⊢ n (S | R) : Simplicial ∧
r = σᵢⱼ < s,
r ∈ R,
s ∈ S
```

#### Face Computation

The face map āˆ‚įµ¢ā±¼ applied to a simplicial set reduces to the simplex s′ specified by the constraint r in R.

```
āˆ‚įµ¢ā±¼ (n (S | R)) → s' if
r = āˆ‚įµ¢ā±¼ < s' ∧
r ∈ R ∧
s' ∈ S
```

#### Composition Computation.

The 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.

```
(s₁ ∘ sā‚‚) (n (S | R)) → c if
r = c = s₁ ∘ sā‚‚ ∧
r ∈ R ∧
s₁, sā‚‚ ∈ S ∧
Ī“ ⊢ āˆ‚įµ¢įµ¢ā‚‹ā‚ s₁ = āˆ‚įµ¢ā‚€ sā‚‚
```

#### Degeneracy Computation.

The degeneracy map σᵢⱼ applied to a simplicial set reduces to the simplex s′ specified by the constraint r in R.

```
σᵢⱼ (n (S | R)) → s' if
r = σᵢⱼ < s' ∧
r ∈ R ∧
s' ∈ S
```

#### Face Uniqueness

Two face maps āˆ‚įµ¢ā±¼ s and āˆ‚įµ¢ā±¼ s′ are equal if they are defined by constraints r and r′ across two simplicial sets with matching elements.

```
Ī“ ⊢ āˆ‚įµ¢ā±¼ s ≔ āˆ‚įµ¢ā±¼ s' if
Ī“ ⊢ n (S | R) : Simplicial ∧
n (S' | R') : Simplicial ∧
s ∈ S ∧ s' ∈ S' ∧
r = āˆ‚įµ¢ā±¼ < s ∈ R ∧
r' = āˆ‚įµ¢ā±¼ < s' ∈ R'
```

#### Uniqueness of Composition.

Two 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.

```
Ī“ ⊢ c ≔ c' if
Ī“ ⊢ n (S | R) : Simplicial ∧
n (S' | R') : Simplicial ∧
r = c = s₁ ∘ sā‚‚ ∈ R ∧
r' = c' = s₁' ∘ sā‚‚' ∈ R' ∧
s₁, sā‚‚ ∈ S ∧
s₁', sā‚‚' ∈ S' ∧
Ī“ ⊢ āˆ‚įµ¢įµ¢ā‚‹ā‚ s₁ = āˆ‚įµ¢ā‚€ sā‚‚ ∧
Ī“ ⊢ āˆ‚įµ¢įµ¢ā‚‹ā‚ s₁' = āˆ‚įµ¢ā‚€ sā‚‚'
```

#### Uniqueness of Degeneracy.

Two degeneracy maps σᵢⱼ s and σᵢⱼ s′ are equal if they are defined by constraints r and r′ across two simplicial sets with matching elements.

```
Ī“ ⊢ σᵢⱼ s ≔ σᵢⱼ s' if
Ī“ ⊢ n (S | R) : Simplicial ∧
n (S' | R') : Simplicial ∧
s ∈ S ∧
s' ∈ S' ∧
r = σᵢⱼ < s ∈ R ∧
r' = σᵢⱼ < s' ∈ R'
```

## Examples

### N-Monoid

```
def nat_monoid : Monoid
:= П (z s : Simplex),
s ∘ z = s, z ∘ s = s
⊢ 2 (z s | s ∘ z = s, z ∘ s = s)
```

O(5).

### 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)
```

O(8)—5 context + 2 nested group + 1 constraint—linear with nesting.

### Triangle Chain

```
def triangle_chain : Chain
:= П (vā‚€ v₁ vā‚‚ e₀₁ e₀₂ e₁₂ t : Simplex),
āˆ‚ā‚ā‚€ = e₀₁, āˆ‚ā‚ā‚ = e₀₂, āˆ‚ā‚ā‚‚ = e₁₂, āˆ‚ā‚‚ < e₀₁ e₀₂ e₁₂
⊢ 2 (vā‚€ v₁ vā‚‚, e₀₁ e₀₂ e₁₂, t | āˆ‚ā‚ā‚€ āˆ‚ā‚ā‚ āˆ‚ā‚ā‚‚, āˆ‚ā‚‚)
```

O(11).

### Simplicial Circle

```
def circle : Simplicial
:= П (v e : Simplex),
āˆ‚ā‚ā‚€ = v, āˆ‚ā‚ā‚ = v, sā‚€ < v
⊢ 1 (v, e | āˆ‚ā‚ā‚€ āˆ‚ā‚ā‚, sā‚€)
```

O(5).

### Z/3Z

```
def z3 : Group
:= П (e a : Simplex),
a³ = e
⊢ 1 (a | a³ = e)
```

O(4).

### Triangle

```
def triangle : Simplex := П (a b c : Simplex),
(ab bc ca : Simplex), ac = ab ∘ bc
⊢ 2 (a b c | ab bc ca)
```

O(7).

### Singular Cone

```
def singular_cone : Simplex
:= П (p q r s : Simplex),
(qrs prs pqs : Simplex), pqr = pqs ∘ qrs
⊢ 3 (p q r s | qrs prs pqs pqr)
```

Context: p, q, r, s: Simplex (vertices), qrs, prs, pqs : Simplex (faces), pqr = pqs ∘ qrs.

Simplex: Dimension 3, 4 faces.

### Mƶbius Piece

```
def Mƶbius : Simplex
:= П (a b c : Simplex),
(bc ac : Simplex), ab = bc ∘ ac
⊢ 2 (a b c | bc ac ab)
```

Context: a, b, c : Simplex (vertices), bc, ac : Simplex (faces), ab = bc ∘ ac (relation).

Simplex: Dimension 2, 3 faces.

### Degenerate Tetrahedron

```
def degen_tetra : Simplex
:= П (p q r s : Simplex, q = r),
(qrs prs pqs : Simplex), pqr = pqs ∘ qrs
⊢ 3 (p q r s | qrs prs pqs pqr)
```

Context: p, q, r, s : Simplex, q = r (degeneracy), qrs, prs, pqs : Simplex, pqr = pqs ∘ qrs.

Simplex: Dimension 3, 4 faces—degeneracy implies a collapsed edge.

Non-Triviality: q = r flattens the structure algebraically, testing composition under equality.

### Twisted Annulus

```
def twisted_annulus : Simplex
:= П (a b c d : Simplex),
(bc ac bd : Simplex), ab = bc ∘ ac, cd = ac ∘ bd
⊢ 2 (a b c | bc ac ab), 2 (b c d | bc bd cd)
```

Context:
* Vertices: a, b, c, d.
* Faces: bc, ac, bd.
* Relations: ab = bc ∘ ac, cd = ac ∘ bd (twist via composition).

Simplices:
* (a b c `|` bc, ac, ab ): First triangle.
* (b c d `|` bc, bd, cd ): Second triangle, sharing bc.

Checking:
* Vertices: a, b, c, d ∈ Ī“ — O(4).
* Faces: bc, ac, ab (O(3)), bc, bd, cd (O(3)) — total O(6).
* Relations: ab = bc ∘ ac (O(1)), cd = ac ∘ bd (O(1)) — O(2).
* Total: O(12) — linear, fast.

### Degenerate Triangle (Collapsed Edge)

```
def degen_triangle : Simplex
:= П (a b c : Simplex, b = c),
(bc ac : Simplex), ab = bc ∘ ac
⊢ 2 (a b c | bc ac ab)
```

Context:
* Vertices: a, b, c, with b = c.
* Faces: bc, ac.
* Relation: ab = bc ∘ ac.

Simplex:
* (a b c `|` bc, ac, ab ) — 3 faces, despite degeneracy.

Checking:
* Vertices: a, b, c ∈ Ī“, b = c — O(3).
* Faces: bc, ac, ab ∈ Ī“ — O(3).
* Relation: ab = bc ∘ ac — O(1).
* Total: O(7)—efficient, handles degeneracy cleanly.

### Singular Prism (Degenerate Face)

```
def singular_prism : Simplex
:= П (p q r s t : Simplex),
(qrs prs pqt : Simplex, qrs = qrs), pqr = pqt ∘ qrs
⊢ 3 (p q r s | qrs prs pqt pqr)
```

Context:
* Vertices: p, q, r, s, t.
* Faces: qrs, prs, pqt.
* Relations: qrs = qrs (degenerate identity), pqr = pqt ∘ qrs.

Simplex:
* (p q r s `|` qrs, prs, pqt, pqr ) — 4 faces, one degenerate.

Checking:
* Vertices: p, q, r, s ∈ Ī“ (t unused, valid) — O(4).
* Faces: qrs, prs, pqt, pqr ∈ Ī“ — O(4).
* Relations: qrs = qrs (O(1)), pqr = pqt ∘ qrs (O(1)) — O(2).
* Total: O(10) — linear, fast despite degeneracy.

### S¹ as āˆž-Groupoid

```
def s1_infty : Simplicial
:= П (v e : Simplex),
āˆ‚ā‚ā‚€ = v, āˆ‚ā‚ā‚ = v, sā‚€ < v,
āˆ‚ā‚‚ā‚€ = e ∘ e, s₁₀ < āˆ‚ā‚‚ā‚€
⊢ āˆž (v, e, āˆ‚ā‚‚ā‚€ | āˆ‚ā‚ā‚€ āˆ‚ā‚ā‚, sā‚€, āˆ‚ā‚‚ā‚€, s₁₀)
```

AST:

```
(* Infinite S¹ āˆž-groupoid *)
let s1_infty = {
name = "s1_infty";
typ = Simplicial;
context = [
Decl (["v"; "e"], Simplex); (* Base point and loop *)
Equality ("āˆ‚ā‚ā‚€", Id "v", Id "āˆ‚ā‚ā‚€");
Equality ("āˆ‚ā‚ā‚", Id "v", Id "āˆ‚ā‚ā‚");
Equality ("sā‚€", Id "e", Id "sā‚€");
Equality ("āˆ‚ā‚‚ā‚€", Comp (Id "e", Id "e"), Id "āˆ‚ā‚‚ā‚€"); (* 2-cell: e ∘ e *)
Equality ("s₁₀", Id "āˆ‚ā‚‚ā‚€", Id "s₁₀") (* Degeneracy for 2-cell *)
];
rank = Infinite; (* Unbounded dimensions *)
elements = ["v"; "e"; "āˆ‚ā‚‚ā‚€"]; (* Finite truncation: 0-, 1-, 2-cells *)
constraints = [
Eq (Id "āˆ‚ā‚ā‚€", Id "v");
Eq (Id "āˆ‚ā‚ā‚", Id "v");
Map ("sā‚€", ["v"]);
Eq (Id "āˆ‚ā‚‚ā‚€", Comp (Id "e", Id "e"));
Map ("s₁₀", ["āˆ‚ā‚‚ā‚€"])
]
}
```

### āˆž-Category with cube fillers

```
def cube_infty : Category := П (a b c : Simplex),
(f g h : Simplex), cube2 = g ∘ f, cube2 : Simplex,
cube3 = cube2 ∘ f, cube3 : Simplex
⊢ āˆž (a b c | cube2 cube3)
```

### Matrix Ring Spectrum

```
def matrix_ring_spectrum : Ring
:= П (a b s p : Simplex),
a + b = s, a ā‹… b = p,
a = [[1,2],[3,4]], b = [[0,1],[1,0]], s = [[1,3],[4,4]], p = [[2,1],[4,3]]
⊢ 4 (a b s p | a + b = s, a ā‹… b = p, a = [[1,2],[3,4]], b = [[0,1],[1,0]],
s = [[1,3],[4,4]], p = [[2,1],[4,3]])
```

### HZ spectrum

```
def hz_spectrum : Ring
:= П (x y p : Simplex),
x ā‹… y = p,
x = 2, y = 3, p = 6
⊢ 3 (x y p | x ā‹… y = p, x = 2, y = 3, p = 6)
```

### 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)
```

### GF(2⁓) Finite Field

```
def gf16 : Field
:= П (x y s p d : Simplex),
x + y = s, x ā‹… y = p, x / y = d,
x = Z(2^4), y = Z(2^4)^2,
s = Z(2^4) + Z(2^4)^2,
p = Z(2^4)^3, d = Z(2^4)^14
⊢ 5 (x y s p d | x + y = s, x ā‹… y = p, x / y = d,
x = Z(2^4), y = Z(2^4)^2,
s = Z(2^4) + Z(2^4)^2,
p = Z(2^4)^3,
d = Z(2^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)
```

## Bibliography

* Daniel Kan. Abstract Homotopy I. 1955.
* Daniel Kan. Abstract Homotopy II. 1956.
* Daniel Kan. On c.s.s. Complexes. 1957.
* Daniel Kan. A Combinatorial Definition of Homotopy Groups. 1958.
* Daniel Kan, W. G. Dwyer. Adjoint functors. 1958.
* Daniel Kan, W. G. Dwyer. Simplicial Localizations of Categories. 1980.
* Graeme Segal. Classifying spaces and spectral sequences. 1968.
* Graeme Segal. Categories and cohomology theories. 1974.
* Graeme Segal, R. Bott. Loop groups and their classifying spaces. 1988.
* Charles Rezk. A model for the homotopy theory of homotopy theory. 2001.
* Charles Rezk. A cartesian presentation of weak n-categories". 2010.
* Charles Rezk, S. Schwede, B. Shipley. Simplicial structures on model categories and functors. 2001.
* Charles Rezk, J. Bergner. Comparison of models for (āˆž,n)-categories. 2013.

## Conclusion

Dan Kan Simplicity HoTT, hosted at groupoid/dan, is a lightweight, pure type checker
built on Cubical Homotopy Type Theory (CCHM), named in tribute to Daniel Kan for
his foundational work on simplicial sets. With a unified syntax —
`П (context) ⊢ n (elements | constraints)` — Dan supports a rich type
system `Simplex`, `Group`, `Simplicial`, `Chain`, `Category`, `Monoid`, now extended with
āˆž-categories featuring cube fillers.