Skip to content

Commit eee1269

Browse files
committed
feat: a * a ^ (n - 1) = a ^ n (#9610)
From LeanAPAP
1 parent f8ed019 commit eee1269

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

Mathlib/Algebra/Group/Commute/Defs.lean

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Neil Strickland, Yury Kudryashov
55
-/
66
import Mathlib.Algebra.Group.Semiconj.Defs
7+
import Mathlib.Data.Nat.Defs
78

89
#align_import algebra.group.commute from "leanprover-community/mathlib"@"05101c3df9d9cfe9430edc205860c79b6d660102"
910

@@ -209,12 +210,6 @@ theorem pow_pow_self (a : M) (m n : ℕ) : Commute (a ^ m) (a ^ n) :=
209210
#align add_commute.nsmul_nsmul_self AddCommute.nsmul_nsmul_selfₓ
210211
-- `MulOneClass.toHasMul` vs. `MulOneClass.toMul`
211212

212-
@[to_additive succ_nsmul']
213-
theorem _root_.pow_succ' (a : M) (n : ℕ) : a ^ (n + 1) = a ^ n * a :=
214-
(pow_succ a n).trans (self_pow _ _)
215-
#align pow_succ' pow_succ'
216-
#align succ_nsmul' succ_nsmul'
217-
218213
end Monoid
219214

220215
section DivisionMonoid
@@ -253,6 +248,25 @@ end Group
253248

254249
end Commute
255250

251+
section Monoid
252+
variable {M : Type*} [Monoid M] {n : ℕ}
253+
254+
@[to_additive succ_nsmul']
255+
lemma pow_succ' (a : M) (n : ℕ) : a ^ (n + 1) = a ^ n * a :=
256+
(pow_succ a n).trans (Commute.self_pow _ _)
257+
#align pow_succ' pow_succ'
258+
#align succ_nsmul' succ_nsmul'
259+
260+
@[to_additive]
261+
lemma mul_pow_sub_one (hn : n ≠ 0) (a : M) : a * a ^ (n - 1) = a ^ n := by
262+
rw [← pow_succ, Nat.sub_add_cancel $ Nat.one_le_iff_ne_zero.2 hn]
263+
264+
@[to_additive]
265+
lemma pow_sub_one_mul (hn : n ≠ 0) (a : M) : a ^ (n - 1) * a = a ^ n := by
266+
rw [← pow_succ', Nat.sub_add_cancel $ Nat.one_le_iff_ne_zero.2 hn]
267+
268+
end Monoid
269+
256270
section CommGroup
257271

258272
variable [CommGroup G] (a b : G)

0 commit comments

Comments
 (0)