Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 294e78e

Browse files
committed
feat(algebra/group_with_zero/power): With zero lemmas (#11051)
This proves the `group_with_zero` variant of some lemmas and moves lemmas from `algebra.group_power.basic` to `algebra.group_with_zero.power`.
1 parent 1332fe1 commit 294e78e

File tree

2 files changed

+33
-6
lines changed

2 files changed

+33
-6
lines changed

src/algebra/group_power/basic.lean

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ which in turn depends on other parts of algebra.
1717
This module contains lemmas about `a ^ n` and `n • a`, where `n : ℕ` or `n : ℤ`.
1818
Further lemmas can be found in `algebra.group_power.lemmas`.
1919
20+
The analogous results for groups with zero can be found in `algebra.group_with_zero.power`.
21+
2022
## Notation
2123
2224
- `a ^ n` is used as notation for `has_pow.pow a n`; in this file `n : ℕ` or `n : ℤ`.

src/algebra/group_with_zero/power.lean

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ lemma ring.inverse_pow (r : M) : ∀ (n : ℕ), ring.inverse r ^ n = ring.invers
3737
end zero
3838

3939
section group_with_zero
40-
variables {G₀ : Type*} [group_with_zero G₀]
40+
variables {G₀ : Type*} [group_with_zero G₀] {a : G₀} {m n : ℕ}
4141

4242
section nat_pow
4343

@@ -53,9 +53,22 @@ have h1 : m - n + n = m, from tsub_add_cancel_of_le h,
5353
have h2 : a ^ (m - n) * a ^ n = a ^ m, by rw [←pow_add, h1],
5454
by simpa only [div_eq_mul_inv] using eq_div_of_mul_eq (pow_ne_zero _ ha) h2
5555

56+
lemma pow_sub_of_lt (a : G₀) {m n : ℕ} (h : n < m) : a ^ (m - n) = a ^ m * (a ^ n)⁻¹ :=
57+
begin
58+
obtain rfl | ha := eq_or_ne a 0,
59+
{ rw [zero_pow (tsub_pos_of_lt h), zero_pow (n.zero_le.trans_lt h), zero_mul] },
60+
{ exact pow_sub₀ _ ha h.le }
61+
end
62+
5663
theorem pow_inv_comm₀ (a : G₀) (m n : ℕ) : (a⁻¹) ^ m * a ^ n = a ^ n * (a⁻¹) ^ m :=
5764
(commute.refl a).inv_left₀.pow_pow m n
5865

66+
lemma inv_pow_sub₀ (ha : a ≠ 0) (h : n ≤ m) : a⁻¹ ^ (m - n) = (a ^ m)⁻¹ * a ^ n :=
67+
by rw [pow_sub₀ _ (inv_ne_zero ha) h, inv_pow₀, inv_pow₀, inv_inv₀]
68+
69+
lemma inv_pow_sub_of_lt (a : G₀) (h : n < m) : a⁻¹ ^ (m - n) = (a ^ m)⁻¹ * a ^ n :=
70+
by rw [pow_sub_of_lt a⁻¹ h, inv_pow₀, inv_pow₀, inv_inv₀]
71+
5972
end nat_pow
6073

6174
end group_with_zero
@@ -74,7 +87,7 @@ lemma zero_zpow : ∀ z : ℤ, z ≠ 0 → (0 : G₀) ^ z = 0
7487
| (n : ℕ) h := by { rw [zpow_coe_nat, zero_pow'], simpa using h }
7588
| -[1+n] h := by simp
7689

77-
lemma fzero_pow_eq (n : ℤ) : (0 : G₀) ^ n = if n = 0 then 1 else 0 :=
90+
lemma zero_zpow_eq (n : ℤ) : (0 : G₀) ^ n = if n = 0 then 1 else 0 :=
7891
begin
7992
split_ifs with h,
8093
{ rw [h, zpow_zero] },
@@ -86,6 +99,12 @@ end
8699
| 0 := by { change a ^ (0 : ℤ) = (a ^ (0 : ℤ))⁻¹, simp }
87100
| -[1+ n] := by { rw [zpow_neg_succ_of_nat, inv_inv₀, ← zpow_coe_nat], refl }
88101

102+
lemma mul_zpow_neg_one₀ (a b : G₀) : (a * b) ^ (-1 : ℤ) = b ^ (-1 : ℤ) * a ^ (-1 : ℤ) :=
103+
by simp only [mul_inv_rev₀, zpow_one, zpow_neg₀]
104+
105+
lemma zpow_neg_one₀ (x : G₀) : x ^ (-1 : ℤ) = x⁻¹ :=
106+
by { rw [← congr_arg has_inv.inv (pow_one x), zpow_neg₀, ← zpow_coe_nat], refl }
107+
89108
theorem inv_zpow₀ (a : G₀) : ∀n:ℤ, a⁻¹ ^ n = (a ^ n)⁻¹
90109
| (n : ℕ) := by rw [zpow_coe_nat, zpow_coe_nat, inv_pow₀]
91110
| -[1+ n] := by rw [zpow_neg_succ_of_nat, zpow_neg_succ_of_nat, inv_pow₀]
@@ -189,10 +208,6 @@ lemma commute.mul_zpow₀ {a b : G₀} (h : commute a b) :
189208
| (n : ℕ) := by simp [h.mul_pow n]
190209
| -[1+n] := by simp [h.mul_pow, (h.pow_pow _ _).eq, mul_inv_rev₀]
191210

192-
lemma mul_zpow₀ {G₀ : Type*} [comm_group_with_zero G₀] (a b : G₀) (m : ℤ):
193-
(a * b) ^ m = (a ^ m) * (b ^ m) :=
194-
(commute.all a b).mul_zpow₀ m
195-
196211
theorem zpow_bit0' (a : G₀) (n : ℤ) : a ^ bit0 n = (a * a) ^ n :=
197212
(zpow_bit0₀ a n).trans ((commute.refl a).mul_zpow₀ n).symm
198213

@@ -233,6 +248,9 @@ variables {G₀ : Type*} [comm_group_with_zero G₀]
233248
(a / b) ^ n = a ^ n / b ^ n :=
234249
by simp only [div_eq_mul_inv, mul_pow, inv_pow₀]
235250

251+
lemma mul_zpow₀ (a b : G₀) (m : ℤ) : (a * b) ^ m = (a ^ m) * (b ^ m) :=
252+
(commute.all a b).mul_zpow₀ m
253+
236254
@[simp] theorem div_zpow₀ (a : G₀) {b : G₀} (n : ℤ) :
237255
(a / b) ^ n = a ^ n / b ^ n :=
238256
by simp only [div_eq_mul_inv, mul_zpow₀, inv_zpow₀]
@@ -244,6 +262,13 @@ begin
244262
rw [sq, mul_assoc, mul_div_cancel_left _ ha]
245263
end
246264

265+
/-- The `n`-th power map (`n` an integer) on a commutative group with zero, considered as a group
266+
homomorphism. -/
267+
def zpow_group_hom₀ (n : ℤ) : G₀ →* G₀ :=
268+
{ to_fun := (^ n),
269+
map_one' := one_zpow₀ n,
270+
map_mul' := λ a b, mul_zpow₀ a b n }
271+
247272
end
248273

249274
/-- If a monoid homomorphism `f` between two `group_with_zero`s maps `0` to `0`, then it maps `x^n`,

0 commit comments

Comments
 (0)