Algorithmic/Checker: infer / check returning declarative derivations;
pairs and refl are checked, everything else inferred; types are only
weak-head reduced, and compared with the lazy conversion algorithm.
Algorithmic/Strengthening decides syntactically whether a codomain level
depends on the bound variable (⊢-∀ vs ⊢-∀-dep); Algorithmic/Sorts tracks
the sort of each type and reads sorts off type formers. Not complete
(documented in README and TODO). Tests/Algorithmic checks the syntactic
parts that compute inside Agda.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q7dfaHQ3dYSfqcxR7V5UrJ
True is the unit type (`True = `Unit, `trivial = `tt). `False : Set has
no introduction form; `absurd P e : P for e : False never reduces at the
root (neutral when e is). Covered through level equality, confluence,
the level normaliser, subject reduction, progress, decidability and
strong normalisation (members of False are terms reducing to a neutral
term). The set-theory interface gains an empty set, which False denotes;
Model/Consistency proves no-False.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q7dfaHQ3dYSfqcxR7V5UrJ
Over an empty domain the codomain derivation says nothing about the level
l₂, so the set-theoretic model needs Γ ⊢ₗ l₂ (cf. con-leche's
certification tax). This replaces the planned premise on ⊢-≈, which the
model avoids by stating soundness up to conversion. Proofs, tests and
Examples/Issue pass the premise.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q7dfaHQ3dYSfqcxR7V5UrJ
Preparation for the set-theoretic model, where a λ denotes the graph of
its body over its domain. ⊢-λ uses the annotation as the domain;
reduction also reduces it (ξ-λ₁) and β discards it, so inductive SN and
the backward closure get a side condition for it. All proofs, tests and
Examples/Issue (annotations only) are updated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q7dfaHQ3dYSfqcxR7V5UrJ
Specification/ (moved up from SubjectReduction/) holds only definitions.
Metatheory/ holds the proofs about it: Substitution (was Composition),
Levels/ (Equality, NormalForm, Decision), Confluence/ (Parallel, Modulo,
Conversion) and Typing/ (Inversion, Substitution, SubjectReduction,
Progress). Decidability/ groups SN/ (Inductive, Properties, Strong) and
LogRel/ (Core, Lift, LevelValue, Universes). Theorems.agda re-exports the
main results. Examples/ keeps the hand-written examples apart from the
generated Tests/ (NatExample renamed to Tests/Nat). Module names, docs and
the CI postulate check follow the new paths; no proof changes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q7dfaHQ3dYSfqcxR7V5UrJ
⊢-, gets the premise Γ , t₁ ⊢ t₂ ⦂ Setω l, as in Agda. Without it,
(λz. Unit , tt) : ∃[x⦂ ∀ (z : Level) → Setω 0 ] (x · x) is derivable
although x · x is not a type, and no reducible type is convertible to
the pair's type, so the logical relation cannot cover pairs. Statements
of existing theorems are unchanged; the proofs matching on ⊢-, (≈-Γ-⊢,
⊢ren, ⊢sub, subject reduction, inversion, progress) pass the premise
along. New test Tests.Typing.pair; TODO updated with the two further
ingredients of the fundamental theorem.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q7dfaHQ3dYSfqcxR7V5UrJ
Progress.agda: canonical forms via a generic head lemma (≈-head: type
formers keep their outermost constructor under ↪ and ~), mutual
progress / progressₗ (well-typed terms are normal forms or reduce), and
value-normal (normal forms do not reduce). Tests and docs updated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016LG5WunTkTJFuvdzgET3Af
Atoms are now exactly the terms under `latom, so the Atom/View
machinery in Completeness goes away: flatten is total on Lvl with four
cases, and a well-formed entry is just a term in normal form. nf, sound
and complete are generic in the sort; the term order encodes `lvl and
`latom and decodes by sort.
Decidability (_~?_) moves to LevelEqualityDecision, since level
equality properties no longer depend on the normaliser.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016LG5WunTkTJFuvdzgET3Af
Terms are now indexed by a sort: Term = Tm term, Lvl = Tm level. Level
expressions (`lzero, `lsuc, _`⊔_) live in Lvl and meet terms only through
the coercions `lvl : Lvl → Term and `latom : Term → Lvl, with the new
reduction `latom (`lvl l) ↪ l. Level equality _~_ is unchanged on levels
and a pure congruence on terms, so it can no longer hide or create redexes.
Conversion _≈_ is now a common reduct under reduction modulo level
equality (_↪~*_). Typing gains the level well-formedness judgement _⊢ₗ_.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016LG5WunTkTJFuvdzgET3Af
Prove the level normaliser correct: u ~ u' iff nf u ≡ nf u'.
- LevelNormalForm: compare via an encoding of terms as trees (same
order as before); merge without `with` so it passes the termination
checker; shift via map₂; readback without a where block.
- LevelNormalForm/Order: compare is a strict total order, decidable
equality on terms.
- LevelNormalForm/Merge: sortedness, merge laws (associativity via
lookup extensionality), join/shift laws.
- LevelNormalForm/Completeness: well-formed normal forms, the key lemma
flatten (readback L) ≡ L, idempotence, completeness.
- LevelNormalForm/Soundness: denotation of normal forms, soundness.
- LevelEqualityProperties: decision procedure _~?_ and injectivity of
all constructors except lsuc and ⊔ up to ~.
- Tests for the decision procedure; README and TODO updated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016LG5WunTkTJFuvdzgET3Af
- SubjectReduction/LevelNormalForm.agda: nf normalises every level
expression in a term to max(c, a₁ + k₁, …) with atoms normalised first,
one entry per atom (largest offset), atoms sorted by a total order on
terms, and the constant dropped when some offset is at least as large.
- Tests/: example derivations for the typing rules, examples for _~_ and
_≈_, and computational tests for nf (all six level equations,
canonical shapes, atoms, idempotence).
- README: level normal form and repository layout; TODO: proof steps
for nf (properties of compare, soundness, completeness, decidability).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016LG5WunTkTJFuvdzgET3Af