Repository navigation
tests: three proofs of False from non-transitive definitional equality - #141
Merged
Merged
Conversation
Definitional equality is not transitive on three `Acc.rec`-based values: proof irrelevance relates `a ≡ b` and `b ≡ c`, but not `a ≡ c`. Three ways to turn that into `False`: * rec-missing-ih: in the affected kernels the defeq cache is a union-find structure, i.e. it closes that relation transitively, but it is only consulted for expressions with equal hashes. A crafted collision therefore makes a K-like reduction fire in the pass that builds the minor premises of a recursor and not in the pass that builds its rules, so the `step` minor premise takes an induction hypothesis that its rule does not supply. Fixed by leanprover/lean4#14806. Frozen as a static export file, since the malformed recursor comes out of the kernel's own inductive-type elaborator; the reproducer is kept alongside it. * proj-of-stuck-prop: the same reduction decides the result sort of an inductive family, which is a `Prop` when checked under `_kernel_fresh.0` and stuck for the closed instantiation, so a `Bool` field can be projected out of a proposition that proof irrelevance applies to. Fixed by leanprover/lean4#14807, and its use of the cache by #14806. * proj-of-subst-prop: the same projection, but reached without any help from the defeq cache — `P := a = b` and `Q := a = c` are definitionally equal types whose proofs behave differently under `Eq.rec`, so an inductive family declared over `P` is a family of propositions while its instance at a proof of `Q` has a sort that does not reduce to `Prop`. Needs no axioms. Fixed by leanprover/lean4#14807. All three were accepted by the official kernel at v4.28.0, v4.29.1, v4.33.0 and nightly-2026-08-01, which also re-derives the broken declarations when replaying the export data. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013aD597ZqUV1XrMPdveoaKt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Definitional equality is not transitive on three
Acc.rec-based values: proofirrelevance relates
a ≡ bandb ≡ c, but nota ≡ c. Three ways to turnthat into
False:rec-missing-ih: in the affected kernels the defeq cache is a union-find
structure, i.e. it closes that relation transitively, but it is only consulted
for expressions with equal hashes. A crafted collision therefore makes a
K-like reduction fire in the pass that builds the minor premises of a recursor
and not in the pass that builds its rules, so the
stepminor premise takes aninduction hypothesis that its rule does not supply. Fixed by
fix: make kernel
is_def_eqcaching order-independent lean4#14806. Frozen as a static export file, since the malformedrecursor comes out of the kernel's own inductive-type elaborator; the
reproducer is kept alongside it.
proj-of-stuck-prop: the same reduction decides the result sort of an inductive
family, which is a
Propwhen checked under_kernel_fresh.0and stuck forthe closed instantiation, so a
Boolfield can be projected out of aproposition that proof irrelevance applies to. Fixed by fix: make the kernel
is_propcheck require a sort lean4#14807,and its use of the cache by #14806.
proj-of-subst-prop: the same projection, but reached without any help from the
defeq cache —
P := a = bandQ := a = care definitionally equal typeswhose proofs behave differently under
Eq.rec, so an inductive family declaredover
Pis a family of propositions while its instance at a proof ofQhas asort that does not reduce to
Prop. Needs no axioms. Fixed byfix: make the kernel
is_propcheck require a sort lean4#14807.All three were accepted by the official kernel at v4.28.0, v4.29.1, v4.33.0 and
nightly-2026-08-01, which also re-derives the broken declarations when replaying
the export data.
Co-Authored-By: Claude Opus 5 (1M context) [email protected]
Claude-Session: https://claude.ai/code/session_013aD597ZqUV1XrMPdveoaKt