fix(Tactic/Simps): skip @[defeq] inference for non-exposed definitions
This PR makes @[simps] check whether the source definition's body is exposed before calling inferDefEqAttr. When the body is not exposed, we skip the @[defeq] inference to avoid validation errors.
Without this fix, using @[simps] on a definition that is not @[expose]d produces an error like:
Theorem Foo_bar has a `rfl`-proof and was thus inferred to be `@[defeq]`, but validating that attribute failed:
Not a definitional equality: the left-hand side ... is not definitionally equal to the right-hand side ...
Note: This theorem is exported from the current module. This requires that all definitions that need to be unfolded to prove this theorem must be exposed.
The fix checks (← getEnv).setExporting true |>.find? cfg.srcDeclName |>.any (·.hasValue) to determine if the definition body is visible in the public scope, and only calls inferDefEqAttr if it is.
🤖 Prepared with Claude Code
PR summary 87b2aabda3
Import changes for modified files
No significant changes to the import graph
Import changes for all files
| Files | Import difference |
|---|
Declarations diff
+ MyStruct
+ helperVal
+ myDef
You can run this locally as follows
## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>
## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>
The doc-module for script/declarations_diff.sh contains some details about this script.
No changes to technical debt.
You can run this locally as
./scripts/technical-debt-metrics.sh pr_summary
- The
relativevalue is the weighted sum of the differences with weight given by the inverse of the current value of the statistic. - The
absolutevalue is therelativevalue divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).
Now you don't need the srcDeclName field anymore right?
The test file is not currently a module. So I don't see how it is testing what it says it is testing.
The test file is not currently a module. So I don't see how it is testing what it says it is testing.
Indeed, thanks. Fixed now.
I copy-pasted the test file into the web editor, and it successfully build. Maybe you meant to add public section to the test file?