Skip to content

Commit f836999

Browse files
feat: Induction principle for powers (#3278)
leanprover-community/mathlib3#18668 * [`algebra.group_power.lemmas`@`05101c3df9d9cfe9430edc205860c79b6d660102`..`e655e4ea5c6d02854696f97494997ba4c31be802`](https://leanprover-community.github.io/mathlib-port-status/file/algebra/group_power/lemmas?range=05101c3df9d9cfe9430edc205860c79b6d660102..e655e4ea5c6d02854696f97494997ba4c31be802) * [`group_theory.submonoid.membership`@`2ec920d35348cb2d13ac0e1a2ad9df0fdf1a76b4`..`e655e4ea5c6d02854696f97494997ba4c31be802`](https://leanprover-community.github.io/mathlib-port-status/file/group_theory/submonoid/membership?range=2ec920d35348cb2d13ac0e1a2ad9df0fdf1a76b4..e655e4ea5c6d02854696f97494997ba4c31be802) * [`group_theory.subgroup.zpowers`@`f93c11933efbc3c2f0299e47b8ff83e9b539cbf6`..`e655e4ea5c6d02854696f97494997ba4c31be802`](https://leanprover-community.github.io/mathlib-port-status/file/group_theory/subgroup/zpowers?range=f93c11933efbc3c2f0299e47b8ff83e9b539cbf6..e655e4ea5c6d02854696f97494997ba4c31be802) * [`group_theory.subgroup.pointwise`@`c10e724be91096453ee3db13862b9fb9a992fef2`..`e655e4ea5c6d02854696f97494997ba4c31be802`](https://leanprover-community.github.io/mathlib-port-status/file/group_theory/subgroup/pointwise?range=c10e724be91096453ee3db13862b9fb9a992fef2..e655e4ea5c6d02854696f97494997ba4c31be802) * [`ring_theory.int.basic`@`2196ab363eb097c008d4497125e0dde23fb36db2`..`e655e4ea5c6d02854696f97494997ba4c31be802`](https://leanprover-community.github.io/mathlib-port-status/file/ring_theory/int/basic?range=2196ab363eb097c008d4497125e0dde23fb36db2..e655e4ea5c6d02854696f97494997ba4c31be802)
1 parent 3d1eb78 commit f836999

File tree

5 files changed

+75
-16
lines changed

5 files changed

+75
-16
lines changed

Mathlib/Algebra/GroupPower/Lemmas.lean

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Jeremy Avigad, Robert Y. Lewis
55
66
! This file was ported from Lean 3 source module algebra.group_power.lemmas
7-
! leanprover-community/mathlib commit 05101c3df9d9cfe9430edc205860c79b6d660102
7+
! leanprover-community/mathlib commit e655e4ea5c6d02854696f97494997ba4c31be802
88
! Please do not edit these lines, except to modify the commit id
99
! if you have ported upstream changes.
1010
-/
@@ -271,6 +271,40 @@ theorem zpow_bit1 (a : G) (n : ℤ) : a ^ bit1 n = a ^ n * a ^ n * a := by
271271

272272
end bit1
273273

274+
/-- To show a property of all powers of `g` it suffices to show it is closed under multiplication
275+
by `g` and `g⁻¹` on the left. For subgroups generated by more than one element, see
276+
`Subgroup.closure_induction_left`. -/
277+
@[to_additive "To show a property of all multiples of `g` it suffices to show it is closed under
278+
addition by `g` and `-g` on the left. For additive subgroups generated by more than one element, see
279+
`AddSubgroup.closure_induction_left`."]
280+
theorem zpow_induction_left {g : G} {P : G → Prop} (h_one : P (1 : G))
281+
(h_mul : ∀ a, P a → P (g * a)) (h_inv : ∀ a, P a → P (g⁻¹ * a)) (n : ℤ) : P (g ^ n) := by
282+
induction' n using Int.induction_on with n ih n ih
283+
· rwa [zpow_zero]
284+
· rw [add_comm, zpow_add, zpow_one]
285+
exact h_mul _ ih
286+
· rw [sub_eq_add_neg, add_comm, zpow_add, zpow_neg_one]
287+
exact h_inv _ ih
288+
#align zpow_induction_left zpow_induction_left
289+
#align zsmul_induction_left zsmul_induction_left
290+
291+
/-- To show a property of all powers of `g` it suffices to show it is closed under multiplication
292+
by `g` and `g⁻¹` on the right. For subgroups generated by more than one element, see
293+
`Subgroup.closure_induction_right`. -/
294+
@[to_additive "To show a property of all multiples of `g` it suffices to show it is closed under
295+
addition by `g` and `-g` on the right. For additive subgroups generated by more than one element,
296+
see `AddSubgroup.closure_induction_right`."]
297+
theorem zpow_induction_right {g : G} {P : G → Prop} (h_one : P (1 : G))
298+
(h_mul : ∀ a, P a → P (a * g)) (h_inv : ∀ a, P a → P (a * g⁻¹)) (n : ℤ) : P (g ^ n) := by
299+
induction' n using Int.induction_on with n ih n ih
300+
· rwa [zpow_zero]
301+
· rw [zpow_add_one]
302+
exact h_mul _ ih
303+
· rw [zpow_sub_one]
304+
exact h_inv _ ih
305+
#align zpow_induction_right zpow_induction_right
306+
#align zsmul_induction_right zsmul_induction_right
307+
274308
end Group
275309

276310
/-!

Mathlib/GroupTheory/Subgroup/Pointwise.lean

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Eric Wieser
55
66
! This file was ported from Lean 3 source module group_theory.subgroup.pointwise
7-
! leanprover-community/mathlib commit c10e724be91096453ee3db13862b9fb9a992fef2
7+
! leanprover-community/mathlib commit e655e4ea5c6d02854696f97494997ba4c31be802
88
! Please do not edit these lines, except to modify the commit id
99
! if you have ported upstream changes.
1010
-/
@@ -66,7 +66,9 @@ theorem closure_toSubmonoid (S : Set G) :
6666
#align subgroup.closure_to_submonoid Subgroup.closure_toSubmonoid
6767
#align add_subgroup.closure_to_add_submonoid AddSubgroup.closure_toAddSubmonoid
6868

69-
@[to_additive]
69+
/-- For subgroups generated by a single element, see the simpler `zpow_induction_left`. -/
70+
@[to_additive "For additive subgroups generated by a single element, see the simpler
71+
`zsmul_induction_left`."]
7072
theorem closure_induction_left {p : G → Prop} {x : G} (h : x ∈ closure s) (H1 : p 1)
7173
(Hmul : ∀ x ∈ s, ∀ (y), p y → p (x * y)) (Hinv : ∀ x ∈ s, ∀ (y), p y → p (x⁻¹ * y)) : p x :=
7274
let key := (closure_toSubmonoid s).le
@@ -75,7 +77,9 @@ theorem closure_induction_left {p : G → Prop} {x : G} (h : x ∈ closure s) (H
7577
#align subgroup.closure_induction_left Subgroup.closure_induction_left
7678
#align add_subgroup.closure_induction_left AddSubgroup.closure_induction_left
7779

78-
@[to_additive]
80+
/-- For subgroups generated by a single element, see the simpler `zpow_induction_right`. -/
81+
@[to_additive "For additive subgroups generated by a single element, see the simpler
82+
`zsmul_induction_right`."]
7983
theorem closure_induction_right {p : G → Prop} {x : G} (h : x ∈ closure s) (H1 : p 1)
8084
(Hmul : ∀ (x), ∀ y ∈ s, p x → p (x * y)) (Hinv : ∀ (x), ∀ y ∈ s, p x → p (x * y⁻¹)) : p x :=
8185
let key := (closure_toSubmonoid s).le

Mathlib/GroupTheory/Subgroup/Zpowers.lean

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Chris Hughes
55
66
! This file was ported from Lean 3 source module group_theory.subgroup.zpowers
7-
! leanprover-community/mathlib commit f93c11933efbc3c2f0299e47b8ff83e9b539cbf6
7+
! leanprover-community/mathlib commit e655e4ea5c6d02854696f97494997ba4c31be802
88
! Please do not edit these lines, except to modify the commit id
99
! if you have ported upstream changes.
1010
-/
@@ -36,6 +36,10 @@ theorem mem_zpowers (g : G) : g ∈ zpowers g :=
3636
1, zpow_one _⟩
3737
#align subgroup.mem_zpowers Subgroup.mem_zpowers
3838

39+
theorem coe_zpowers (g : G) : ↑(zpowers g) = Set.range (g ^ · : ℤ → G) :=
40+
rfl
41+
#align subgroup.coe_zpowers Subgroup.coe_zpowers
42+
3943
theorem zpowers_eq_closure (g : G) : zpowers g = closure {g} := by
4044
ext
4145
exact mem_closure_singleton.symm
@@ -45,11 +49,6 @@ theorem range_zpowersHom (g : G) : (zpowersHom G g).range = zpowers g :=
4549
rfl
4650
#align subgroup.range_zpowers_hom Subgroup.range_zpowersHom
4751

48-
theorem zpowers_subset {a : G} {K : Subgroup G} (h : a ∈ K) : zpowers a ≤ K := fun x hx =>
49-
match x, hx with
50-
| _, ⟨i, rfl⟩ => K.zpow_mem h i
51-
#align subgroup.zpowers_subset Subgroup.zpowers_subset
52-
5352
theorem mem_zpowers_iff {g h : G} : h ∈ zpowers g ↔ ∃ k : ℤ, g ^ k = h :=
5453
Iff.rfl
5554
#align subgroup.mem_zpowers_iff Subgroup.mem_zpowers_iff
@@ -100,15 +99,14 @@ attribute [to_additive existing AddSubgroup.zmultiples] Subgroup.zpowers
10099
attribute [to_additive (attr := simp) AddSubgroup.mem_zmultiples] Subgroup.mem_zpowers
101100
#align add_subgroup.mem_zmultiples AddSubgroup.mem_zmultiples
102101

102+
attribute [to_additive (attr := norm_cast) AddSubgroup.coe_zmultiples] Subgroup.coe_zpowers
103+
103104
attribute [to_additive AddSubgroup.zmultiples_eq_closure] Subgroup.zpowers_eq_closure
104105
#align add_subgroup.zmultiples_eq_closure AddSubgroup.zmultiples_eq_closure
105106

106107
attribute [to_additive existing (attr := simp) AddSubgroup.range_zmultiplesHom]
107108
Subgroup.range_zpowersHom
108109

109-
attribute [to_additive AddSubgroup.zmultiples_subset] Subgroup.zpowers_subset
110-
#align add_subgroup.zmultiples_subset AddSubgroup.zmultiples_subset
111-
112110
attribute [to_additive AddSubgroup.mem_zmultiples_iff] Subgroup.mem_zpowers_iff
113111
#align add_subgroup.mem_zmultiples_iff AddSubgroup.mem_zmultiples_iff
114112

@@ -187,6 +185,8 @@ theorem ofAdd_image_zmultiples_eq_zpowers_ofAdd {x : A} :
187185

188186
namespace Subgroup
189187

188+
variable {s : Set G} {g : G}
189+
190190
@[to_additive zmultiples_isCommutative]
191191
instance zpowers_isCommutative (g : G) : (zpowers g).IsCommutative :=
192192
⟨⟨fun ⟨_, _, h₁⟩ ⟨_, _, h₂⟩ => by
@@ -201,11 +201,25 @@ theorem zpowers_le {g : G} {H : Subgroup G} : zpowers g ≤ H ↔ g ∈ H := by
201201
#align subgroup.zpowers_le Subgroup.zpowers_le
202202
#align add_subgroup.zmultiples_le AddSubgroup.zmultiples_le
203203

204+
alias zpowers_le ↔ _ zpowers_le_of_mem
205+
#align subgroup.zpowers_le_of_mem Subgroup.zpowers_le_of_mem
206+
207+
alias AddSubgroup.zmultiples_le ↔ _ _root_.AddSubgroup.zmultiples_le_of_mem
208+
#align add_subgroup.zmultiples_le_of_mem AddSubgroup.zmultiples_le_of_mem
209+
210+
attribute [to_additive existing zmultiples_le_of_mem] zpowers_le_of_mem
211+
204212
@[to_additive (attr := simp) zmultiples_eq_bot]
205213
theorem zpowers_eq_bot {g : G} : zpowers g = ⊥ ↔ g = 1 := by rw [eq_bot_iff, zpowers_le, mem_bot]
206214
#align subgroup.zpowers_eq_bot Subgroup.zpowers_eq_bot
207215
#align add_subgroup.zmultiples_eq_bot AddSubgroup.zmultiples_eq_bot
208216

217+
@[to_additive zmultiples_ne_bot]
218+
theorem zpowers_ne_bot : zpowers g ≠ ⊥ ↔ g ≠ 1 :=
219+
zpowers_eq_bot.not
220+
#align subgroup.zpowers_ne_bot Subgroup.zpowers_ne_bot
221+
#align add_subgroup.zmultiples_ne_bot AddSubgroup.zmultiples_ne_bot
222+
209223
@[to_additive (attr := simp) zmultiples_zero_eq_bot]
210224
theorem zpowers_one_eq_bot : Subgroup.zpowers (1 : G) = ⊥ :=
211225
Subgroup.zpowers_eq_bot.mpr rfl

Mathlib/GroupTheory/Submonoid/Membership.lean

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Authors: Johannes Hölzl, Kenny Lau, Johan Commelin, Mario Carneiro, Kevin Buzza
55
Amelia Livingston, Yury Kudryashov
66
77
! This file was ported from Lean 3 source module group_theory.submonoid.membership
8-
! leanprover-community/mathlib commit 2ec920d35348cb2d13ac0e1a2ad9df0fdf1a76b4
8+
! leanprover-community/mathlib commit e655e4ea5c6d02854696f97494997ba4c31be802
99
! Please do not edit these lines, except to modify the commit id
1010
! if you have ported upstream changes.
1111
-/
@@ -438,6 +438,10 @@ theorem mem_powers (n : M) : n ∈ powers n :=
438438
1, pow_one _⟩
439439
#align submonoid.mem_powers Submonoid.mem_powers
440440

441+
theorem coe_powers (x : M) : ↑(powers x) = Set.range fun n : ℕ => x ^ n :=
442+
rfl
443+
#align submonoid.coe_powers Submonoid.coe_powers
444+
441445
theorem mem_powers_iff (x z : M) : x ∈ powers z ↔ ∃ n : ℕ, z ^ n = x :=
442446
Iff.rfl
443447
#align submonoid.mem_powers_iff Submonoid.mem_powers_iff
@@ -620,6 +624,9 @@ attribute [to_additive existing multiples] Submonoid.powers
620624
attribute [to_additive (attr := simp) mem_multiples] Submonoid.mem_powers
621625
#align add_submonoid.mem_multiples AddSubmonoid.mem_multiples
622626

627+
attribute [to_additive (attr := norm_cast) coe_multiples] Submonoid.coe_powers
628+
#align add_submonoid.coe_multiples AddSubmonoid.coe_multiples
629+
623630
attribute [to_additive mem_multiples_iff] Submonoid.mem_powers_iff
624631
#align add_submonoid.mem_multiples_iff AddSubmonoid.mem_multiples_iff
625632

Mathlib/RingTheory/Int/Basic.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,8 +385,8 @@ namespace Int
385385

386386
theorem zmultiples_natAbs (a : ℤ) :
387387
AddSubgroup.zmultiples (a.natAbs : ℤ) = AddSubgroup.zmultiples a :=
388-
le_antisymm (AddSubgroup.zmultiples_subset (mem_zmultiples_iff.mpr (dvd_natAbs.mpr (dvd_refl a))))
389-
(AddSubgroup.zmultiples_subset (mem_zmultiples_iff.mpr (natAbs_dvd.mpr (dvd_refl a))))
388+
le_antisymm (AddSubgroup.zmultiples_le_of_mem (mem_zmultiples_iff.mpr (dvd_natAbs.mpr dvd_rfl)))
389+
(AddSubgroup.zmultiples_le_of_mem (mem_zmultiples_iff.mpr (natAbs_dvd.mpr dvd_rfl)))
390390
#align int.zmultiples_nat_abs Int.zmultiples_natAbs
391391

392392
theorem span_natAbs (a : ℤ) : Ideal.span ({(a.natAbs : ℤ)} : Set ℤ) = Ideal.span {a} := by

0 commit comments

Comments
 (0)