Skip to content

Commit

Permalink
feat(algebra/invertible): lemmas (#3493)
Browse files Browse the repository at this point in the history
Coauthored by: Johan Commelin <johan@commelin.net>


Co-authored-by: Rob Lewis <rob.y.lewis@gmail.com>
  • Loading branch information
robertylewis and robertylewis committed Jul 21, 2020
1 parent 5776f4c commit 7efdd99
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/algebra/invertible.lean
Expand Up @@ -165,6 +165,15 @@ def invertible_inv {a : α} [invertible a] : invertible (a⁻¹) :=

end group_with_zero

/--
Monoid homs preserve invertibility.
-/
def invertible.map {R : Type*} {S : Type*} [monoid R] [monoid S] (f : R →* S) (r : R) [invertible r] :
invertible (f r) :=
{ inv_of := f (⅟r),
inv_of_mul_self := by rw [← f.map_mul, inv_of_mul_self, f.map_one],
mul_inv_of_self := by rw [← f.map_mul, mul_inv_of_self, f.map_one] }

section ring_char

/-- A natural number `t` is invertible in a field `K` if the charactistic of `K` does not divide `t`. -/
Expand All @@ -181,6 +190,10 @@ def invertible_of_char_p_not_dvd {K : Type*} [field K] {p : ℕ} [char_p K p]
{t : ℕ} (not_dvd : ¬(p ∣ t)) : invertible (t : K) :=
invertible_of_nonzero (λ h, not_dvd ((char_p.cast_eq_zero_iff K p t).mp h))

instance invertible_of_pos {K : Type*} [field K] [char_zero K] (n : ℕ) [h : fact (0 < n)] :
invertible (n : K) :=
invertible_of_nonzero $ by simpa [nat.pos_iff_ne_zero] using h

end char_p

section division_ring
Expand Down

0 comments on commit 7efdd99

Please sign in to comment.