Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
e2de5fc
feat: retain constructor validation traces
johnchandlerburnham Aug 4, 2026
b906b7f
docs: record L4L-01C completion
johnchandlerburnham Aug 4, 2026
2c7695f
proof: establish constructor universe foundation
johnchandlerburnham Aug 4, 2026
7069e6f
docs: record L4L-01D1 completion
johnchandlerburnham Aug 4, 2026
c66b69c
proof: establish post-family constructor semantics
johnchandlerburnham Aug 5, 2026
2344a9c
docs: record L4L-01D2 completion
johnchandlerburnham Aug 5, 2026
fe09b62
proof: establish pre-family constructor safety
johnchandlerburnham Aug 5, 2026
ff22360
docs: record L4L-01D3 completion
johnchandlerburnham Aug 5, 2026
64091a2
proof: establish analyzer-owned constructor view WF
johnchandlerburnham Aug 5, 2026
54b35dd
docs: record L4L-01D4 completion
johnchandlerburnham Aug 6, 2026
9bb7bc3
proof: establish generic singleton package closure
johnchandlerburnham Aug 6, 2026
98d3f90
docs: record L4L-01E completion
johnchandlerburnham Aug 6, 2026
75fea6b
proof: establish level subsumption evaluation
johnchandlerburnham Aug 6, 2026
f07f6f5
docs: record L4L-02A completion
johnchandlerburnham Aug 6, 2026
a042697
proof: establish level equivalence soundness
johnchandlerburnham Aug 6, 2026
89ab8f0
docs: record L4L-02B completion
johnchandlerburnham Aug 6, 2026
b3a9d21
proof: verify constructor level comparison
johnchandlerburnham Aug 6, 2026
6645ec7
docs: record L4L-02C completion
johnchandlerburnham Aug 6, 2026
130da26
proof: widen D3 constructor replay
johnchandlerburnham Aug 6, 2026
dfef1da
fix: emit recursors over checked parameters
johnchandlerburnham Aug 6, 2026
fd9862f
test: cover definitionally equal constructor parameters
johnchandlerburnham Aug 6, 2026
dbd26dc
proof: certify definitionally equal parameter replay
johnchandlerburnham Aug 6, 2026
d978220
proof: close L4L-03 validation parity
johnchandlerburnham Aug 6, 2026
ddb79f2
proof: add L4L-04 normalization matrix core
johnchandlerburnham Aug 6, 2026
c640c90
proof: replay L4L-04 matrix through theory environment
johnchandlerburnham Aug 6, 2026
deb6efb
proof: complete L4L-04 normalization matrix
johnchandlerburnham Aug 6, 2026
f28ce39
proof: add L4L-05 constructor-validity matrix core
johnchandlerburnham Aug 6, 2026
e60e737
proof: retain normalization execution provenance
johnchandlerburnham Aug 6, 2026
9f3b25b
proof: certify executable candidate identity
johnchandlerburnham Aug 6, 2026
7821e62
proof: recover candidate execution provenance
johnchandlerburnham Aug 6, 2026
4ed3f82
proof: expose transparent validation replay
johnchandlerburnham Aug 6, 2026
807d912
proof: replay accepted constructor validity fixtures
johnchandlerburnham Aug 6, 2026
93ab2d0
proof: make fixture closure checks structural
johnchandlerburnham Aug 6, 2026
b5d6d8f
proof: reduce fixture replay oracle surface
johnchandlerburnham Aug 6, 2026
1458f76
checker: make normalization equality transparent
johnchandlerburnham Aug 6, 2026
cdd55d6
checker: add structural identity replay
johnchandlerburnham Aug 6, 2026
d2d988f
checker: replay accepted family identities
johnchandlerburnham Aug 7, 2026
85dd4d2
checker: replay accepted constructor identities
johnchandlerburnham Aug 7, 2026
903f24f
proof: derive fixture replay shapes structurally
johnchandlerburnham Aug 7, 2026
6f537e4
proof: replay Prop constructor universes structurally
johnchandlerburnham Aug 7, 2026
a7bca5f
proof: recover exact candidate views structurally
johnchandlerburnham Aug 7, 2026
e232cf9
proof: replay PRB validation and alignment structurally
johnchandlerburnham Aug 7, 2026
b78403e
proof: replay PRB pre-family safety structurally
johnchandlerburnham Aug 7, 2026
0293093
proof: close L4L-05 constructor validity parity
johnchandlerburnham Aug 7, 2026
ceca681
proof: generalize recursor generation by elimination mode
johnchandlerburnham Aug 7, 2026
460b6d8
proof: certify elimination mode and recursor levels
johnchandlerburnham Aug 7, 2026
6e3f6c5
proof: certify recursor K-target metadata
johnchandlerburnham Aug 7, 2026
1462a11
proof: close K-target parity
johnchandlerburnham Aug 7, 2026
66a502e
proof: cover empty and singleton generation edges
johnchandlerburnham Aug 7, 2026
dc750a0
proof: close empty and singleton edge parity
johnchandlerburnham Aug 7, 2026
85a48d0
verify: add singleton parity matrix
johnchandlerburnham Aug 7, 2026
3c010c2
verify: add singleton rejection and replay inventories
johnchandlerburnham Aug 7, 2026
8411d55
verify: replay all fixed singleton families
johnchandlerburnham Aug 7, 2026
349a5d6
verify: close L4L-07 singleton parity
johnchandlerburnham Aug 7, 2026
d695b3d
theory: add mutual checked representation
johnchandlerburnham Aug 7, 2026
b26262a
inductive: complete mutual validation semantics
johnchandlerburnham Aug 7, 2026
12040b3
inductive: add block-wide mutual generation
johnchandlerburnham Aug 7, 2026
6bc3079
ci: reconcile the sorry audit with the formalization line
johnchandlerburnham Aug 7, 2026
3d97ac1
inductive: type mutual motive selection
johnchandlerburnham Aug 7, 2026
6311fa6
inductive: type mutual minors and recursors
johnchandlerburnham Aug 7, 2026
48882b9
inductive: establish mutual recursor transaction invariants
johnchandlerburnham Aug 7, 2026
67d6592
inductive: prove mutual rule generation well-formed
johnchandlerburnham Aug 7, 2026
1d28096
inductive: compare complete mutual kernel metadata
johnchandlerburnham Aug 7, 2026
eeae528
inductive: replay mutual blocks through environments
johnchandlerburnham Aug 7, 2026
1159c65
inductive: generalize public transaction to mutual blocks
johnchandlerburnham Aug 7, 2026
aa10005
inductive: audit mutual metadata and replay
johnchandlerburnham Aug 7, 2026
c8977a1
inductive: close mutual generation milestone
johnchandlerburnham Aug 7, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 74 additions & 7 deletions Lean4Lean/Audit/SorryFrontier.lean
Original file line number Diff line number Diff line change
@@ -1,19 +1,72 @@
import Lean4Lean.Theory
import Lean4Lean.Theory.ConstructorValidityFixtures
import Lean4Lean.Theory.Inductive
import Lean4Lean.Theory.InductiveFixtures
import Lean4Lean.Theory.Meta
import Lean4Lean.Theory.MutualInductiveFixtures
import Lean4Lean.Theory.Quot
import Lean4Lean.Theory.SingletonParity
import Lean4Lean.Theory.Typing.Basic
import Lean4Lean.Theory.Typing.ChurchRosser
import Lean4Lean.Theory.Typing.Env
import Lean4Lean.Theory.Typing.EnvLemmas
import Lean4Lean.Theory.Typing.HeadReduction
import Lean4Lean.Theory.Typing.InductiveLemmas
import Lean4Lean.Theory.Typing.Injectivity
import Lean4Lean.Theory.Typing.Lemmas
import Lean4Lean.Theory.Typing.Meta
import Lean4Lean.Theory.Typing.Pattern
import Lean4Lean.Theory.Typing.QuotLemmas
import Lean4Lean.Theory.Typing.Strong
import Lean4Lean.Theory.Typing.UniqueTyping
import Lean4Lean.Theory.VDecl
import Lean4Lean.Theory.VEnv
import Lean4Lean.Theory.VExpr
import Lean4Lean.Theory.VLevel
import Lean4Lean.Verify
import Lean4Lean.Verify.Level
import Lean4Lean.Verify.Axioms
import Lean4Lean.Verify.Environment
import Lean4Lean.Verify.Environment.Basic
import Lean4Lean.Verify.Environment.CandidateIdentityReplay
import Lean4Lean.Verify.Environment.ConstructorValidation
import Lean4Lean.Verify.Environment.ConstructorValidityMatrix
import Lean4Lean.Verify.Environment.ConstructorValidityReplay
import Lean4Lean.Verify.Environment.Elimination
import Lean4Lean.Verify.Environment.EliminationFixtures
import Lean4Lean.Verify.Environment.EliminationFixturesCommon
import Lean4Lean.Verify.Environment.EliminationFixturesEdges
import Lean4Lean.Verify.Environment.EliminationFixturesEq
import Lean4Lean.Verify.Environment.EliminationFixturesEqNat
import Lean4Lean.Verify.Environment.EliminationFixturesNat
import Lean4Lean.Verify.Environment.EliminationFixturesOrAnd
import Lean4Lean.Verify.Environment.EliminationFixturesSmall
import Lean4Lean.Verify.Environment.IndexedVecCandidate
import Lean4Lean.Verify.Environment.IndexedVecConsReplay
import Lean4Lean.Verify.Environment.IndexedVecConstructors
import Lean4Lean.Verify.Environment.IndexedVecOuterReplay
import Lean4Lean.Verify.Environment.IndexedVecSemanticReplay
import Lean4Lean.Verify.Environment.InductiveFixtures
import Lean4Lean.Verify.Environment.Lemmas
import Lean4Lean.Verify.Environment.MutualInductiveFixtures
import Lean4Lean.Verify.Environment.Normalization
import Lean4Lean.Verify.Environment.NormalizationMatrix
import Lean4Lean.Verify.Environment.SingletonParityMatrix
import Lean4Lean.Verify.Environment.SingletonParityReplay
import Lean4Lean.Verify.EquivManager
import Lean4Lean.Verify.Expr
import Lean4Lean.Verify.Level
import Lean4Lean.Verify.LocalContext
import Lean4Lean.Verify.NameGenerator
import Lean4Lean.Verify.TypeChecker
import Lean4Lean.Verify.TypeChecker.Basic
import Lean4Lean.Verify.TypeChecker.InferType
import Lean4Lean.Verify.TypeChecker.WHNF
import Lean4Lean.Verify.TypeChecker.IsDefEq
import Lean4Lean.Verify.TypeChecker.Reduce
import Lean4Lean.Verify.TypeChecker.WHNF
import Lean4Lean.Verify.Typing.ConditionallyTyped
import Lean4Lean.Verify.Typing.Expr
import Lean4Lean.Verify.Typing.Lemmas
import Lean4Lean.Verify.VLCtx

/-!
# Lean4Lean sorry frontier
Expand All @@ -32,8 +85,15 @@ when it sits in a foreign namespace (e.g. `Lean.Level.isEquiv_wf` lives in

The audited surface is exactly the modules reachable from this file's imports:
importing a `Theory`/`Verify` module here is what brings it into scope. A sorry
in a proof module not (transitively) imported here is not seen, so when a new
`Theory`/`Verify` file joins the trusted build, add its import below.
in a proof module not (transitively) imported here is not seen, so the import
block above lists the complete `Theory`/`Verify` file tree explicitly (imports
already reachable transitively are harmless). When files are added or renamed,
regenerate it with

{ printf 'import %s\n' Lean4Lean.Theory Lean4Lean.Verify; \
find Lean4Lean/Theory Lean4Lean/Verify -name '*.lean' \
| sed 's/\.lean$//; s#/#.#g; s/^/import /'; } | LC_ALL=C sort -u

`Lean4Lean.Experimental.*` is parked proof work outside the trusted surface and
is intentionally not imported.

Expand Down Expand Up @@ -77,8 +137,8 @@ private def allowlist : Array Lean.Name := #[
`Lean4Lean.TrProj.instN,
`Lean4Lean.TrProj.instL,
-- Tier V — checker verification, blocked on Tiers S/P
`Lean.Level.Normalize.NormLevel.subsumption_eval,
`Lean.Level.isEquiv_wf,
-- (NormLevel.subsumption_eval and Level.isEquiv_wf were proved on the
-- formalization line, 2026-08-05/07, and left the frontier.)
`Lean4Lean.addDecl.WF,
`Lean4Lean.TypeChecker.Inner.inferProj.WF,
`Lean4Lean.TypeChecker.Inner.reduceRecursor.WF,
Expand All @@ -96,7 +156,14 @@ private def allowlist : Array Lean.Name := #[
-- carries a sorry dependency even though the source has no `sorry` token
-- (which is why the old source-token scan never saw these). Not proof debt.
`Lean4Lean.InductiveFixtures.KernelDifferential.KernelRejectRecDomain,
`Lean4Lean.InductiveFixtures.KernelDifferential.KernelRejectRecIndex]
`Lean4Lean.InductiveFixtures.KernelDifferential.KernelRejectRecIndex,
-- The L4L-05 nearest-kernel negatives (Theory/ConstructorValidityFixtures.lean)
-- are the same pattern: `#guard_msgs`-pinned rejections whose recovered
-- constants carry `sorryAx`. Not proof debt.
`Lean4Lean.InductiveFixtures.KernelDifferential.L4L05FamilyNonrecursive,
`Lean4Lean.InductiveFixtures.KernelDifferential.L4L05FamilyProof,
`Lean4Lean.InductiveFixtures.KernelDifferential.L4L05NestedNegative,
`Lean4Lean.InductiveFixtures.KernelDifferential.L4L05RecursiveDependency]

/-- Declarations in the audited surface that directly reference `sorryAx`. -/
private def observedFrontier (env : Lean.Environment) : Array Lean.Name := Id.run do
Expand Down
27 changes: 27 additions & 0 deletions Lean4Lean/Expr.lean
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,33 @@ namespace Expr

def prop : Expr := .sort .zero

/-- Transparent structural equality with the non-strict binder behavior used
by kernel expression comparison. Unlike `Expr.eqv`, this definition is
available to the kernel evaluator, so checker branch proofs do not require an
opaque implementation equation. -/
def structuralEq : Expr → Expr → Bool
| .bvar i, .bvar j
| .fvar i, .fvar j
| .mvar i, .mvar j
| .sort i, .sort j
| .lit i, .lit j => i == j
| .const name levels, .const name' levels' =>
name == name' && levels == levels'
| .app fn arg, .app fn' arg' =>
structuralEq fn fn' && structuralEq arg arg'
| .lam _ domain body _, .lam _ domain' body' _
| .forallE _ domain body _, .forallE _ domain' body' _ =>
structuralEq domain domain' && structuralEq body body'
| .letE _ type value body nondep,
.letE _ type' value' body' nondep' =>
structuralEq type type' && structuralEq value value' &&
structuralEq body body' && nondep == nondep'
| .mdata data expr, .mdata data' expr' =>
structuralEq expr expr' && data.entries == data'.entries
| .proj typeName index struct, .proj typeName' index' struct' =>
structuralEq struct struct' && typeName == typeName' && index == index'
| _, _ => false

def arrow (d b : Expr) : Expr := .forallE `a d b .default

def lam0 (ty e : Expr) : Expr := .lam `_ ty e default
Expand Down
Loading