Commit Graph
37 Commits
Author SHA1 Message Date
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
Julius FischerandClaude Opus 5.5 2439a6c998 Level normaliser nf and tests
- 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
2026-10-21 15:53:52 +02:00
Julius FischerandClaude Opus 5.5 18ec877ca7 Declare fixities for all term operators
Loosest to tightest, all above the judgements (4) and context
extension (5):
  6  `λ_ ∀[x⦂_]_ ∃[x⦂_]_  (infixr; binder bodies extend to the right)
  7  _`,_                 (infixr)
  8  _`≡_
  9  `Setn_ `Setω_        (`Setn l₁ `⊔ l₂ = `Setn (l₁ `⊔ l₂))
  10 _`⊔_                 (infixl)
  11 _·_                  (infixl)
  12 _[_]                 (infixl)
  13 `_

Previously `_ bound looser than the undeclared operators, so e.g.
` x `⊔ ` y did not parse.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016LG5WunTkTJFuvdzgET3Af
2026-10-21 15:53:52 +02:00
Julius FischerandClaude Opus 5.5 34548eceea Level equality _~_ and conversion modulo level equality
- 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
2026-10-21 15:47:12 +02:00
Julius FischerandClaude Opus 5.5 d10ef901a2 Typing and Values: close gaps found in review
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
2026-10-21 15:41:18 +02:00
Julius FischerandClaude Opus 5.5 fc39eeec29 Docs: motivation, design notes, TODO and alternative ideas
- 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
2026-10-21 15:20:23 +02:00
Julius FischerandClaude Opus 5.5 eb1085ea44 Typing: universe hierarchy with cumulativity and level-dependent ∀
- ⊢-∀ now determines its result level: Set (l₁ ⊔ l₂), where the codomain
  level is a weakened outer level and so cannot mention the bound variable.
- ⊢-∀ω: the same for domain and codomain in Setω.
- ⊢-∀-dep: codomain level may depend on the bound variable
  (e.g. ∀ (l : Level) → Set l), result in Setω.
- Cumulativity via lifting rules: Set l ≤ Setω lzero and
  Setω l ≤ Setω (lsuc l).

The downstream proofs (ConversionProperties, SubstitutionPreservesTyping,
Inversion, SubjectReduction) do not yet cover the new rules; see TODO.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016LG5WunTkTJFuvdzgET3Af
2026-10-21 15:20:23 +02:00
Julius FischerandClaude Opus 5.5 40f9ccaec1 Split Specification into topic modules
Move the contents of Specification.agda unchanged into
Specification/{Axioms,Syntax,Substitution,Values,Reduction,Conversion,Typing}.agda,
with fixity declarations next to their definitions. Specification.agda
now re-exports all parts, so existing imports keep working. The unused
helper cong₃ moves to Util/Equality.agda.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016LG5WunTkTJFuvdzgET3Af
2026-10-21 15:20:23 +02:00
JKF 201fe7942b Make β-λ more generic (Argument can now be any type T instead of `Setn L) 2026-04-25 22:24:28 +02:00
JKF e8ee5b200c Some definitions and adjusted proofs 2026-04-25 21:57:10 +02:00
Julius 5cbf679c0c small work 2026-04-21 20:44:15 +02:00
JKF 077d91a485 changes 2026-04-17 19:31:44 +02:00
JKF f9e4b4d9aa initial commit 2026-04-01 18:29:46 +02:00
minze 70e9a24640 Initial commit 2026-04-01 18:19:34 +02:00