Skip to content

Commit 99a5a6f

Browse files
committed
feat(Order/Monotone/Defs): weaken hypothesis of injective_of_le_imp_le (leanprover-community#33111)
`injective_of_le_imp_le` requires `∀ x y, f x ≤ f y → x ≤ y`, but `∀ x y, f x = f y → x ≤ y` is sufficient. Also rename the weakened`injective_of_le_imp_le` to `Function.Injective.of_eq_imp_le` and `injective_of_lt_imp_ne` to `Function.Injective.of_lt_imp_ne` to allow for dot notation.
1 parent c6513d0 commit 99a5a6f

8 files changed

Lines changed: 19 additions & 18 deletions

File tree

Archive/Imo/Imo1994Q1.lean

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,7 @@ theorem imo1994_q1 (n : ℕ) (m : ℕ) (A : Finset ℕ) (hm : #A = m + 1)
6969
by_contra! h : a k + a (rev k) < n + 1
7070
-- We exhibit `k+1` elements of `A` greater than `a (rev k)`
7171
set f : Fin (m + 1) ↪ ℕ :=
72-
fun i => a i + a (rev k), by
73-
apply injective_of_le_imp_le
74-
intro i j hij
75-
rwa [add_le_add_iff_right, a.map_rel_iff] at hij ⟩
72+
fun i => a i + a (rev k), .of_eq_imp_le (a.map_rel_iff.mp <| add_right_cancel · |>.le)⟩
7673
-- Proof that the `f i` are greater than `a (rev k)` for `i ≤ k`
7774
have hf : map f (Icc 0 k) ⊆ map a.toEmbedding (Ioc (rev k) (Fin.last m)) := by
7875
intro x hx

Archive/Wiedijk100Theorems/AscendingDescendingSequences.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ By combining the previous two lemmas, we see that since `f` is injective, the pa
120120
must also be unique.
121121
-/
122122
private lemma paired_injective (hf : Injective f) : Injective (paired f) := by
123-
apply injective_of_lt_imp_ne
123+
apply Injective.of_lt_imp_ne
124124
intro i j hij q
125125
cases lt_or_gt_of_ne (hf.ne hij.ne)
126126
case inl h => exact (maxIncSequencesTo_lt hij h).ne congr($q.1)

Mathlib/Algebra/Prime/Lemmas.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ theorem DvdNotUnit.ne [CancelCommMonoidWithZero M] {p q : M} (h : DvdNotUnit p q
163163

164164
theorem pow_injective_of_not_isUnit [CancelCommMonoidWithZero M] {q : M} (hq : ¬IsUnit q)
165165
(hq' : q ≠ 0) : Function.Injective fun n : ℕ => q ^ n := by
166-
refine injective_of_lt_imp_ne fun n m h => DvdNotUnit.ne ⟨pow_ne_zero n hq', q ^ (m - n), ?_, ?_⟩
166+
refine .of_lt_imp_ne fun n m h => DvdNotUnit.ne ⟨pow_ne_zero n hq', q ^ (m - n), ?_, ?_⟩
167167
· exact not_isUnit_of_not_isUnit_dvd hq (dvd_pow (dvd_refl _) (Nat.sub_pos_of_lt h).ne')
168168
· exact (pow_mul_pow_sub q h.le).symm
169169

Mathlib/Analysis/Convex/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ theorem Convex.semilinear_image {s : Set E} (hs : Convex 𝕜 s) (hσ : ∀ {s t
509509
obtain ⟨t, rfl⟩ : ∃ t : 𝕜, σ t = b := RingHomSurjective.is_surjective ..
510510
refine ⟨r • x + t • y, hs hx hy (by simp_all [(@hσ 0 r).mp]) (by simp_all [(@hσ 0 t).mp])
511511
?_, by simp⟩
512-
apply_fun σ using injective_of_le_imp_le _ hσ.mp
512+
apply_fun σ using Function.Injective.of_eq_imp_le (hσ.mp ·.le)
513513
simpa
514514

515515
end SemilinearMap

Mathlib/Data/Finset/Powerset.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ theorem powerset_mono {s t : Finset α} : powerset s ⊆ powerset t ↔ s ⊆ t
5959
mem_powerset.2 <| Subset.trans (mem_powerset.1 h) st⟩
6060

6161
theorem powerset_injective : Injective (powerset : Finset α → Finset (Finset α)) :=
62-
(injective_of_le_imp_le _) powerset_mono.1
62+
.of_eq_imp_le (powerset_mono.1 ·.le)
6363

6464
@[simp]
6565
theorem powerset_inj : powerset s = powerset t ↔ s = t :=

Mathlib/Order/Monotone/Defs.lean

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -318,17 +318,21 @@ theorem strictAnti_of_le_iff_le [Preorder α] [Preorder β] {f : α → β}
318318
(h : ∀ x y, x ≤ y ↔ f y ≤ f x) : StrictAnti f :=
319319
fun _ _ ↦ (lt_iff_lt_of_le_iff_le' (h _ _) (h _ _)).1
320320

321-
theorem injective_of_lt_imp_ne [LinearOrder α] {f : α → β} (h : ∀ x y, x < y → f x ≠ f y) :
321+
theorem Function.Injective.of_lt_imp_ne [LinearOrder α] {f : α → β} (h : ∀ x y, x < y → f x ≠ f y) :
322322
Injective f := by
323-
intro x y hf
324-
rcases lt_trichotomy x y with (hxy | rfl | hxy)
325-
· exact absurd hf <| h _ _ hxy
326-
· rfl
327-
· exact absurd hf.symm <| h _ _ hxy
323+
grind [Injective]
328324

325+
@[deprecated (since := "2025-12-23")]
326+
alias injective_of_lt_imp_ne := Function.Injective.of_lt_imp_ne
327+
328+
theorem Function.Injective.of_eq_imp_le [PartialOrder α] {f : α → β}
329+
(h : ∀ {x y}, f x = f y → x ≤ y) : f.Injective :=
330+
fun _ _ hxy ↦ h hxy |>.antisymm <| h hxy.symm
331+
332+
@[deprecated Injective.of_eq_imp_le (since := "2025-12-23")]
329333
theorem injective_of_le_imp_le [PartialOrder α] [Preorder β] (f : α → β)
330334
(h : ∀ {x y}, f x ≤ f y → x ≤ y) : Injective f :=
331-
fun _ _ hxy ↦ (h hxy.le).antisymm (h hxy.ge)
335+
.of_eq_imp_le (h ·.le)
332336

333337
/-! ### Monotonicity under composition -/
334338

Mathlib/RingTheory/Localization/Submodule.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ variable (S)
113113

114114
theorem coeSubmodule_injective (h : M ≤ nonZeroDivisors R) :
115115
Function.Injective (coeSubmodule S : Ideal R → Submodule R S) :=
116-
injective_of_le_imp_le _ fun hl => (coeSubmodule_le_coeSubmodule h).mp hl
116+
.of_eq_imp_le fun hl => (coeSubmodule_le_coeSubmodule h).mp hl.le
117117

118118
theorem coeSubmodule_isPrincipal {I : Ideal R} (h : M ≤ nonZeroDivisors R) :
119119
(coeSubmodule S I).IsPrincipal ↔ I.IsPrincipal := by
@@ -191,7 +191,7 @@ theorem coeSubmodule_strictMono : StrictMono (coeSubmodule K : Ideal R → Submo
191191
variable (R K)
192192

193193
theorem coeSubmodule_injective : Function.Injective (coeSubmodule K : Ideal R → Submodule R K) :=
194-
injective_of_le_imp_le _ fun hl => coeSubmodule_le_coeSubmodule.mp hl
194+
.of_eq_imp_le fun hl => coeSubmodule_le_coeSubmodule.mp hl.le
195195

196196
@[simp]
197197
theorem coeSubmodule_isPrincipal {I : Ideal R} : (coeSubmodule K I).IsPrincipal ↔ I.IsPrincipal :=

Mathlib/Topology/ClopenBox.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ lemma countable_iff_secondCountable [T2Space X]
8686
[TotallyDisconnectedSpace X] : Countable (Clopens X) ↔ SecondCountableTopology X := by
8787
refine ⟨fun h ↦ ⟨{s : Set X | IsClopen s}, ?_, ?_⟩, fun h ↦ ?_⟩
8888
· let f : {s : Set X | IsClopen s} → Clopens X := fun s ↦ ⟨s.1, s.2
89-
exact (injective_of_le_imp_le f fun a ↦ a).countable
89+
exact Injective.of_eq_imp_le (f := f) (·.le) |>.countable
9090
· apply IsTopologicalBasis.eq_generateFrom
9191
exact loc_compact_Haus_tot_disc_of_zero_dim
9292
· have : ∀ (s : Clopens X), ∃ (t : Finset (countableBasis X)), s.1 = (SetLike.coe t).sUnion :=

0 commit comments

Comments
 (0)