Skip to content

Commit d11e0f3

Browse files
committed
feat: port Algebra.Order.Invertible (#1006)
ee0c179cd3c8a45aa5bffbf1b41d8dbede452865
1 parent d1e1c99 commit d11e0f3

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ import Mathlib.Algebra.Order.Group.Units
6464
import Mathlib.Algebra.Order.Group.WithTop
6565
import Mathlib.Algebra.Order.Hom.Basic
6666
import Mathlib.Algebra.Order.Hom.Monoid
67+
import Mathlib.Algebra.Order.Invertible
6768
import Mathlib.Algebra.Order.Monoid.Basic
6869
import Mathlib.Algebra.Order.Monoid.Cancel.Basic
6970
import Mathlib.Algebra.Order.Monoid.Cancel.Defs
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/-
2+
Copyright (c) 2021 Yury G. Kudryashov. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Yury G. Kudryashov
5+
-/
6+
import Mathlib.Algebra.Order.Ring.Defs
7+
import Mathlib.Algebra.Invertible
8+
9+
/-!
10+
# Lemmas about `inv_of` in ordered (semi)rings.
11+
-/
12+
13+
variable [LinearOrderedSemiring α] {a : α}
14+
15+
@[simp]
16+
theorem invOf_pos [Invertible a] : 0 < ⅟ a ↔ 0 < a :=
17+
haveI : 0 < a * ⅟ a := by simp only [mul_invOf_self, zero_lt_one]
18+
fun h => pos_of_mul_pos_left this h.le, fun h => pos_of_mul_pos_right this h.le⟩
19+
#align inv_of_pos invOf_pos
20+
21+
@[simp]
22+
theorem invOf_nonpos [Invertible a] : ⅟ a ≤ 0 ↔ a ≤ 0 := by simp only [← not_lt, invOf_pos]; rfl
23+
#align inv_of_nonpos invOf_nonpos
24+
25+
@[simp]
26+
theorem invOf_nonneg [Invertible a] : 0 ≤ ⅟ a ↔ 0 ≤ a :=
27+
haveI : 0 < a * ⅟ a := by simp only [mul_invOf_self, zero_lt_one]
28+
fun h => (pos_of_mul_pos_left this h).le, fun h => (pos_of_mul_pos_right this h).le⟩
29+
#align inv_of_nonneg invOf_nonneg
30+
31+
@[simp]
32+
theorem invOf_lt_zero [Invertible a] : ⅟ a < 0 ↔ a < 0 := by simp only [← not_le, invOf_nonneg]; rfl
33+
#align inv_of_lt_zero invOf_lt_zero
34+
35+
@[simp]
36+
theorem invOf_le_one [Invertible a] (h : 1 ≤ a) : ⅟ a ≤ 1 :=
37+
mul_invOf_self a ▸ le_mul_of_one_le_left (invOf_nonneg.2 <| zero_le_one.trans h) h
38+
#align inv_of_le_one invOf_le_one

0 commit comments

Comments
 (0)