Skip to content

Commit 34b72a0

Browse files
RemyDegennemichaellee94
authored andcommitted
chore: generalize instPosPart to SubNegMonoid (leanprover-community#41247)
This PR generalizes the `OneLePart` and `LeOnePart` instances to `DivInvMonoid` instead of `Group`, and similarly for their additive versions. My goal is to have `PosPart` for `EReal`. Co-authored-by: Remy Degenne <remydegenne@gmail.com>
1 parent d3eb1db commit 34b72a0

1 file changed

Lines changed: 16 additions & 9 deletions

File tree

Mathlib/Algebra/Order/Group/PosPart.lean

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ variable {α : Type*}
4646
section Lattice
4747
variable [Lattice α]
4848

49-
section Group
50-
variable [Group α] {a b : α}
49+
section DivInvMonoid
50+
variable [DivInvMonoid α] {a b : α}
5151

5252
/-- The *positive part* of an element `a` in a lattice ordered group is `a ⊔ 1`, denoted `a⁺ᵐ`. -/
5353
@[to_additive
@@ -72,11 +72,11 @@ instance instLeOnePart : LeOnePart α where
7272

7373
@[to_additive (attr := simp high)] lemma oneLePart_one : (1 : α)⁺ᵐ = 1 := sup_idem _
7474

75-
@[to_additive (attr := simp)] lemma leOnePart_one : (1 : α)⁻ᵐ = 1 := by simp [leOnePart]
76-
77-
@[to_additive posPart_nonneg] lemma one_le_oneLePart (a : α) : 1 ≤ a⁺ᵐ := le_sup_right
75+
@[to_additive (attr := simp) posPart_nonneg]
76+
lemma one_le_oneLePart (a : α) : 1 ≤ a⁺ᵐ := le_sup_right
7877

79-
@[to_additive negPart_nonneg] lemma one_le_leOnePart (a : α) : 1 ≤ a⁻ᵐ := le_sup_right
78+
@[to_additive (attr := simp) negPart_nonneg]
79+
lemma one_le_leOnePart (a : α) : 1 ≤ a⁻ᵐ := le_sup_right
8080

8181
-- TODO: `to_additive` guesses `nonposPart`
8282
@[to_additive le_posPart] lemma le_oneLePart (a : α) : a ≤ a⁺ᵐ := le_sup_left
@@ -108,12 +108,19 @@ lemma leOnePart_le_one' : a⁻ᵐ ≤ 1 ↔ a⁻¹ ≤ 1 := by simp [leOnePart]
108108

109109
@[to_additive (attr := simp)] lemma oneLePart_inv (a : α) : a⁻¹⁺ᵐ = a⁻ᵐ := rfl
110110

111-
@[to_additive (attr := simp)] lemma leOnePart_inv (a : α) : a⁻¹⁻ᵐ = a⁺ᵐ := by
112-
simp [oneLePart, leOnePart]
113-
114111
@[to_additive] lemma oneLePart_max (a b : α) : (max a b)⁺ᵐ = max a⁺ᵐ b⁺ᵐ := by
115112
simp [oneLePart, sup_sup_distrib_right]
116113

114+
end DivInvMonoid
115+
116+
section Group
117+
variable [Group α] {a b : α}
118+
119+
@[to_additive (attr := simp)] lemma leOnePart_one : (1 : α)⁻ᵐ = 1 := by simp [leOnePart]
120+
121+
@[to_additive (attr := simp)] lemma leOnePart_inv (a : α) : a⁻¹⁻ᵐ = a⁺ᵐ := by
122+
simp [oneLePart, leOnePart]
123+
117124
section MulLeftMono
118125
variable [MulLeftMono α]
119126

0 commit comments

Comments
 (0)