Files
JKFandClaude Opus 5.5 a658081632 Add unit type Unit with tt
`Unit : Set and `tt : `Unit, both values and inert under renaming,
substitution, reduction and level equality. Cases added throughout
confluence, conversion, the level normaliser, substitution lemmas,
subject reduction and progress (new head hUnit for canonical forms).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 16:49:14 +01:00

73 lines
2.4 KiB
Agda
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
module univTypes.SubjectReduction.Specification.Syntax where
open import Data.Nat using (ℕ; suc)
open import Data.Fin using (Fin)
-- Terms come in two sorts: ordinary terms and level expressions. Level
-- expressions have their own syntax (`lzero, `lsuc, _`⊔_), so that level
-- equality (LevelEquality) can only rearrange levels and never changes the
-- shape of a term. The two sorts meet in two coercions:
-- `lvl : Lvl n → Term n a level expression used as a term of type `Level
-- `latom : Term n → Lvl n a term of type `Level used as a level
-- with the reduction `latom (`lvl l) ↪ l.
data Sort : Set where
tm lv : Sort -- terms, level expressions
-- Term operators, loosest to tightest. All bind tighter than the judgements
-- (_↪_, _≈_, _~_, _⊢_⦂_ at 4) and the context extension _,_ (at 5);
-- constructors used as functions (`lsuc, `lvl, `latom, `proj₁, `proj₂,
-- `subst) bind like application, i.e. tightest. _[_] (Substitution) is at 12.
infixr 6 `λ_ ∀[x⦂_]_ ∃[x⦂_]_ -- binders: the body extends to the right
infixr 7 _`,_
infix 8 _`≡_
infix 9 `Setn_ `Setω_ -- `Setn l₁ `⊔ l₂ = `Setn (l₁ `⊔ l₂)
infixl 10 _`⊔_
infixl 11 _·_
infix 13 `_
data Tm : Sort → ℕ → Set
Term : ℕ → Set
Term = Tm tm
Lvl : ℕ → Set
Lvl = Tm lv
data Tm where
`_ : ∀ {n} → Fin n → Term n
`λ_ : ∀ {n} → Term (suc n) → Term n
_·_ : ∀ {n} → Term n → Term n → Term n
∀[x⦂_]_ : ∀ {n} → Term n → Term (suc n) → Term n
-- My Extension
`Unit : ∀ {n : ℕ} → Term n
`tt : ∀ {n : ℕ} → Term n
`Setω_ : ∀ {n : ℕ} (l : ℕ) → Term n
`Setn_ : ∀ {n} (l : Lvl n) → Term n
`Level : ∀ {n} → Term n
`lvl : ∀ {n} → Lvl n → Term n
-- Level expressions
`latom : ∀ {n} → Term n → Lvl n
`lzero : ∀ {n} → Lvl n
`lsuc : ∀ {n} → Lvl n → Lvl n
_`⊔_ : ∀ {n} → Lvl n → Lvl n → Lvl n
-- Extension
∃[x⦂_]_ : ∀ {n} → Term n → Term (suc n) → Term n
_`,_ : ∀ {n} → Term n → Term n → Term n
`proj₁ : ∀ {n} → Term n → Term n
`proj₂ : ∀ {n} → Term n → Term n
_`≡_ : ∀ {n} → Term n → Term n → Term n
`refl : ∀ {n} → Term n
`subst : ∀ {n} → Term (suc n) → Term n → Term n → Term n
{-# DISPLAY Tm tm n = Term n #-}
{-# DISPLAY Tm lv n = Lvl n #-}
`Set : ∀ {n} → Term n
`Set = `Setn (`lzero)