Commit 7f91998
feat: overlapping instances linter (leanprover-community#38126)
This PR implements the overlapping instances linter, with better performance than the previous attempt.
The overlapping instances linter warns on data-carrying overlaps between instances in the local context of a declaration, as well as on redundant instances of `Prop` classes (i.e. those which can be synthesized from another instance in the context).
An annoyance is the need for `withSetBoolOptionIn`. This is a private declaration in the `unusedInstancesInType` linter, with a link to leanprover/lean4#13133, which has been merged. When that commit lands in mathlib, we should move to `withSetOptionIn`.
See leanprover-community#35095 and leanprover-community#33677 for previous iterations of this linter.
See leanprover-community#14731 for an old attempt at a weaker form of this linter.
Co-authored-by: @thorimur
Co-authored-by: thorimur <68410468+thorimur@users.noreply.github.com>1 parent d99b0d9 commit 7f91998
68 files changed
Lines changed: 777 additions & 51 deletions
File tree
- MathlibTest
- Tactic/NormNum
- Mathlib
- Algebra
- Category/Ring
- Colimit
- Homology
- Module
- Equiv
- Order
- Antidiag
- Polynomial
- Star
- Analysis
- CStarAlgebra
- Convex
- Fourier/FiniteAbelian
- Normed/Field
- SpecialFunctions/ContinuousFunctionalCalculus/Rpow
- SpecificLimits
- CategoryTheory
- Localization
- Monoidal/Closed
- MorphismProperty
- Triangulated
- Control
- FieldTheory/Normal
- GroupTheory/OreLocalization
- Lean/Elab
- LinearAlgebra
- BilinearForm
- Eigenspace
- RootSystem
- Finite
- GeckConstruction
- SesquilinearForm
- Logic
- MeasureTheory
- Function/ConditionalExpectation
- Measure/Haar
- NumberTheory
- ClassNumber
- NumberField/InfinitePlace
- RamificationInertia
- RingTheory
- DedekindDomain
- Ideal
- DiscreteValuationRing
- FractionalIdeal
- HahnSeries
- Ideal/Norm
- LocalRing/ResidueField
- Valuation
- Tactic
- Linter
- NormNum
- Topology
- Algebra
- Nonarchimedean
- Connected
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7239 | 7239 | | |
7240 | 7240 | | |
7241 | 7241 | | |
| 7242 | + | |
7242 | 7243 | | |
7243 | 7244 | | |
7244 | 7245 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
376 | 376 | | |
377 | 377 | | |
378 | 378 | | |
| 379 | + | |
379 | 380 | | |
380 | 381 | | |
381 | 382 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
833 | 833 | | |
834 | 834 | | |
835 | 835 | | |
836 | | - | |
837 | | - | |
| 836 | + | |
| 837 | + | |
838 | 838 | | |
839 | 839 | | |
840 | 840 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
33 | 31 | | |
34 | 32 | | |
35 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
| 299 | + | |
299 | 300 | | |
300 | 301 | | |
301 | 302 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
194 | | - | |
| 194 | + | |
| 195 | + | |
195 | 196 | | |
196 | 197 | | |
197 | 198 | | |
198 | 199 | | |
199 | 200 | | |
200 | | - | |
| 201 | + | |
201 | 202 | | |
202 | 203 | | |
203 | 204 | | |
204 | 205 | | |
205 | 206 | | |
206 | 207 | | |
207 | | - | |
| 208 | + | |
208 | 209 | | |
209 | 210 | | |
210 | 211 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
80 | 81 | | |
81 | 82 | | |
82 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
| 44 | + | |
46 | 45 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
789 | 789 | | |
790 | 790 | | |
791 | 791 | | |
792 | | - | |
| 792 | + | |
793 | 793 | | |
794 | 794 | | |
795 | 795 | | |
| |||
0 commit comments