Skip to content

Commit 0acb8be

Browse files
committed
chore: rename Injective.sum_elim and friends (#22129)
Per the naming convention, they should be written `sumElim`, etc.
1 parent b2b26f1 commit 0acb8be

File tree

8 files changed

+23
-15
lines changed

8 files changed

+23
-15
lines changed

Mathlib/Data/Countable/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ variable {α : Type u} {β : Type v} {π : α → Type w}
5959
instance [Countable α] [Countable β] : Countable (α ⊕ β) := by
6060
rcases exists_injective_nat α with ⟨f, hf⟩
6161
rcases exists_injective_nat β with ⟨g, hg⟩
62-
exact (Equiv.natSumNatEquivNat.injective.comp <| hf.sum_map hg).countable
62+
exact (Equiv.natSumNatEquivNat.injective.comp <| hf.sumMap hg).countable
6363

6464
instance Sum.uncountable_inl [Uncountable α] : Uncountable (α ⊕ β) :=
6565
inl_injective.uncountable

Mathlib/Data/Sum/Basic.lean

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -165,19 +165,23 @@ open Sum
165165

166166
namespace Function
167167

168-
theorem Injective.sum_elim {f : α → γ} {g : β → γ} (hf : Injective f) (hg : Injective g)
168+
theorem Injective.sumElim {f : α → γ} {g : β → γ} (hf : Injective f) (hg : Injective g)
169169
(hfg : ∀ a b, f a ≠ g b) : Injective (Sum.elim f g)
170170
| inl _, inl _, h => congr_arg inl <| hf h
171171
| inl _, inr _, h => (hfg _ _ h).elim
172172
| inr _, inl _, h => (hfg _ _ h.symm).elim
173173
| inr _, inr _, h => congr_arg inr <| hg h
174174

175-
theorem Injective.sum_map {f : α → β} {g : α' → β'} (hf : Injective f) (hg : Injective g) :
175+
@[deprecated (since := "2025-02-20")] alias Injective.sum_elim := Injective.sumElim
176+
177+
theorem Injective.sumMap {f : α → β} {g : α' → β'} (hf : Injective f) (hg : Injective g) :
176178
Injective (Sum.map f g)
177179
| inl _, inl _, h => congr_arg inl <| hf <| inl.inj h
178180
| inr _, inr _, h => congr_arg inr <| hg <| inr.inj h
179181

180-
theorem Surjective.sum_map {f : α → β} {g : α' → β'} (hf : Surjective f) (hg : Surjective g) :
182+
@[deprecated (since := "2025-02-20")] alias Injective.sum_map := Injective.sumMap
183+
184+
theorem Surjective.sumMap {f : α → β} {g : α' → β'} (hf : Surjective f) (hg : Surjective g) :
181185
Surjective (Sum.map f g)
182186
| inl y =>
183187
let ⟨x, hx⟩ := hf y
@@ -186,9 +190,13 @@ theorem Surjective.sum_map {f : α → β} {g : α' → β'} (hf : Surjective f)
186190
let ⟨x, hx⟩ := hg y
187191
⟨inr x, congr_arg inr hx⟩
188192

189-
theorem Bijective.sum_map {f : α → β} {g : α' → β'} (hf : Bijective f) (hg : Bijective g) :
193+
@[deprecated (since := "2025-02-20")] alias Surjective.sum_map := Surjective.sumMap
194+
195+
theorem Bijective.sumMap {f : α → β} {g : α' → β'} (hf : Bijective f) (hg : Bijective g) :
190196
Bijective (Sum.map f g) :=
191-
⟨hf.injective.sum_map hg.injective, hf.surjective.sum_map hg.surjective⟩
197+
⟨hf.injective.sumMap hg.injective, hf.surjective.sumMap hg.surjective⟩
198+
199+
@[deprecated (since := "2025-02-20")] alias Bijective.sum_map := Bijective.sumMap
192200

193201
end Function
194202

@@ -202,7 +210,7 @@ theorem map_injective {f : α → γ} {g : β → δ} :
202210
fun h =>
203211
fun a₁ a₂ ha => inl_injective <| @h (inl a₁) (inl a₂) (congr_arg inl ha :), fun b₁ b₂ hb =>
204212
inr_injective <| @h (inr b₁) (inr b₂) (congr_arg inr hb :)⟩,
205-
fun h => h.1.sum_map h.2
213+
fun h => h.1.sumMap h.2
206214

207215
@[simp]
208216
theorem map_surjective {f : α → γ} {g : β → δ} :
@@ -216,7 +224,7 @@ theorem map_surjective {f : α → γ} {g : β → δ} :
216224
obtain ⟨a | b, h⟩ := h (inr d)
217225
· cases h
218226
· exact ⟨b, inr_injective h⟩)⟩,
219-
fun h => h.1.sum_map h.2
227+
fun h => h.1.sumMap h.2
220228

221229
@[simp]
222230
theorem map_bijective {f : α → γ} {g : β → δ} :

Mathlib/Logic/Embedding/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ open Sum
258258

259259
/-- If `e₁` and `e₂` are embeddings, then so is `Sum.map e₁ e₂`. -/
260260
def sumMap {α β γ δ : Type*} (e₁ : α ↪ β) (e₂ : γ ↪ δ) : α ⊕ γ ↪ β ⊕ δ :=
261-
⟨Sum.map e₁ e₂, e₁.injective.sum_map e₂.injective⟩
261+
⟨Sum.map e₁ e₂, e₁.injective.sumMap e₂.injective⟩
262262

263263
@[simp]
264264
theorem coe_sumMap {α β γ δ} (e₁ : α ↪ β) (e₂ : γ ↪ δ) : sumMap e₁ e₂ = Sum.map e₁ e₂ :=

Mathlib/Order/RelIso/Basic.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ def sumLiftRelInr (r : α → α → Prop) (s : β → β → Prop) : s ↪r Sum
469469
@[simps]
470470
def sumLiftRelMap (f : r ↪r s) (g : t ↪r u) : Sum.LiftRel r t ↪r Sum.LiftRel s u where
471471
toFun := Sum.map f g
472-
inj' := f.injective.sum_map g.injective
472+
inj' := f.injective.sumMap g.injective
473473
map_rel_iff' := by rintro (a | b) (c | d) <;> simp [f.map_rel_iff, g.map_rel_iff]
474474

475475
/-- `Sum.inl` as a relation embedding into `Sum.Lex r s`. -/
@@ -490,7 +490,7 @@ def sumLexInr (r : α → α → Prop) (s : β → β → Prop) : s ↪r Sum.Lex
490490
@[simps]
491491
def sumLexMap (f : r ↪r s) (g : t ↪r u) : Sum.Lex r t ↪r Sum.Lex s u where
492492
toFun := Sum.map f g
493-
inj' := f.injective.sum_map g.injective
493+
inj' := f.injective.sumMap g.injective
494494
map_rel_iff' := by rintro (a | b) (c | d) <;> simp [f.map_rel_iff, g.map_rel_iff]
495495

496496
/-- `fun b ↦ Prod.mk a b` as a relation embedding. -/

Mathlib/RingTheory/AlgebraicIndependent/Transcendental.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ theorem adjoin_of_disjoint {s t : Set ι} (h : Disjoint s t) :
119119
rw [Set.image_eq_range, AlgebraicIndependent, ← AlgHom.coe_restrictScalars' R, ← e.injective_comp]
120120
show Injective ((AlgHom.restrictScalars R <| aeval _).comp e.toAlgHom)
121121
rw [this, AlgHom.coe_comp]
122-
exact .comp hx (rename_injective _ <| Subtype.val_injective.sum_elim
122+
exact .comp hx (rename_injective _ <| Subtype.val_injective.sumElim
123123
Subtype.val_injective fun i j eq ↦ h.ne_of_mem j.2 i.2 eq.symm)
124124

125125
theorem adjoin_iff_disjoint [Nontrivial A] {s t : Set ι} :

Mathlib/RingTheory/Smooth/StandardSmooth.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ this is the canonical pre-submersive presentation of `T` as an `R`-algebra. -/
250250
noncomputable def comp : PreSubmersivePresentation R T where
251251
__ := Q.toPresentation.comp P.toPresentation
252252
map := Sum.elim (fun rq ↦ Sum.inl <| Q.map rq) (fun rp ↦ Sum.inr <| P.map rp)
253-
map_inj := Function.Injective.sum_elim ((Sum.inl_injective).comp (Q.map_inj))
253+
map_inj := Function.Injective.sumElim ((Sum.inl_injective).comp (Q.map_inj))
254254
((Sum.inr_injective).comp (P.map_inj)) <| by simp
255255
relations_finite := inferInstanceAs <| Finite (Q.rels ⊕ P.rels)
256256

Mathlib/Topology/Category/Profinite/Nobeling.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1407,7 +1407,7 @@ def sum_to : (GoodProducts (π C (ord I · < o))) ⊕ (MaxProducts C ho) → Pro
14071407
Sum.elim Subtype.val Subtype.val
14081408

14091409
theorem injective_sum_to : Function.Injective (sum_to C ho) := by
1410-
refine Function.Injective.sum_elim Subtype.val_injective Subtype.val_injective
1410+
refine Function.Injective.sumElim Subtype.val_injective Subtype.val_injective
14111411
(fun ⟨a,ha⟩ ⟨b,hb⟩ ↦ (fun (hab : a = b) ↦ ?_))
14121412
rw [← hab] at hb
14131413
have ha' := Products.prop_of_isGood C _ ha (term I ho) hb.2

Mathlib/Topology/Homeomorph.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,7 @@ lemma IsHomeomorph.comp {g : Y → Z} (hg : IsHomeomorph g) (hf : IsHomeomorph f
10731073
IsHomeomorph (g ∘ f) := ⟨hg.1.comp hf.1, hg.2.comp hf.2, hg.3.comp hf.3
10741074

10751075
lemma IsHomeomorph.sumMap {g : Z → W} (hf : IsHomeomorph f) (hg : IsHomeomorph g) :
1076-
IsHomeomorph (Sum.map f g) := ⟨hf.1.sum_map hg.1, hf.2.sumMap hg.2, hf.3.sum_map hg.3
1076+
IsHomeomorph (Sum.map f g) := ⟨hf.1.sum_map hg.1, hf.2.sumMap hg.2, hf.3.sumMap hg.3
10771077

10781078
lemma IsHomeomorph.prodMap {g : Z → W} (hf : IsHomeomorph f) (hg : IsHomeomorph g) :
10791079
IsHomeomorph (Prod.map f g) := ⟨hf.1.prodMap hg.1, hf.2.prodMap hg.2, hf.3.prodMap hg.3

0 commit comments

Comments
 (0)