Commit Graph
63 Commits
Author SHA1 Message Date
Julius FischerandClaude Opus 5.5 db56f5e4ef Consistency relative to a model of set theory
Typecheck / agda (push) Successful in 2m15s
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
2026-11-22 21:36:40 +01:00
Julius FischerandClaude Opus 5.5 48d3f9040b ⊢-∀ / ⊢-∃: the codomain level must be well formed
Typecheck / agda (push) Failing after 7s
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
2026-11-22 21:27:08 +01:00
Julius FischerandClaude Opus 5.5 bba504f2fe Model: reduction and level equality preserve meaning
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q7dfaHQ3dYSfqcxR7V5UrJ
2026-11-22 21:24:36 +01:00
Julius FischerandClaude Opus 5.5 593f89d919 Model: set-theory interface and interpretation
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
2026-11-22 21:19:32 +01:00
Julius FischerandClaude Opus 5.5 d83c61261d Annotate λ with its domain: `λ[x⦂ A ] e
Typecheck / agda (push) Successful in 1m52s
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
2026-11-22 21:12:06 +01:00
Julius FischerandClaude Opus 5.5 b05b643c39 TODO: plan for consistency via a set-theoretic model
Typecheck / agda (push) Successful in 1m55s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q7dfaHQ3dYSfqcxR7V5UrJ
2026-11-22 21:05:04 +01:00
Julius FischerandClaude Opus 5.5 0c079aadf2 Canonicity of closed terms
Typecheck / agda (push) Successful in 1m53s
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
2026-11-21 18:36:15 +01:00
Julius FischerandClaude Opus 5.5 e708f2d425 Restructure folders: Specification, Metatheory, Decidability
Typecheck / agda (push) Successful in 1m54s
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
2026-11-21 14:50:06 +01:00
Julius FischerandClaude Opus 5.5 c2055d6eae Docs: natural numbers in README and TODO
Typecheck / agda (push) Successful in 1m56s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q7dfaHQ3dYSfqcxR7V5UrJ
2026-11-21 13:19:11 +01:00
Julius FischerandClaude Opus 5.5 18de2bc597 Natural numbers: decidability, normalisation and strong normalisation
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
2026-11-21 13:19:11 +01:00
Julius FischerandClaude Opus 5.5 bcc09bbf47 Natural numbers: confluence, subject reduction and progress
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
2026-11-21 13:19:11 +01:00
Julius FischerandClaude Opus 5.5 e48fcbaf7c Tests: factorial with natrec
Tests/NatExample types plus, times and factorial with ⊢-natrec (constant
motive λ ℕ).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q7dfaHQ3dYSfqcxR7V5UrJ
2026-11-21 13:19:11 +01:00
Julius Fischer ed5d9284a0 added bbN, suc, zero, natrec
Typecheck / agda (push) Failing after 17s
2026-11-21 12:58:35 +01:00
Julius FischerandClaude Opus 5.5 4e2e782375 Strong normalisation of well-typed terms
Typecheck / agda (push) Successful in 1m34s
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
2026-11-21 11:53:47 +01:00
Julius FischerandClaude Opus 5.5 5666d0d881 Decidability: normalisation by reduction alone
Typecheck / agda (push) Successful in 1m20s
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
2026-11-21 02:55:26 +01:00
Julius FischerandClaude Opus 5.5 5ea926c57d Decidability of conversion: the fundamental theorem
Typecheck / agda (push) Successful in 1m35s
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
2026-11-21 02:52:46 +01:00
Julius FischerandClaude Opus 5.5 7d9eb08c4e Decidability: universe hierarchy of the relation
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
2026-11-21 02:45:57 +01:00
Julius FischerandClaude Opus 5.5 6a9496d8c9 Decidability: cumulativity and semantic levels
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
2026-11-21 02:40:54 +01:00
Julius FischerandClaude Opus 5.5 f932f964c1 Decidability: families up to conversion, renaming of reducibility
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
2026-11-21 02:32:45 +01:00
Julius FischerandClaude Opus 5.5 76b4e71d12 Pair rule: the codomain must be a type
Typecheck / agda (push) Successful in 1m20s
⊢-, 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
2026-11-21 02:24:00 +01:00
Julius FischerandClaude Opus 5.5 1ac22cee87 Decidability: logical relation for the core types
Typecheck / agda (push) Successful in 1m25s
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
2026-11-20 15:15:00 +01:00
Julius FischerandClaude Opus 5.5 2f0c28b9e5 Decidability: properties of inductive SN
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
2026-11-20 15:11:51 +01:00
Julius FischerandClaude Opus 5.5 21c12fdc00 Decidability: inductive SN, decision via normalisation up to ~
Typecheck / agda (push) Successful in 1m7s
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
2026-11-20 01:30:48 +01:00
Julius FischerandClaude Opus 5.5 a2c2882ab5 Decidability: normaliser from SN, decision from normalisation
Typecheck / agda (push) Successful in 3m32s
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
2026-11-20 01:19:15 +01:00
Julius FischerandClaude Opus 5.5 663e7a03f5 Decidability: well-formed contexts, rigidity of normal forms
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
2026-11-20 01:19:15 +01:00
Julius FischerandClaude Opus 5.5 0d06ad591c TODO: plan for decidability of conversion
Typecheck / agda (push) Successful in 1m11s
Unary logical relation adapted from AÖV, existing theorems unchanged,
universes and levels last.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016LG5WunTkTJFuvdzgET3Af
2026-11-19 15:50:16 +01:00
Julius FischerandClaude Opus 5.5 a5a5b81de2 Add Decidability.Statement to Everything.agda
Typecheck / agda (push) Successful in 1m9s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016LG5WunTkTJFuvdzgET3Af
2026-11-19 15:06:06 +01:00
Julius FischerandClaude Opus 5.5 411c93d27f State decidability of conversion
Typecheck / agda (push) Failing after 1m5s
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
2026-11-19 15:05:04 +01:00
JKFandClaude Opus 5.5 ad545360a3 CI: fix Agda binary path and set Agda_datadir
Typecheck / agda (push) Successful in 1m3s
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>
2026-11-06 19:10:47 +01:00
JKFandClaude Opus 5.5 808e661c10 Add Gitea Actions typecheck workflow
Typecheck / agda (push) Failing after 54s
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>
2026-11-06 19:09:01 +01:00
JKF b637e52e7f Example from the Issue 2026-11-06 17:24:59 +01:00
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
JKF 87a1bb1a4e git status 2026-10-30 16:49:02 +01:00
JKF bb43eaa670 Rename Set≤Set to Set<Set 2026-10-30 14:48:25 +01:00
JKF 479d734cd6 Remove ⊢-Setω≤ 2026-10-30 14:41:19 +01:00
Julius FischerandClaude Opus 5.5 897f74321b Use Fin from the standard library
Replace univTypes.Util.Fin with Data.Fin (same constructors zero/suc) and
drop the unused Data.Fin import renamed to 𝔽.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016LG5WunTkTJFuvdzgET3Af
2026-10-22 14:34:37 +02:00
Julius FischerandClaude Opus 5.5 bd07cf09c4 Progress for open terms
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
2026-10-22 14:28:40 +02:00
Julius FischerandClaude Opus 5.5 b39cfabb43 Injectivity of lsuc via the normaliser
~-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
2026-10-22 13:41:06 +02:00
Julius FischerandClaude Opus 5.5 cee0d8ef68 Docs: separate level syntax and conversion modulo level equality
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
2026-10-22 11:33:43 +02:00
Julius FischerandClaude Opus 5.5 641378dd51 Port the level normaliser to the sorted syntax
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
2026-10-22 11:32:37 +02:00
Julius FischerandClaude Opus 5.5 8eabed8b82 Subject reduction for the full system
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
2026-10-22 11:26:58 +02:00
Julius FischerandClaude Opus 5.5 9d59698f7d SubstitutionPreservesTyping for all typing rules
⊢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
2026-10-22 11:25:43 +02:00
Julius FischerandClaude Opus 5.5 be8044e312 Rename the sorts to tm and lv
"term" clashed with a helper in SubstitutionPreservesTyping and is a
likely name elsewhere too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016LG5WunTkTJFuvdzgET3Af
2026-10-22 11:25:43 +02:00
Julius FischerandClaude Opus 5.5 2e064edddf Inversion for conversion modulo level equality
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
2026-10-22 11:23:48 +02:00
Julius FischerandClaude Opus 5.5 3f9b13d052 ConversionProperties for conversion modulo level equality
≈ 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
2026-10-22 11:22:02 +02:00
Julius FischerandClaude Opus 5.5 4826ca4d86 Church–Rosser modulo level equality
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
2026-10-22 11:19:42 +02:00
Julius FischerandClaude Opus 5.5 1992d33099 Level equality: injectivity and substitution without the normaliser
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
2026-10-22 11:18:25 +02:00
Julius FischerandClaude Opus 5.5 5d73875bb3 Port Composition and Confluence to the sorted syntax
Fusion lemmas, parallel reduction and the complete development are now
generic in the sort, with cases for `lvl, `latom and the new redex
`latom (`lvl l). par-triangle loses the level cases in term positions,
which are now ruled out by the sort index.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016LG5WunTkTJFuvdzgET3Af
2026-10-22 11:16:33 +02:00
Julius FischerandClaude Opus 5.5 c1e10c1420 Separate syntax for level expressions
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
2026-10-22 11:14:30 +02:00
Julius FischerandClaude Opus 5.5 88f9d4d579 Level normaliser: soundness, completeness, decidability
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
2026-10-21 22:57:49 +02:00