Skip to content

Commit 4609a29

Browse files
committed
chore(Algebra/Order): generalise ordered algebra lemmas (#37040)
* Generalise lemmas from ordered algebras to ordered modules + mixins
1 parent 62ba019 commit 4609a29

File tree

2 files changed

+39
-25
lines changed

2 files changed

+39
-25
lines changed

Mathlib/Algebra/Order/Algebra.lean

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -39,47 +39,48 @@ public section
3939

4040
variable {α β : Type*} [CommSemiring α] [PartialOrder α] [Semiring β] [PartialOrder β] [Algebra α β]
4141

42-
section OrderedSemiring
43-
variable (β) [IsOrderedRing β] [SMulPosMono α β] {a : α}
42+
section ZeroLEOneClass
43+
variable [ZeroLEOneClass β]
4444

45-
@[gcongr, mono] lemma algebraMap_mono : Monotone (algebraMap α β) :=
46-
fun a₁ a₂ ha ↦ by
47-
simpa only [Algebra.algebraMap_eq_smul_one] using smul_le_smul_of_nonneg_right ha zero_le_one
45+
section SMulPosMono
46+
variable (β) [SMulPosMono α β]
4847

49-
lemma algebraMap_nonneg (ha : 0 ≤ a) : 0 ≤ algebraMap α β a := by simpa using algebraMap_mono β ha
48+
@[gcongr, mono]
49+
lemma algebraMap_mono : Monotone (algebraMap α β) := by
50+
simpa [Algebra.smul_def] using smul_one_mono (α := α) β
5051

51-
end OrderedSemiring
52+
lemma algebraMap_nonneg {a : α} (ha : 0 ≤ a) : 0 ≤ algebraMap α β a := by
53+
simpa using algebraMap_mono β ha
5254

53-
section StrictOrderedSemiring
54-
variable [IsStrictOrderedRing β]
55+
end SMulPosMono
5556

56-
section SMulPosMono
57-
variable [SMulPosMono α β] [SMulPosReflectLE α β] {a₁ a₂ : α}
57+
section Nontrivial
58+
variable [Nontrivial β]
5859

59-
@[simp] lemma algebraMap_le_algebraMap : algebraMap α β a₁ ≤ algebraMap α β a₂ ↔ a₁ ≤ a₂ := by
60+
@[simp]
61+
lemma algebraMap_le_algebraMap [SMulPosMono α β] [SMulPosReflectLE α β] {a₁ a₂ : α} :
62+
algebraMap α β a₁ ≤ algebraMap α β a₂ ↔ a₁ ≤ a₂ := by
6063
simp [Algebra.algebraMap_eq_smul_one]
6164

62-
end SMulPosMono
63-
6465
section SMulPosStrictMono
65-
variable [SMulPosStrictMono α β] {a a₁ a₂ : α}
66-
variable (β)
66+
variable (β) [SMulPosStrictMono α β]
6767

68-
@[gcongr, mono] lemma algebraMap_strictMono : StrictMono (algebraMap α β) :=
69-
fun a₁ a₂ ha ↦ by
70-
simpa only [Algebra.algebraMap_eq_smul_one] using smul_lt_smul_of_pos_right ha zero_lt_one
68+
@[gcongr, mono]
69+
lemma algebraMap_strictMono : StrictMono (algebraMap α β) := by
70+
simpa [Algebra.smul_def] using smul_one_strictMono (α := α) β
7171

72-
lemma algebraMap_pos (ha : 0 < a) : 0 < algebraMap α β a := by
72+
lemma algebraMap_pos {a : α} (ha : 0 < a) : 0 < algebraMap α β a := by
7373
simpa using algebraMap_strictMono β ha
7474

75-
variable {β}
76-
variable [SMulPosReflectLT α β]
77-
78-
@[simp] lemma algebraMap_lt_algebraMap : algebraMap α β a₁ < algebraMap α β a₂ ↔ a₁ < a₂ := by
75+
variable {β} in
76+
@[simp]
77+
lemma algebraMap_lt_algebraMap [SMulPosReflectLT α β] {a₁ a₂ : α} :
78+
algebraMap α β a₁ < algebraMap α β a₂ ↔ a₁ < a₂ := by
7979
simp [Algebra.algebraMap_eq_smul_one]
8080

8181
end SMulPosStrictMono
82-
end StrictOrderedSemiring
82+
end Nontrivial
83+
end ZeroLEOneClass
8384

8485
namespace Mathlib.Meta.Positivity
8586
open Lean Meta Qq Function

Mathlib/Algebra/Order/Module/Defs.lean

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,12 @@ lemma strictMono_smul_right_of_pos [SMulPosStrictMono α β] (hb : 0 < b) :
360360
@[gcongr] lemma smul_le_smul_of_nonneg_right [SMulPosMono α β] (ha : a₁ ≤ a₂) (hb : 0 ≤ b) :
361361
a₁ • b ≤ a₂ • b := monotone_smul_right_of_nonneg hb ha
362362

363+
variable (β) in
364+
@[gcongr, mono]
365+
lemma smul_one_mono [One β] [ZeroLEOneClass β] [SMulPosMono α β] :
366+
Monotone (fun x : α ↦ x • (1 : β)) :=
367+
fun _ _ ha ↦ smul_le_smul_of_nonneg_right ha zero_le_one
368+
363369
@[gcongr] lemma smul_lt_smul_of_pos_right [SMulPosStrictMono α β] (ha : a₁ < a₂) (hb : 0 < b) :
364370
a₁ • b < a₂ • b := strictMono_smul_right_of_pos hb ha
365371

@@ -422,6 +428,13 @@ lemma smul_le_smul' [PosSMulMono α β] [SMulPosMono α β] (ha : a₁ ≤ a₂)
422428
end LeftRight
423429
end Preorder
424430

431+
variable (β) in
432+
@[gcongr, mono]
433+
lemma smul_one_strictMono [Preorder α] [PartialOrder β] [Zero β] [One β] [ZeroLEOneClass β]
434+
[NeZero (1 : β)] [SMulPosStrictMono α β] :
435+
StrictMono (fun x : α ↦ x • (1 : β)) :=
436+
fun _ _ ha ↦ smul_lt_smul_of_pos_right ha (zero_lt_one (α := β))
437+
425438
section PartialOrder
426439
variable [Semiring α] [PartialOrder α]
427440

0 commit comments

Comments
 (0)