lean4-htt/tests/pkg/module/Module
Joachim Breitner f9dc77673b
feat: dedicated fix operator for well-founded recursion on Nat (#7965)
This PR lets recursive functions defined by well-founded recursion use a
different `fix` function when the termination measure is of type `Nat`.
This fix-point operator use structural recursion on “fuel”, initialized
by the given measure, and is thus reasonable to reduce, e.g. in `by
decide` proofs.

Extra provisions are in place that the fixpoint operator only starts
reducing when the fuel is fully known, to prevent “accidential” defeqs
when the remaining fuel for the recursive calls match the initial fuel
for that recursive argument.

To opt-out, the idiom `termination_by (n,0)` can be used.

We still use `@[irreducible]` as the default for such recursive
definitions, to avoid unexpected `defeq` lemmas. Making these functions
`@[semireducible]` by default showed performance regressions in lean.
When the measure is of type `Nat`, the system will accept an explicit
`@[semireducible]` without the usual warning.

Fixes #5234. Fixes: #11181.
2025-12-01 12:51:55 +00:00
..
Basic.lean feat: dedicated fix operator for well-founded recursion on Nat (#7965) 2025-12-01 12:51:55 +00:00
Basic2.lean fix: import-merging theorems under the module system (#10556) 2025-09-26 13:02:51 +00:00
ConflictingImported.lean fix: import-merging theorems under the module system (#10556) 2025-09-26 13:02:51 +00:00
Imported.lean feat: improve error message in the case of type class synthesis failure (#11245) 2025-11-21 21:24:27 +00:00
ImportedAll.lean feat: dedicated fix operator for well-founded recursion on Nat (#7965) 2025-12-01 12:51:55 +00:00
ImportedAllImportedAll.lean fix: privacy checks and import all (#10550) 2025-09-26 13:26:10 +00:00
ImportedAllPrivateImported.lean chore: avoid confusing public import all combination (#10051) 2025-08-22 12:04:42 +00:00
ImportedImportedAll.lean feat: make private the default in module (#9044) 2025-06-28 16:30:53 +00:00
ImportedPrivateImported.lean chore: even more module system fixes and refinements from Mathlib porting (#10726) 2025-10-15 14:59:09 +00:00
MetaImported.lean fix: detect private references in inferred type of public def (#10762) 2025-10-15 12:51:54 +00:00
NonModule.lean feat: dedicated fix operator for well-founded recursion on Nat (#7965) 2025-12-01 12:51:55 +00:00
PrivateImported.lean chore: even more module system fixes and refinements from Mathlib porting (#10726) 2025-10-15 14:59:09 +00:00