Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Pxy48TaP92UgEq28KGm8BG
PR summary 27adedc5c9Import changes for modified filesNo significant changes to the import graph Import changes for all files
|
✅ PR Title Formatted CorrectlyThe title of this PR has been updated to match our commit style conventions. |
Function.Injective.extend_sum_inl_inr is proposed in leanprover-community/mathlib4#43325 (with a golfed LeftInverse proof, mirrored here) and the Std.Total (InvImage r f) instance in leanprover-community/mathlib4#43326; keeping the local copies private avoids conflicts when those land. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Pxy48TaP92UgEq28KGm8BG
Std.Total instance for InvImage
There was a problem hiding this comment.
Can you add the rest? Function.onFun has all of the instances, including the ones that require injectiveness, so we should translate all of those to both Order.Preimage and InvImage.
If you could generalize core's InvImage from Prop to any sort we'll also be able to deprecate the other two.
#mathlib4 > `Order.Preimage` vs `Function.onFun`
Definitely out of scope for today. :-) |
Personally, I think it is not a good idea to ask for scope creep in reviews. It slows everything down unnecessarily. Nevertheless, I'll do these now. |
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K9ZVGvAJNCKz5BBkUBFnyY
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K9ZVGvAJNCKz5BBkUBFnyY
|
bors merge Thanks! |
This PR fills in the transfer of unbundled relation classes along `InvImage` and `Order.Preimage`, so that both spellings carry everything `Function.onFun` already has. `InvImage` gains `Std.Refl`, `Std.Symm`, `Std.Asymm`, `Std.Total`, `IsPreorder`, `IsEquiv`, `IsStrictOrder` and `IsStrictWeakOrder` instances, along with `antisymm`, `trichotomous`, `isPartialOrder`, `isLinearOrder` and `isStrictTotalOrder` for injective `f`. (`Std.Irrefl` and `IsTrans` are already in `Mathlib/Order/Defs/Unbundled.lean`.) These are stated for `Sort`, matching core's `InvImage`. `Order.Preimage` gains the four injectivity lemmas `trichotomous`, `isPartialOrder`, `isLinearOrder` and `isStrictTotalOrder`. All of these are definitionally the `Function.onFun` versions, and are proved by `inferInstanceAs`, but instance search does not fire on goals stated with `InvImage` or `⁻¹'o` (and `InvImage` is how goals arise from `WellFoundedRelation`-adjacent and `Sum.Lex`-based constructions). Used in leanprover/cslib#401. ```lean example {α β : Type} (r : α → α → Prop) [Std.Total r] (f : β → α) : Std.Total (InvImage r f) := inferInstance ``` 🤖 Prepared with Claude Code
|
Pull request successfully merged into master. Build succeeded: |
Std.Total instance for InvImageStd.Total instance for InvImage
This PR fills in the transfer of unbundled relation classes along
InvImageandOrder.Preimage, so that both spellings carry everythingFunction.onFunalready has.InvImagegainsStd.Refl,Std.Symm,Std.Asymm,Std.Total,IsPreorder,IsEquiv,IsStrictOrderandIsStrictWeakOrderinstances, along withantisymm,trichotomous,isPartialOrder,isLinearOrderandisStrictTotalOrderfor injectivef. (Std.IrreflandIsTransare already inMathlib/Order/Defs/Unbundled.lean.) These are stated forSort, matching core'sInvImage.Order.Preimagegains the four injectivity lemmastrichotomous,isPartialOrder,isLinearOrderandisStrictTotalOrder.All of these are definitionally the
Function.onFunversions, and are proved byinferInstanceAs, but instance search does not fire on goals stated withInvImageor⁻¹'o(andInvImageis how goals arise fromWellFoundedRelation-adjacent andSum.Lex-based constructions). Used in leanprover/cslib#401.🤖 Prepared with Claude Code