Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Pxy48TaP92UgEq28KGm8BG
PR summary f8c3dba6afImport changes for modified filesNo significant changes to the import graph Import changes for all files
|
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Pxy48TaP92UgEq28KGm8BG
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
| theorem Injective.extend_sum_inl_inr {α β : Type*} {f : α → β} (hf : Injective f) : | ||
| Injective (extend f (Sum.inl : α → α ⊕ β) (Sum.inr : β → α ⊕ β)) := by |
There was a problem hiding this comment.
Gemini suggests the more general result
theorem Injective.extend_of_disjoint {α β γ : Type*}
{f : α → β} {g : α → γ} {h : β → γ}
(hf : Injective f) (hg : Injective g) (hh : Injective h)
(hd : Disjoint (range g) (range h)) :
Injective (extend f g h) := byPer Eric's review, state the general result: `extend f g j` is injective when `f`, `g`, `j` are injective and `g`, `j` have disjoint ranges. `Disjoint` and `Set.range` are not available in `Mathlib/Logic/Function/Basic.lean` (they would be import cycles), so both lemmas live in `Mathlib/Data/Set/Restrict.lean` alongside `Injective.extend_injOn`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AjjWKN4JxeBhmHnUVY3mC5
| and everything else is sent to itself under `Sum.inr`. -/ | ||
| lemma _root_.Function.Injective.extend_sum_inl_inr {f : α → β} (hf : f.Injective) : | ||
| Injective (extend f (Sum.inl : α → α ⊕ β) (Sum.inr : β → α ⊕ β)) := | ||
| hf.extend_of_disjoint (fun _ _ ↦ Sum.inl.inj) (fun _ _ ↦ Sum.inr.inj) |
There was a problem hiding this comment.
nit: I think we have a lemma that directly proves injectivity.
Given that, i'd suggest just dropping this specialization entirely.
bors d+
|
✌️ kim-em can now approve this pull request until 2026-09-23 05:34 UTC (in 2 weeks). To approve and merge, reply with
|
Per Eric's review: the general `extend_of_disjoint` plus the existing injectivity lemmas for `Sum.inl`/`Sum.inr` prove the specialization directly, so it does not earn its place. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWf1KKiXXZSa2qQuWresw7
|
bors merge |
This PR adds `Function.Injective.extend_of_disjoint`: if `f : α → β`, `g : α → γ` and `j : β → γ` are injective and `g` and `j` have disjoint ranges, then `Function.extend f g j` is injective. It is used in leanprover/cslib#401 to build families of total orders for a comparison-sorting lower bound, via `Function.extend f Sum.inl Sum.inr : β → α ⊕ β`. 🤖 Prepared with Claude Code
|
Pull request successfully merged into master. Build succeeded: |
This PR adds
Function.Injective.extend_of_disjoint: iff : α → β,g : α → γandj : β → γare injective andgandjhave disjoint ranges, thenFunction.extend f g jis injective. It is used in leanprover/cslib#401 to build families of total orders for a comparison-sorting lower bound, viaFunction.extend f Sum.inl Sum.inr : β → α ⊕ β.🤖 Prepared with Claude Code