Skip to content

Fix false Valid results from constructor proof fields - #223

Open
RSoulatIOHK wants to merge 2 commits into
beta-lambda-cache-optimizationfrom
fix/beta-proof-irrelevance
Open

Fix false Valid results from constructor proof fields#223
RSoulatIOHK wants to merge 2 commits into
beta-lambda-cache-optimizationfrom
fix/beta-proof-irrelevance

Conversation

@RSoulatIOHK

@RSoulatIOHK RSoulatIOHK commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Constructor equality can report a false theorem as Valid when structures have proof fields. For example, ProofBox.mk 7 (Or.inl True.intro) ≠ ProofBox.mk 7 (Or.inr True.intro) reduced to True, although Lean proves the equality by rfl.

Treat proof fields as equal before comparing constructor tags, and consume a successful structural comparison so values differing only in proofs simplify to equality. Ordinary data fields still distinguish constructors. The same issue is covered inside lists.

Validation:

  • Reproduced the false Valid result on beta bafdd4f7.
  • Added a kernel-checked rfl witness, five optimizer regressions, and two negative solver regressions requiring Falsified.
  • lake build Blaster Tests.FixedIssues.Issue225 passed.
  • lake build Tests.Optimize passed (449 build jobs).

This PR targets beta-lambda-cache-optimization and is the first soundness fix from the branch review.

Fixes #225. Regression: Tests/FixedIssues/Issue225.lean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant