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
conv : SN a → SN b → Dec (a ≈ b) follows weak head steps, compares the
heads of the weak head normal forms and recurses into their parts (AÖV
style); levels are compared by the level normaliser. Recursion is
structural on the SN derivations. Negative answers are justified through
normal forms (convertible terms have ~-equal normal forms with the same
head), but only in the proof. The module is generated by
gen_conversion.py (the mismatch cases are mechanical).
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
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
Model/SetTheory: the set theory as a record (no postulate), with cumulative
universes for the strata fin k / ω+ m. Model/Interpretation: total
interpretation of terms (levels as natural numbers), well-denotedness, and
the renaming and substitution lemmas.
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
Inductive SN gains weak head steps for natrec (natrec-zero discards the
motive and the step, natrec-suc nothing) and neutral natrec. The logical
relation gets ⊩ℕ, whose members (Nat) weak-head reduce to zero, to suc of a
member, or to a neutral term; the fundamental theorem handles natrec by
induction on Nat, for both natrec rules. Backward closure covers the new
steps (the discarded motive and step are packed as a pair).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q7dfaHQ3dYSfqcxR7V5UrJ
Level equality gains the congruences ~-suc / ~-natrec. Parallel reduction
and complete development cover β-natrec-zero / β-natrec-suc; the level
normaliser encodes the new constructors; progress has canonical forms for
ℕ; subject reduction handles both natrec rules (natrec-suc-type computes
the type of the unfolded recursion).
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
Universes.agda: strata fin k < ω+ m, kits by structural recursion
(kitF, kitW), classification of their universes (Set j or Setω m with the
members of that stratum), the kit laws for every stratum, the kit kit∞ of
all universes (for type annotations), embeddings between strata
(cumulativity, and into kit∞), and introduction/elimination of universes
in the relation of kit∞.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q7dfaHQ3dYSfqcxR7V5UrJ
Lift.agda: kit embeddings (composable) lift reducible types with the same
members. Levels.agda: the value of a level (normal form, neutral atoms
counted as 0), invariant under ~ and conversion, stable under renaming;
the universes use the value after one weakening, so that a weakening can
be removed again by a renaming (⟦≡⟧⁺-str).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q7dfaHQ3dYSfqcxR7V5UrJ
The domain and codomain families of ∀ and ∃ are now reducible up to
conversion (a reducible type convertible to each instance), since typing
only fixes types up to conversion. Reducible types are therefore not SN
themselves (⊩→SN removed); the kit's universe members carry SN instead.
New: whnf/tag views (tag-≈), prepending weak head steps (⇒*-⊩), and
renaming of reducible types and members (ren-⊩, ren-∋), with renaming
laws in KitLaws. The kit field is renamed Univ.
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
SNProperties.agda: weak head reduction sequences ⇒* (expansion of SN,
congruence, ⇒* ⊆ ≈), renaming of ⇒, SN and SNe, identity renaming and
ren (extᵣ wk) e [ ` zero ] ≡ e, and neutral spines: preserved by ↪ and ~,
so a neutral term is never convertible to a type former (Spine≉head).
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
Statement.agda: the judgement ⊢ Γ, SN, and the statements
(StrongNormalisation, Normalisation, Decidable-≈, each also for levels)
with a ⊢ Γ premise. NormalForms.agda: ~ preserves Value and Neutral
(both directions), a normal form only takes ~ steps under ↪~*, so
convertible normal forms are ~-equal (≈-Value).
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
The release tarball unpacks to Agda-<version>/{bin,data}, and the binary
needs Agda_datadir to find its primitive modules.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Typechecks Everything.agda (which imports every module) with Agda 2.7.0.1
and stdlib v2.2, checks that Everything.agda is complete and that
Axioms.agda contains the only postulates. Adds a status badge to the README.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`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
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
subject-reduction now covers every typing rule (∀ω/∀-dep, ∃ω/∃-dep,
cumulativity, universes, `lvl), mutually with subject-reductionₗ for
level well-formedness. The new redex `latom (`lvl l) ↪ l is handled by
invert-⊢lvl. Everything typechecks without holes or postulates beyond
functional extensionality.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016LG5WunTkTJFuvdzgET3Af
⊢ren and ⊢sub now cover ∀ω/∀-dep/∃ω/∃-dep, the three-premise ⊢-≡,
cumulativity and the new level judgement (⊢renₗ/⊢subₗ, mutually).
Codomain levels weakened under a binder are realigned with
wk-extᵣ-fusion / wk-extₛ-fusion, now generic in the sort.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016LG5WunTkTJFuvdzgET3Af
Shape lemmas now follow reduction modulo level equality: a level
equation keeps the outermost constructor by ~→≋. Universes are never
convertible to ∀, ∃ or ≡, which discharges the cumulativity cases of
the typing inversions. New: invert-≈-Setn/-Setω and invert-⊢lvl.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016LG5WunTkTJFuvdzgET3Af
≈ is an equivalence by confluence modulo level equality. Congruence,
renaming and substitution all come from one lifting lemma (≈-map) for
functions that preserve ↪ and ~, which replaces the ξₚ* and ↪ₚ*σ
lemmas. ≈-Γ-⊢ covers all typing rules, including ∀ω/∀-dep/∃ω/∃-dep,
cumulativity, and the new level judgement _⊢ₗ_; ≈-Γ-⊢₁ is now an
instance of it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016LG5WunTkTJFuvdzgET3Af
Reduction modulo level equality (_↪~*_) is confluent. Complete
development respects level equality (~-⁺): in a redex position both
sides have the same constructor by ~→≋, and the level equations never
look into their arguments. Hence _~_ ; _↪ₚ_ ; _~_ has Takahashi's
triangle property, and confluence follows as for plain reduction.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016LG5WunTkTJFuvdzgET3Af
On terms _~_ is a pure congruence now, so its outermost layer can be
read off directly: ~→≋ maps an equation to one layer of matching
constructors with ~-equal arguments. All injectivity lemmas follow,
and different constructors are never ~-equal.
Also: _~_ is stable under renaming and substitution (~-ren, ~-sub,
~σ-sub, ~-[]). Decidability via nf will move to its own module when
the normaliser is ported.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016LG5WunTkTJFuvdzgET3Af