[Merged by Bors] - feat: add reduce_mod_char! variant that searches through hypotheses#11478
[Merged by Bors] - feat: add reduce_mod_char! variant that searches through hypotheses#11478Vierkantor wants to merge 2 commits intomasterfrom
reduce_mod_char! variant that searches through hypotheses#11478Conversation
I won't have a lot of time to work on this PR until April, so please feel free to take it over before then. I initially wanted to use `synthInstance` rather than `findLocalDeclWithType?` but because `n` is not an outParam in `CharP R n`, the typeclass system won't work unless we know the value of `n` already. Perhaps `findLocalDeclWithType?` is cheap enough to make this part of standard `reduce_mod_char` behaviour. I'd like to profile our usecases to find out if indeed this holds when expressions become much more complicated. Zulip thread: https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/reduce_mod_char.20doesn't.20work
|
How expensive is expensive? I know you said it saves some time in your test cases but I really wonder if we might want the expensive version to be the default, especially if the only users of reduce mod char are real users. |
|
@Vierkantor this PR looks good to me! I'm fine merging with this behavior as optional for now, since maybe a proper performance comparison isn't on anyone's radar. It seems helpful to get the new behavior on master. Maybe we could make a tracking issue for changing the default. bors d+ |
|
✌️ Vierkantor can now approve this pull request. To approve and merge a pull request, simply reply with |
PR summary 1b64ccc5acImport changesNo significant changes to the import graph Declarations diff
You can run this locally as follows## summary with just the declaration names:
./scripts/no_lost_declarations.sh short <optional_commit>
## more verbose report:
./scripts/no_lost_declarations.sh <optional_commit> |
|
bors merge |
…#11478) I won't have a lot of time to work on this PR until April, so please feel free to take it over before then. I initially wanted to use `synthInstance` rather than `findLocalDeclWithType?` but because `n` is not an outParam in `CharP R n`, the typeclass system won't work unless we know the value of `n` already. Perhaps `findLocalDeclWithType?` is cheap enough to make this part of standard `reduce_mod_char` behaviour. I'd like to profile our usecases to find out if indeed this holds when expressions become much more complicated. Zulip thread: https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/reduce_mod_char.20doesn't.20work Co-authored-by: Rob Lewis <Rob.y.lewis@gmail.com>
|
Pull request successfully merged into master. Build succeeded: |
reduce_mod_char! variant that searches through hypothesesreduce_mod_char! variant that searches through hypotheses
…#11478) I won't have a lot of time to work on this PR until April, so please feel free to take it over before then. I initially wanted to use `synthInstance` rather than `findLocalDeclWithType?` but because `n` is not an outParam in `CharP R n`, the typeclass system won't work unless we know the value of `n` already. Perhaps `findLocalDeclWithType?` is cheap enough to make this part of standard `reduce_mod_char` behaviour. I'd like to profile our usecases to find out if indeed this holds when expressions become much more complicated. Zulip thread: https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/reduce_mod_char.20doesn't.20work Co-authored-by: Rob Lewis <Rob.y.lewis@gmail.com>
…#11478) I won't have a lot of time to work on this PR until April, so please feel free to take it over before then. I initially wanted to use `synthInstance` rather than `findLocalDeclWithType?` but because `n` is not an outParam in `CharP R n`, the typeclass system won't work unless we know the value of `n` already. Perhaps `findLocalDeclWithType?` is cheap enough to make this part of standard `reduce_mod_char` behaviour. I'd like to profile our usecases to find out if indeed this holds when expressions become much more complicated. Zulip thread: https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/reduce_mod_char.20doesn't.20work Co-authored-by: Rob Lewis <Rob.y.lewis@gmail.com>
…#11478) I won't have a lot of time to work on this PR until April, so please feel free to take it over before then. I initially wanted to use `synthInstance` rather than `findLocalDeclWithType?` but because `n` is not an outParam in `CharP R n`, the typeclass system won't work unless we know the value of `n` already. Perhaps `findLocalDeclWithType?` is cheap enough to make this part of standard `reduce_mod_char` behaviour. I'd like to profile our usecases to find out if indeed this holds when expressions become much more complicated. Zulip thread: https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/reduce_mod_char.20doesn't.20work Co-authored-by: Rob Lewis <Rob.y.lewis@gmail.com>
I won't have a lot of time to work on this PR until April, so please feel free to take it over before then.
I initially wanted to use
synthInstancerather thanfindLocalDeclWithType?but becausenis not an outParam inCharP R n, the typeclass system won't work unless we know the value ofnalready.Perhaps
findLocalDeclWithType?is cheap enough to make this part of standardreduce_mod_charbehaviour. I'd like to profile our usecases to find out if indeed this holds when expressions become much more complicated.Zulip thread: https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/reduce_mod_char.20doesn't.20work