File: Mathlib/Tactic/Group.lean

full_name: Mathlib.Tactic.Group.zpow_trick
code: @[to_additive]
theorem zpow_trick {G : Type*} [Group G] (a b : G) (n m : ℤ) :
    a * b ^ n * b ^ m = a * b ^ (n + m) 
goal: a * b ^ n * b ^ m = a * b ^ (n + m)

full_name: Mathlib.Tactic.Group.zsmul_trick
code: @[to_additive]
theorem zpow_trick {G : Type*} [Group G] (a b : G) (n m : ℤ) :
    a * b ^ n * b ^ m = a * b ^ (n + m) 
goal: a + n • b + m • b = a + (n + m) • b

full_name: Mathlib.Tactic.Group.zpow_trick_one
code: @[to_additive]
theorem zpow_trick_one {G : Type*} [Group G] (a b : G) (m : ℤ) :
    a * b * b ^ m = a * b ^ (m + 1) 
goal: a * b * b ^ m = a * b ^ (m + 1)

full_name: Mathlib.Tactic.Group.zsmul_trick_zero
code: @[to_additive]
theorem zpow_trick_one {G : Type*} [Group G] (a b : G) (m : ℤ) :
    a * b * b ^ m = a * b ^ (m + 1) 
goal: a + b + m • b = a + (m + 1) • b

full_name: Mathlib.Tactic.Group.zsmul_trick_zero'
code: @[to_additive]
theorem zpow_trick_one' {G : Type*} [Group G] (a b : G) (n : ℤ) :
    a * b ^ n * b = a * b ^ (n + 1) 
goal: a + n • b + b = a + (n + 1) • b

full_name: Mathlib.Tactic.Group.zpow_trick_one'
code: @[to_additive]
theorem zpow_trick_one' {G : Type*} [Group G] (a b : G) (n : ℤ) :
    a * b ^ n * b = a * b ^ (n + 1) 
goal: a * b ^ n * b = a * b ^ (n + 1)

full_name: Mathlib.Tactic.Group.aux_group₁
code: /-- Auxiliary tactic for the `group` tactic. Calls the simplifier only. -/
syntax (name := aux_group₁) "aux_group₁" (location)? : tactic
goal: Lean.ParserDescr

full_name: Mathlib.Tactic.Group._aux_Mathlib_Tactic_Group___macroRules_Mathlib_Tactic_Group_aux_group₁_1
code: macro_rules
| `(tactic| aux_group₁ $[at $location]?) =>
  `(tactic| simp (config := {decide := false, failIfUnchanged := false}) only
    [commutatorElement_def, mul_one, one_mul,
      ← zpow_neg_one, ← zpow_natCast, ← zpow_mul,
      Int.ofNat_add, Int.ofNat_mul,
      Int.mul_neg_eq_neg_mul_symm, Int.neg_mul_eq_neg_mul_symm, neg_neg,
      one_zpow, zpow_zero, zpow_one, mul_zpow_neg_one,
      ← mul_assoc,
      ← zpow_add, ← zpow_add_one, ← zpow_one_add, zpow_trick, zpow_trick_one, zpow_trick_one',
      tsub_self, sub_self, add_neg_self, neg_add_self]
  $[at $location]?)
goal: Lean.Macro

full_name: Mathlib.Tactic.Group.aux_group₂
code: /-- Auxiliary tactic for the `group` tactic. Calls `ring_nf` to normalize exponents. -/
syntax (name := aux_group₂) "aux_group₂" (location)? : tactic
goal: Lean.ParserDescr

full_name: Mathlib.Tactic.Group._aux_Mathlib_Tactic_Group___macroRules_Mathlib_Tactic_Group_aux_group₂_1
code: macro_rules
| `(tactic| aux_group₂ $[at $location]?) =>
  `(tactic| ring_nf $[at $location]?)
goal: Lean.Macro

full_name: Mathlib.Tactic.Group.group
code: /-- Tactic for normalizing expressions in multiplicative groups, without assuming
commutativity, using only the group axioms without any information about which group
is manipulated.

(For additive commutative groups, use the `abel` tactic instead.)

Example:
```lean
example {G : Type} [Group G] (a b c d : G) (h : c = (a*b^2)*((b*b)⁻¹*a⁻¹)*d) : a*c*d⁻¹ = a := by
  group at h -- normalizes `h` which becomes `h : c = d`
  rw [h]     -- the goal is now `a*d*d⁻¹ = a`
  group      -- which then normalized and closed
```
-/
syntax (name := group) "group" (location)? : tactic
goal: Lean.ParserDescr

full_name: Mathlib.Tactic.Group._aux_Mathlib_Tactic_Group___macroRules_Mathlib_Tactic_Group_group_1
code: macro_rules
| `(tactic| group $[$loc]?) =>
  `(tactic| repeat (fail_if_no_progress (aux_group₁ $[$loc]? <;> aux_group₂ $[$loc]?)))
goal: Lean.Macro