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
Model/Soundness: soundness of typing up to conversion — a well-typed term
is well-denoted and its meaning lies in the meaning of a well-denoted
witness W ≈ T, in every environment satisfying a convertible semantic
context. Model/Consistency: no closed term of zero ≡ suc zero or of
∀ (A : Set) → A, for every instance of the set-theory interface.
Re-exported in Theorems; README and TODO describe the model.
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
canonicity: a closed term whose type has head h reduces to an
introduction form for h; canonicity-ℕ: a closed natural number reduces to
a numeral ⌜ k ⌝. From normalisation, subject reduction and canonical forms,
since closed normal forms are not neutral. Re-exported in Theorems.
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
StrongNormalisation.agda: inductive SN is sound for accessibility of ↪.
Introduction forms and neutral spines preserve accessibility directly;
backward closure under weak head expansion goes through a commutation
lemma (another step is the head step, or commutes with it and reduces the
contractum or only the discarded part) and lexicographic recursion. This
proves StrongNormalisation for terms and levels. TODO: the
fast-decision-procedure item is dropped; η for the coercions stays
optional.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q7dfaHQ3dYSfqcxR7V5UrJ
Inductive SN drops its ~ clauses, which the fundamental theorem never
used, so a derivation yields a normal form by ↪* (nf). This proves the
strict Normalisation statements (normalisation, normalisationₗ), and
decidability now goes through them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q7dfaHQ3dYSfqcxR7V5UrJ
Fundamental.agda: semantic typing (member of a reducible type convertible
to the type, in the relation of all universes), reducible substitutions,
semantic versions of every typing rule (application, λ, pairs,
projections, subst, type formers at exact strata with level values,
universes, cumulativity), the fundamental theorem for terms and levels,
the reducible identity substitution of a well-formed context, inductive
SN of well-typed terms, and decidable-≈ / decidable-≈ₗ. README and TODO
document the proof.
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
LogRel.agda: reducible types and their members by induction-recursion
(neutral, Level, Unit, ≡, ∀, ∃ Kripke over renamings, universes via a
Kit with KitLaws). Conversion irrelevance (conv: convertible reducible
types have the same members; shapes via ≈-head and Spine≉head, confluence
instead of determinism of whnf), CR1 (∋→SN), CR3 (SNe→∋), closure under
weak head expansion (⇒-∋, ⇒*-∋), reducible types are SN (⊩→SN).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q7dfaHQ3dYSfqcxR7V5UrJ
SN.agda: weak head reduction _⇒_ with SN side conditions, SNe and SN,
closed under ~ by an explicit clause (accessibility modulo ~ fails for
levels: duplicating an atom with ~ and reducing one copy cycles), and
nf : SN e → normal form up to ~. Statement.agda: Normalisation~.
Decision.agda: decide via ↪~*, so SNᵢ → Decidable-≈ (also for levels).
TODO updated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q7dfaHQ3dYSfqcxR7V5UrJ
Decision.agda: normalise / normaliseₗ recurse on an SN proof using
progress and subject reduction (SN→Normalisation); normalisation decides
conversion by comparing normal forms with _~?_
(Normalisation→Decidable-≈, also for levels). Registered in
Everything.agda; TODO updated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q7dfaHQ3dYSfqcxR7V5UrJ
Decidability/Statement.agda states Decidable-≈ and Decidable-≈ₗ for
well-typed terms (conversion is undecidable on untyped terms) and the
normalisation property the proof is expected to go through. TODO and
README updated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016LG5WunTkTJFuvdzgET3Af
`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>
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
~-lsuc-inj : lsuc l ~ lsuc l' → l ~ l' in LevelEqualityDecision: shift is
injective and readback is injective on well-formed normal forms. TODO
records the analysis of the optional η rule for the coercions.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016LG5WunTkTJFuvdzgET3Af
README describes the two-sort syntax, why level equations on ordinary
terms break transitivity, conversion as a common reduct under
reduction modulo level equality, and the Church–Rosser proof. TODO
ticks off the level-equality chain and the typing repairs; IDEAS
records the alternatives that were considered and why they fail.
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
- Specification/LevelEquality.agda: _~_ is the congruence closure of the
level equations (associativity, commutativity and idempotence of ⊔,
lzero as unit, lsuc distributing over ⊔, l ⊔ lsuc l = lsuc l).
- Conversion: e₁ ≈ e₂ iff e₁ ↪* u₁, e₂ ↪* u₂ and u₁ ~ u₂.
ConversionProperties and the other proofs still use the old record with a
single common reduct; see TODO.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016LG5WunTkTJFuvdzgET3Af
Values:
- val-Setω requires Value l (as val-Setn does), so a reducible Setω term
is no longer a value.
- Rename val-l to val-lzero.
- Add val-⊔: _⊔_ does not reduce, so a join of values is a value.
Typing:
- ⊢-λ requires the domain to be a type (Γ ⊢ t₁ ⦂ Setω l; small types
reach Setω lzero via ⊢-Set≤Setω).
- ∃ mirrors ∀: ⊢-∃, ⊢-∃ω, ⊢-∃-dep.
- ⊢-≡ requires t ⦂ Set l and lives in Set l; the motive of ⊢-subst is in
Set (ren wk l).
- ⊢-Setn and ⊢-Setω require their level to have type Level.
Downstream proofs still need cases for the new rules; see TODO.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016LG5WunTkTJFuvdzgET3Af
- README: motivation (Agda issue #5810, loss of subject reduction with
Setω), design of the universe hierarchy and of level equality by
normalisation in conversion.
- TODO.md: plan for level equality, typing follow-ups and review findings
on Values.
- IDEAS.md: the Bad-predicate formulation of level-dependent ∀.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016LG5WunTkTJFuvdzgET3Af