Commit 2026-11-19 02:17 d33c49ca

View on Github →

feat: lint against numeric projections (#45341) This PR lints against numeric structure projections such as foo.42, and interactively suggests replacing them with the appropriate field name projection instead. This was discussed on Zulip. Structures may be exempted from the linter and permitted to use numeric projections by either attaching @[allow_numeric_proj] to the structure at the point it was defined, or by hardcoding them into the linter's list of exceptions (if they were defined upstream). This PR allows terms whose types begin with

Prod, PProd, Sigma, PSigma, And, Subtype, Fin, Complex, Quaternion

to use numeric projections. This also allows type definitions wrapping these types to use numeric projections, as only the projection itself is looked at. (This may be changed in the future.) However, note that Subtype and Fin will be non-exempted shortly. We also update the Archive and Counterexamples. Disclosure: although I don't use Claude to write important code, it so happened that Claude edited a key part of the file without being asked, after simply being asked to locate certain API(!). However, the resulting changes were sensible, so I've retained them. Claude also (this time on request!) assisted with testing the many situations in which numeric projections can appear.

Estimated changes

added structure Bar
added structure Fn
added structure Foo
added inductive Ind
added def MyAnd
added def MyBar
added def MyFn
added def MySubtype
added def withAux