File: Mathlib/GroupTheory/SpecificGroups/Cyclic.lean

full_name: IsAddCyclic
code: /-- A group is called *cyclic* if it is generated by a single element. -/
class IsAddCyclic (α : Type u) [AddGroup α] : Prop where
  exists_generator : ∃ g : α, ∀ x, x ∈ AddSubgroup.zmultiples g
goal: Prop

full_name: IsAddCyclic.exists_generator
code: /-- A group is called *cyclic* if it is generated by a single element. -/
class IsAddCyclic (α : Type u) [AddGroup α] : Prop where
  exists_generator : ∃ g : α, ∀ x, x ∈ AddSubgroup.zmultiples g
goal: ∃ g, ∀ (x : α), x ∈ AddSubgroup.zmultiples g

full_name: IsCyclic.exists_generator
code: /-- A group is called *cyclic* if it is generated by a single element. -/
@[to_additive]
class IsCyclic (α : Type u) [Group α] : Prop where
  exists_generator : ∃ g : α, ∀ x, x ∈ zpowers g
goal: ∃ g, ∀ (x : α), x ∈ Subgroup.zpowers g

full_name: IsCyclic
code: /-- A group is called *cyclic* if it is generated by a single element. -/
@[to_additive]
class IsCyclic (α : Type u) [Group α] : Prop where
  exists_generator : ∃ g : α, ∀ x, x ∈ zpowers g
goal: Prop

full_name: isCyclic_of_subsingleton
code: @[to_additive]
instance (priority := 100) isCyclic_of_subsingleton [Group α] [Subsingleton α] : IsCyclic α 
goal: IsCyclic α

full_name: isAddCyclic_of_subsingleton
code: @[to_additive]
instance (priority := 100) isCyclic_of_subsingleton [Group α] [Subsingleton α] : IsCyclic α 
goal: IsAddCyclic α

full_name: isCyclic_multiplicative_iff
code: @[simp]
theorem isCyclic_multiplicative_iff [AddGroup α] : IsCyclic (Multiplicative α) ↔ IsAddCyclic α 
goal: IsCyclic (Multiplicative α) ↔ IsAddCyclic α

full_name: isCyclic_multiplicative
code: instance isCyclic_multiplicative [AddGroup α] [IsAddCyclic α] : IsCyclic (Multiplicative α) 
goal: IsCyclic (Multiplicative α)

full_name: isAddCyclic_additive_iff
code: @[simp]
theorem isAddCyclic_additive_iff [Group α] : IsAddCyclic (Additive α) ↔ IsCyclic α 
goal: IsAddCyclic (Additive α) ↔ IsCyclic α

full_name: isAddCyclic_additive
code: instance isAddCyclic_additive [Group α] [IsCyclic α] : IsAddCyclic (Additive α) 
goal: IsAddCyclic (Additive α)

full_name: IsAddCyclic.addCommGroup
code: /-- A cyclic group is always commutative. This is not an `instance` because often we have a better
proof of `CommGroup`. -/
@[to_additive
      "A cyclic group is always commutative. This is not an `instance` because often we have
      a better proof of `AddCommGroup`."]
def IsCyclic.commGroup [hg : Group α] [IsCyclic α] : CommGroup α 
goal: AddCommGroup α

full_name: IsCyclic.commGroup
code: /-- A cyclic group is always commutative. This is not an `instance` because often we have a better
proof of `CommGroup`. -/
@[to_additive
      "A cyclic group is always commutative. This is not an `instance` because often we have
      a better proof of `AddCommGroup`."]
def IsCyclic.commGroup [hg : Group α] [IsCyclic α] : CommGroup α 
goal: CommGroup α

full_name: Nontrivial.of_not_isCyclic
code: /-- A non-cyclic multiplicative group is non-trivial. -/
@[to_additive "A non-cyclic additive group is non-trivial."]
theorem Nontrivial.of_not_isCyclic (nc : ¬IsCyclic α) : Nontrivial α 
goal: Nontrivial α

full_name: Nontrivial.of_not_isAddCyclic
code: /-- A non-cyclic multiplicative group is non-trivial. -/
@[to_additive "A non-cyclic additive group is non-trivial."]
theorem Nontrivial.of_not_isCyclic (nc : ¬IsCyclic α) : Nontrivial α 
goal: Nontrivial α

full_name: MonoidHom.map_cyclic
code: @[to_additive]
theorem MonoidHom.map_cyclic {G : Type*} [Group G] [h : IsCyclic G] (σ : G →* G) :
    ∃ m : ℤ, ∀ g : G, σ g = g ^ m 
goal: ∃ m, ∀ (g : G), σ g = g ^ m

full_name: AddMonoidHom.map_addCyclic
code: @[to_additive]
theorem MonoidHom.map_cyclic {G : Type*} [Group G] [h : IsCyclic G] (σ : G →* G) :
    ∃ m : ℤ, ∀ g : G, σ g = g ^ m 
goal: ∃ m, ∀ (g : G), σ g = m • g

full_name: isCyclic_of_orderOf_eq_card
code: @[to_additive]
theorem isCyclic_of_orderOf_eq_card [Fintype α] (x : α) (hx : orderOf x = Fintype.card α) :
    IsCyclic α 
goal: IsCyclic α

full_name: isAddCyclic_of_addOrderOf_eq_card
code: @[to_additive]
theorem isCyclic_of_orderOf_eq_card [Fintype α] (x : α) (hx : orderOf x = Fintype.card α) :
    IsCyclic α 
goal: IsAddCyclic α

full_name: Subgroup.eq_bot_or_eq_top_of_prime_card
code: @[to_additive]
theorem Subgroup.eq_bot_or_eq_top_of_prime_card {G : Type*} [Group G] {_ : Fintype G}
    (H : Subgroup G) [hp : Fact (Fintype.card G).Prime] : H = ⊥ ∨ H = ⊤ 
goal: ∀ {x : Fintype G} (H : Subgroup G) [hp : Fact (Nat.Prime (Fintype.card G))], H = ⊥ ∨ H = ⊤

full_name: AddSubgroup.eq_bot_or_eq_top_of_prime_card
code: @[to_additive]
theorem Subgroup.eq_bot_or_eq_top_of_prime_card {G : Type*} [Group G] {_ : Fintype G}
    (H : Subgroup G) [hp : Fact (Fintype.card G).Prime] : H = ⊥ ∨ H = ⊤ 
goal: ∀ {x : Fintype G} (H : AddSubgroup G) [hp : Fact (Nat.Prime (Fintype.card G))], H = ⊥ ∨ H = ⊤

full_name: zmultiples_eq_top_of_prime_card
code: /-- Any non-identity element of a finite group of prime order generates the group. -/
@[to_additive "Any non-identity element of a finite group of prime order generates the group."]
theorem zpowers_eq_top_of_prime_card {G : Type*} [Group G] {_ : Fintype G} {p : ℕ}
    [hp : Fact p.Prime] (h : Fintype.card G = p) {g : G} (hg : g ≠ 1) : zpowers g = ⊤ 
goal: ∀ {x : Fintype G} {p : ℕ} [hp : Fact (Nat.Prime p)],
  Fintype.card G = p → ∀ {g : G}, g ≠ 0 → AddSubgroup.zmultiples g = ⊤

full_name: zpowers_eq_top_of_prime_card
code: /-- Any non-identity element of a finite group of prime order generates the group. -/
@[to_additive "Any non-identity element of a finite group of prime order generates the group."]
theorem zpowers_eq_top_of_prime_card {G : Type*} [Group G] {_ : Fintype G} {p : ℕ}
    [hp : Fact p.Prime] (h : Fintype.card G = p) {g : G} (hg : g ≠ 1) : zpowers g = ⊤ 
goal: ∀ {x : Fintype G} {p : ℕ} [hp : Fact (Nat.Prime p)], Fintype.card G = p → ∀ {g : G}, g ≠ 1 → Subgroup.zpowers g = ⊤

full_name: mem_zpowers_of_prime_card
code: @[to_additive]
theorem mem_zpowers_of_prime_card {G : Type*} [Group G] {_ : Fintype G} {p : ℕ} [hp : Fact p.Prime]
    (h : Fintype.card G = p) {g g' : G} (hg : g ≠ 1) : g' ∈ zpowers g 
goal: ∀ {x : Fintype G} {p : ℕ} [hp : Fact (Nat.Prime p)], Fintype.card G = p → ∀ {g g' : G}, g ≠ 1 → g' ∈ Subgroup.zpowers g

full_name: mem_zmultiples_of_prime_card
code: @[to_additive]
theorem mem_zpowers_of_prime_card {G : Type*} [Group G] {_ : Fintype G} {p : ℕ} [hp : Fact p.Prime]
    (h : Fintype.card G = p) {g g' : G} (hg : g ≠ 1) : g' ∈ zpowers g 
goal: ∀ {x : Fintype G} {p : ℕ} [hp : Fact (Nat.Prime p)],
  Fintype.card G = p → ∀ {g g' : G}, g ≠ 0 → g' ∈ AddSubgroup.zmultiples g

full_name: mem_powers_of_prime_card
code: @[to_additive]
theorem mem_powers_of_prime_card {G : Type*} [Group G] {_ : Fintype G} {p : ℕ} [hp : Fact p.Prime]
    (h : Fintype.card G = p) {g g' : G} (hg : g ≠ 1) : g' ∈ Submonoid.powers g 
goal: ∀ {x : Fintype G} {p : ℕ} [hp : Fact (Nat.Prime p)], Fintype.card G = p → ∀ {g g' : G}, g ≠ 1 → g' ∈ Submonoid.powers g

full_name: mem_multiples_of_prime_card
code: @[to_additive]
theorem mem_powers_of_prime_card {G : Type*} [Group G] {_ : Fintype G} {p : ℕ} [hp : Fact p.Prime]
    (h : Fintype.card G = p) {g g' : G} (hg : g ≠ 1) : g' ∈ Submonoid.powers g 
goal: ∀ {x : Fintype G} {p : ℕ} [hp : Fact (Nat.Prime p)],
  Fintype.card G = p → ∀ {g g' : G}, g ≠ 0 → g' ∈ AddSubmonoid.multiples g

full_name: multiples_eq_top_of_prime_card
code: @[to_additive]
theorem powers_eq_top_of_prime_card {G : Type*} [Group G] {_ : Fintype G} {p : ℕ}
    [hp : Fact p.Prime] (h : Fintype.card G = p) {g : G} (hg : g ≠ 1) : Submonoid.powers g = ⊤ 
goal: ∀ {x : Fintype G} {p : ℕ} [hp : Fact (Nat.Prime p)],
  Fintype.card G = p → ∀ {g : G}, g ≠ 0 → AddSubmonoid.multiples g = ⊤

full_name: powers_eq_top_of_prime_card
code: @[to_additive]
theorem powers_eq_top_of_prime_card {G : Type*} [Group G] {_ : Fintype G} {p : ℕ}
    [hp : Fact p.Prime] (h : Fintype.card G = p) {g : G} (hg : g ≠ 1) : Submonoid.powers g = ⊤ 
goal: ∀ {x : Fintype G} {p : ℕ} [hp : Fact (Nat.Prime p)], Fintype.card G = p → ∀ {g : G}, g ≠ 1 → Submonoid.powers g = ⊤

full_name: isAddCyclic_of_prime_card
code: /-- A finite group of prime order is cyclic. -/
@[to_additive "A finite group of prime order is cyclic."]
theorem isCyclic_of_prime_card {α : Type u} [Group α] [Fintype α] {p : ℕ} [hp : Fact p.Prime]
    (h : Fintype.card α = p) : IsCyclic α 
goal: IsAddCyclic α

full_name: isCyclic_of_prime_card
code: /-- A finite group of prime order is cyclic. -/
@[to_additive "A finite group of prime order is cyclic."]
theorem isCyclic_of_prime_card {α : Type u} [Group α] [Fintype α] {p : ℕ} [hp : Fact p.Prime]
    (h : Fintype.card α = p) : IsCyclic α 
goal: IsCyclic α

full_name: isAddCyclic_of_card_dvd_prime
code: /-- A finite group of order dividing a prime is cyclic. -/
@[to_additive "A finite group of order dividing a prime is cyclic."]
theorem isCyclic_of_card_dvd_prime {α : Type u} [Group α] {p : ℕ} [hp : Fact p.Prime]
    (h : Nat.card α ∣ p) : IsCyclic α 
goal: IsAddCyclic α

full_name: isCyclic_of_card_dvd_prime
code: /-- A finite group of order dividing a prime is cyclic. -/
@[to_additive "A finite group of order dividing a prime is cyclic."]
theorem isCyclic_of_card_dvd_prime {α : Type u} [Group α] {p : ℕ} [hp : Fact p.Prime]
    (h : Nat.card α ∣ p) : IsCyclic α 
goal: IsCyclic α

full_name: isCyclic_of_surjective
code: @[to_additive]
theorem isCyclic_of_surjective {H G F : Type*} [Group H] [Group G] [hH : IsCyclic H]
    [FunLike F H G] [MonoidHomClass F H G] (f : F) (hf : Function.Surjective f) :
    IsCyclic G 
goal: IsCyclic G

full_name: isAddCyclic_of_surjective
code: @[to_additive]
theorem isCyclic_of_surjective {H G F : Type*} [Group H] [Group G] [hH : IsCyclic H]
    [FunLike F H G] [MonoidHomClass F H G] (f : F) (hf : Function.Surjective f) :
    IsCyclic G 
goal: IsAddCyclic G

full_name: addOrderOf_eq_card_of_forall_mem_zmultiples
code: @[to_additive]
theorem orderOf_eq_card_of_forall_mem_zpowers [Fintype α] {g : α} (hx : ∀ x, x ∈ zpowers g) :
    orderOf g = Fintype.card α 
goal: addOrderOf g = Fintype.card α

full_name: orderOf_eq_card_of_forall_mem_zpowers
code: @[to_additive]
theorem orderOf_eq_card_of_forall_mem_zpowers [Fintype α] {g : α} (hx : ∀ x, x ∈ zpowers g) :
    orderOf g = Fintype.card α 
goal: orderOf g = Fintype.card α

full_name: orderOf_generator_eq_natCard
code: @[to_additive]
lemma orderOf_generator_eq_natCard (h : ∀ x, x ∈ Subgroup.zpowers a) : orderOf a = Nat.card α 
goal: orderOf a = Nat.card α

full_name: addOrderOf_generator_eq_natCard
code: @[to_additive]
lemma orderOf_generator_eq_natCard (h : ∀ x, x ∈ Subgroup.zpowers a) : orderOf a = Nat.card α 
goal: addOrderOf a = Nat.card α

full_name: exists_nsmul_ne_zero_of_isAddCyclic
code: @[to_additive]
theorem exists_pow_ne_one_of_isCyclic {G : Type*} [Group G] [Fintype G] [G_cyclic : IsCyclic G]
    {k : ℕ} (k_pos : k ≠ 0) (k_lt_card_G : k < Fintype.card G) : ∃ a : G, a ^ k ≠ 1 
goal: ∃ a, k • a ≠ 0

full_name: exists_pow_ne_one_of_isCyclic
code: @[to_additive]
theorem exists_pow_ne_one_of_isCyclic {G : Type*} [Group G] [Fintype G] [G_cyclic : IsCyclic G]
    {k : ℕ} (k_pos : k ≠ 0) (k_lt_card_G : k < Fintype.card G) : ∃ a : G, a ^ k ≠ 1 
goal: ∃ a, a ^ k ≠ 1

full_name: Infinite.addOrderOf_eq_zero_of_forall_mem_zmultiples
code: @[to_additive]
theorem Infinite.orderOf_eq_zero_of_forall_mem_zpowers [Infinite α] {g : α}
    (h : ∀ x, x ∈ zpowers g) : orderOf g = 0 
goal: addOrderOf g = 0

full_name: Infinite.orderOf_eq_zero_of_forall_mem_zpowers
code: @[to_additive]
theorem Infinite.orderOf_eq_zero_of_forall_mem_zpowers [Infinite α] {g : α}
    (h : ∀ x, x ∈ zpowers g) : orderOf g = 0 
goal: orderOf g = 0

full_name: Bot.isAddCyclic
code: @[to_additive]
instance Bot.isCyclic {α : Type u} [Group α] : IsCyclic (⊥ : Subgroup α) 
goal: IsAddCyclic ↥⊥

full_name: Bot.isCyclic
code: @[to_additive]
instance Bot.isCyclic {α : Type u} [Group α] : IsCyclic (⊥ : Subgroup α) 
goal: IsCyclic ↥⊥

full_name: Subgroup.isCyclic
code: @[to_additive]
instance Subgroup.isCyclic {α : Type u} [Group α] [IsCyclic α] (H : Subgroup α) : IsCyclic H 
goal: IsCyclic ↥H

full_name: AddSubgroup.isAddCyclic
code: @[to_additive]
instance Subgroup.isCyclic {α : Type u} [Group α] [IsCyclic α] (H : Subgroup α) : IsCyclic H 
goal: IsAddCyclic ↥H

full_name: IsAddCyclic.card_nsmul_eq_zero_le
code: @[to_additive IsAddCyclic.card_nsmul_eq_zero_le]
theorem IsCyclic.card_pow_eq_one_le [DecidableEq α] [Fintype α] [IsCyclic α] {n : ℕ} (hn0 : 0 < n) :
    (univ.filter fun a : α => a ^ n = 1).card ≤ n 
goal: (Finset.filter (fun a => n • a = 0) Finset.univ).card ≤ n

full_name: IsCyclic.card_pow_eq_one_le
code: @[to_additive IsAddCyclic.card_nsmul_eq_zero_le]
theorem IsCyclic.card_pow_eq_one_le [DecidableEq α] [Fintype α] [IsCyclic α] {n : ℕ} (hn0 : 0 < n) :
    (univ.filter fun a : α => a ^ n = 1).card ≤ n 
goal: (Finset.filter (fun a => a ^ n = 1) Finset.univ).card ≤ n

full_name: IsCyclic.exists_monoid_generator
code: @[to_additive]
theorem IsCyclic.exists_monoid_generator [Finite α] [IsCyclic α] :
    ∃ x : α, ∀ y : α, y ∈ Submonoid.powers x 
goal: ∃ x, ∀ (y : α), y ∈ Submonoid.powers x

full_name: IsAddCyclic.exists_addMonoid_generator
code: @[to_additive]
theorem IsCyclic.exists_monoid_generator [Finite α] [IsCyclic α] :
    ∃ x : α, ∀ y : α, y ∈ Submonoid.powers x 
goal: ∃ x, ∀ (y : α), y ∈ AddSubmonoid.multiples x

full_name: IsCyclic.exists_ofOrder_eq_natCard
code: @[to_additive]
lemma IsCyclic.exists_ofOrder_eq_natCard [h : IsCyclic α] : ∃ g : α, orderOf g = Nat.card α 
goal: ∃ g, orderOf g = Nat.card α

full_name: IsAddCyclic.exists_ofOrder_eq_natCard
code: @[to_additive]
lemma IsCyclic.exists_ofOrder_eq_natCard [h : IsCyclic α] : ∃ g : α, orderOf g = Nat.card α 
goal: ∃ g, addOrderOf g = Nat.card α

full_name: isCyclic_iff_exists_ofOrder_eq_natCard
code: @[to_additive]
lemma isCyclic_iff_exists_ofOrder_eq_natCard [Finite α] :
    IsCyclic α ↔ ∃ g : α, orderOf g = Nat.card α 
goal: IsCyclic α ↔ ∃ g, orderOf g = Nat.card α

full_name: isAddCyclic_iff_exists_ofOrder_eq_natCard
code: @[to_additive]
lemma isCyclic_iff_exists_ofOrder_eq_natCard [Finite α] :
    IsCyclic α ↔ ∃ g : α, orderOf g = Nat.card α 
goal: IsAddCyclic α ↔ ∃ g, addOrderOf g = Nat.card α

full_name: IsCyclic.image_range_orderOf
code: @[to_additive]
theorem IsCyclic.image_range_orderOf (ha : ∀ x : α, x ∈ zpowers a) :
    Finset.image (fun i => a ^ i) (range (orderOf a)) = univ 
goal: Finset.image (fun i => a ^ i) (Finset.range (orderOf a)) = Finset.univ

full_name: IsAddCyclic.image_range_addOrderOf
code: @[to_additive]
theorem IsCyclic.image_range_orderOf (ha : ∀ x : α, x ∈ zpowers a) :
    Finset.image (fun i => a ^ i) (range (orderOf a)) = univ 
goal: Finset.image (fun i => i • a) (Finset.range (addOrderOf a)) = Finset.univ

full_name: IsAddCyclic.image_range_card
code: @[to_additive]
theorem IsCyclic.image_range_card (ha : ∀ x : α, x ∈ zpowers a) :
    Finset.image (fun i => a ^ i) (range (Fintype.card α)) = univ 
goal: Finset.image (fun i => i • a) (Finset.range (Fintype.card α)) = Finset.univ

full_name: IsCyclic.image_range_card
code: @[to_additive]
theorem IsCyclic.image_range_card (ha : ∀ x : α, x ∈ zpowers a) :
    Finset.image (fun i => a ^ i) (range (Fintype.card α)) = univ 
goal: Finset.image (fun i => a ^ i) (Finset.range (Fintype.card α)) = Finset.univ

full_name: IsCyclic.unique_zpow_zmod
code: @[to_additive]
theorem IsCyclic.unique_zpow_zmod (ha : ∀ x : α, x ∈ zpowers a) (x : α) :
    ∃! n : ZMod (Fintype.card α), x = a ^ n.val 
goal: ∃! n, x = a ^ n.val

full_name: IsAddCyclic.unique_zsmul_zmod
code: @[to_additive]
theorem IsCyclic.unique_zpow_zmod (ha : ∀ x : α, x ∈ zpowers a) (x : α) :
    ∃! n : ZMod (Fintype.card α), x = a ^ n.val 
goal: ∃! n, x = n.val • a

full_name: IsCyclic.ext
code: @[to_additive]
lemma IsCyclic.ext {G : Type*} [Group G] [Fintype G] [IsCyclic G] {d : ℕ} {a b : ZMod d}
    (hGcard : Fintype.card G = d) (h : ∀ t : G, t ^ a.val = t ^ b.val) : a = b 
goal: a = b

full_name: IsAddCyclic.ext
code: @[to_additive]
lemma IsCyclic.ext {G : Type*} [Group G] [Fintype G] [IsCyclic G] {d : ℕ} {a b : ZMod d}
    (hGcard : Fintype.card G = d) (h : ∀ t : G, t ^ a.val = t ^ b.val) : a = b 
goal: a = b

full_name: _private.Mathlib.GroupTheory.SpecificGroups.Cyclic.0.card_pow_eq_one_eq_orderOf_aux
code: @[to_additive]
private theorem card_pow_eq_one_eq_orderOf_aux (a : α) :
    (Finset.univ.filter fun b : α => b ^ orderOf a = 1).card = orderOf a 
goal: (Finset.filter (fun b => b ^ orderOf a = 1) Finset.univ).card = orderOf a

full_name: _private.Mathlib.GroupTheory.SpecificGroups.Cyclic.0.card_nsmul_eq_zero_eq_addOrderOf_aux
code: @[to_additive]
private theorem card_pow_eq_one_eq_orderOf_aux (a : α) :
    (Finset.univ.filter fun b : α => b ^ orderOf a = 1).card = orderOf a 
goal: (Finset.filter (fun b => addOrderOf a • b = 0) Finset.univ).card = addOrderOf a

full_name: _private.Mathlib.GroupTheory.SpecificGroups.Cyclic.0.card_orderOf_eq_totient_aux₁
code: @[to_additive]
private theorem card_orderOf_eq_totient_aux₁ :
    ∀ {d : ℕ},
      d ∣ Fintype.card α →
        0 < (univ.filter fun a : α => orderOf a = d).card →
          (univ.filter fun a : α => orderOf a = d).card = φ d 
goal: d ∣ Fintype.card α →
  0 < (Finset.filter (fun a => orderOf a = d) Finset.univ).card →
    (Finset.filter (fun a => orderOf a = d) Finset.univ).card = d.totient

full_name: _private.Mathlib.GroupTheory.SpecificGroups.Cyclic.0.card_addOrderOf_eq_totient_aux₁
code: @[to_additive]
private theorem card_orderOf_eq_totient_aux₁ :
    ∀ {d : ℕ},
      d ∣ Fintype.card α →
        0 < (univ.filter fun a : α => orderOf a = d).card →
          (univ.filter fun a : α => orderOf a = d).card = φ d 
goal: d ∣ Fintype.card α →
  0 < (Finset.filter (fun a => addOrderOf a = d) Finset.univ).card →
    (Finset.filter (fun a => addOrderOf a = d) Finset.univ).card = d.totient

full_name: card_orderOf_eq_totient_aux₂
code: @[to_additive]
theorem card_orderOf_eq_totient_aux₂ {d : ℕ} (hd : d ∣ Fintype.card α) :
    (univ.filter fun a : α => orderOf a = d).card = φ d 
goal: (Finset.filter (fun a => orderOf a = d) Finset.univ).card = d.totient

full_name: card_addOrderOf_eq_totient_aux₂
code: @[to_additive]
theorem card_orderOf_eq_totient_aux₂ {d : ℕ} (hd : d ∣ Fintype.card α) :
    (univ.filter fun a : α => orderOf a = d).card = φ d 
goal: (Finset.filter (fun a => addOrderOf a = d) Finset.univ).card = d.totient

full_name: isAddCyclic_of_card_nsmul_eq_zero_le
code: @[to_additive isAddCyclic_of_card_nsmul_eq_zero_le]
theorem isCyclic_of_card_pow_eq_one_le : IsCyclic α 
goal: IsAddCyclic α

full_name: isCyclic_of_card_pow_eq_one_le
code: @[to_additive isAddCyclic_of_card_nsmul_eq_zero_le]
theorem isCyclic_of_card_pow_eq_one_le : IsCyclic α 
goal: IsCyclic α

full_name: IsCyclic.card_orderOf_eq_totient
code: @[to_additive]
theorem IsCyclic.card_orderOf_eq_totient [IsCyclic α] [Fintype α] {d : ℕ}
    (hd : d ∣ Fintype.card α) : (univ.filter fun a : α => orderOf a = d).card = totient d 
goal: (Finset.filter (fun a => orderOf a = d) Finset.univ).card = d.totient

full_name: IsAddCyclic.card_addOrderOf_eq_totient
code: @[to_additive]
theorem IsCyclic.card_orderOf_eq_totient [IsCyclic α] [Fintype α] {d : ℕ}
    (hd : d ∣ Fintype.card α) : (univ.filter fun a : α => orderOf a = d).card = totient d 
goal: (Finset.filter (fun a => addOrderOf a = d) Finset.univ).card = d.totient

full_name: isSimpleGroup_of_prime_card
code: /-- A finite group of prime order is simple. -/
@[to_additive "A finite group of prime order is simple."]
theorem isSimpleGroup_of_prime_card {α : Type u} [Group α] [Fintype α] {p : ℕ} [hp : Fact p.Prime]
    (h : Fintype.card α = p) : IsSimpleGroup α 
goal: IsSimpleGroup α

full_name: isSimpleAddGroup_of_prime_card
code: /-- A finite group of prime order is simple. -/
@[to_additive "A finite group of prime order is simple."]
theorem isSimpleGroup_of_prime_card {α : Type u} [Group α] [Fintype α] {p : ℕ} [hp : Fact p.Prime]
    (h : Fintype.card α = p) : IsSimpleGroup α 
goal: IsSimpleAddGroup α

full_name: commutative_of_cyclic_center_quotient
code: /-- A group is commutative if the quotient by the center is cyclic.
  Also see `commGroup_of_cycle_center_quotient` for the `CommGroup` instance. -/
@[to_additive
      "A group is commutative if the quotient by the center is cyclic.
      Also see `addCommGroup_of_cycle_center_quotient` for the `AddCommGroup` instance."]
theorem commutative_of_cyclic_center_quotient [IsCyclic H] (f : G →* H) (hf : f.ker ≤ center G)
    (a b : G) : a * b = b * a 
goal: a * b = b * a

full_name: commutative_of_addCyclic_center_quotient
code: /-- A group is commutative if the quotient by the center is cyclic.
  Also see `commGroup_of_cycle_center_quotient` for the `CommGroup` instance. -/
@[to_additive
      "A group is commutative if the quotient by the center is cyclic.
      Also see `addCommGroup_of_cycle_center_quotient` for the `AddCommGroup` instance."]
theorem commutative_of_cyclic_center_quotient [IsCyclic H] (f : G →* H) (hf : f.ker ≤ center G)
    (a b : G) : a * b = b * a 
goal: a + b = b + a

full_name: commGroupOfCycleCenterQuotient
code: /-- A group is commutative if the quotient by the center is cyclic. -/
@[to_additive commutativeOfAddCycleCenterQuotient
      "A group is commutative if the quotient by the center is cyclic."]
def commGroupOfCycleCenterQuotient [IsCyclic H] (f : G →* H) (hf : f.ker ≤ center G) :
    CommGroup G 
goal: CommGroup G

full_name: commutativeOfAddCycleCenterQuotient
code: /-- A group is commutative if the quotient by the center is cyclic. -/
@[to_additive commutativeOfAddCycleCenterQuotient
      "A group is commutative if the quotient by the center is cyclic."]
def commGroupOfCycleCenterQuotient [IsCyclic H] (f : G →* H) (hf : f.ker ≤ center G) :
    CommGroup G 
goal: AddCommGroup G

full_name: IsSimpleGroup.isCyclic
code: @[to_additive]
instance (priority := 100) isCyclic : IsCyclic α 
goal: IsCyclic α

full_name: IsSimpleAddGroup.isAddCyclic
code: @[to_additive]
instance (priority := 100) isCyclic : IsCyclic α 
goal: IsAddCyclic α

full_name: IsSimpleGroup.prime_card
code: @[to_additive]
theorem prime_card [Fintype α] : (Fintype.card α).Prime 
goal: Nat.Prime (Fintype.card α)

full_name: IsSimpleAddGroup.prime_card
code: @[to_additive]
theorem prime_card [Fintype α] : (Fintype.card α).Prime 
goal: Nat.Prime (Fintype.card α)

full_name: CommGroup.is_simple_iff_isCyclic_and_prime_card
code: @[to_additive]
theorem CommGroup.is_simple_iff_isCyclic_and_prime_card [Fintype α] [CommGroup α] :
    IsSimpleGroup α ↔ IsCyclic α ∧ (Fintype.card α).Prime 
goal: IsSimpleGroup α ↔ IsCyclic α ∧ Nat.Prime (Fintype.card α)

full_name: AddCommGroup.is_simple_iff_isAddCyclic_and_prime_card
code: @[to_additive]
theorem CommGroup.is_simple_iff_isCyclic_and_prime_card [Fintype α] [CommGroup α] :
    IsSimpleGroup α ↔ IsCyclic α ∧ (Fintype.card α).Prime 
goal: IsSimpleAddGroup α ↔ IsAddCyclic α ∧ Nat.Prime (Fintype.card α)

full_name: instIsAddCyclicInt
code: instance : IsAddCyclic ℤ 
goal: IsAddCyclic ℤ

full_name: ZMod.instIsAddCyclic
code: instance ZMod.instIsAddCyclic (n : ℕ) : IsAddCyclic (ZMod n) 
goal: IsAddCyclic (ZMod n)

full_name: ZMod.instIsSimpleAddGroup
code: instance ZMod.instIsSimpleAddGroup {p : ℕ} [Fact p.Prime] : IsSimpleAddGroup (ZMod p) 
goal: IsSimpleAddGroup (ZMod p)

full_name: IsAddCyclic.exponent_eq_card
code: @[to_additive]
theorem IsCyclic.exponent_eq_card [Group α] [IsCyclic α] [Fintype α] :
    exponent α = Fintype.card α 
goal: AddMonoid.exponent α = Fintype.card α

full_name: IsCyclic.exponent_eq_card
code: @[to_additive]
theorem IsCyclic.exponent_eq_card [Group α] [IsCyclic α] [Fintype α] :
    exponent α = Fintype.card α 
goal: Monoid.exponent α = Fintype.card α

full_name: IsAddCyclic.of_exponent_eq_card
code: @[to_additive]
theorem IsCyclic.of_exponent_eq_card [CommGroup α] [Fintype α] (h : exponent α = Fintype.card α) :
    IsCyclic α 
goal: IsAddCyclic α

full_name: IsCyclic.of_exponent_eq_card
code: @[to_additive]
theorem IsCyclic.of_exponent_eq_card [CommGroup α] [Fintype α] (h : exponent α = Fintype.card α) :
    IsCyclic α 
goal: IsCyclic α

full_name: IsCyclic.iff_exponent_eq_card
code: @[to_additive]
theorem IsCyclic.iff_exponent_eq_card [CommGroup α] [Fintype α] :
    IsCyclic α ↔ exponent α = Fintype.card α 
goal: IsCyclic α ↔ Monoid.exponent α = Fintype.card α

full_name: IsAddCyclic.iff_exponent_eq_card
code: @[to_additive]
theorem IsCyclic.iff_exponent_eq_card [CommGroup α] [Fintype α] :
    IsCyclic α ↔ exponent α = Fintype.card α 
goal: IsAddCyclic α ↔ AddMonoid.exponent α = Fintype.card α

full_name: IsCyclic.exponent_eq_zero_of_infinite
code: @[to_additive]
theorem IsCyclic.exponent_eq_zero_of_infinite [Group α] [IsCyclic α] [Infinite α] :
    exponent α = 0 
goal: Monoid.exponent α = 0

full_name: IsAddCyclic.exponent_eq_zero_of_infinite
code: @[to_additive]
theorem IsCyclic.exponent_eq_zero_of_infinite [Group α] [IsCyclic α] [Infinite α] :
    exponent α = 0 
goal: AddMonoid.exponent α = 0

full_name: ZMod.exponent
code: @[simp]
protected theorem ZMod.exponent (n : ℕ) : AddMonoid.exponent (ZMod n) = n 
goal: AddMonoid.exponent (ZMod n) = n

full_name: not_isAddCyclic_iff_exponent_eq_prime
code: /-- A group of order `p ^ 2` is not cyclic if and only if its exponent is `p`. -/
@[to_additive]
lemma not_isCyclic_iff_exponent_eq_prime [Group α] {p : ℕ} (hp : p.Prime)
    (hα : Nat.card α = p ^ 2) : ¬ IsCyclic α ↔ Monoid.exponent α = p 
goal: ¬IsAddCyclic α ↔ AddMonoid.exponent α = p

full_name: not_isCyclic_iff_exponent_eq_prime
code: /-- A group of order `p ^ 2` is not cyclic if and only if its exponent is `p`. -/
@[to_additive]
lemma not_isCyclic_iff_exponent_eq_prime [Group α] {p : ℕ} (hp : p.Prime)
    (hα : Nat.card α = p ^ 2) : ¬ IsCyclic α ↔ Monoid.exponent α = p 
goal: ¬IsCyclic α ↔ Monoid.exponent α = p

full_name: zmultiplesHom_ker_eq
code: /-- The kernel of `zmultiplesHom G g` is equal to the additive subgroup generated by
    `addOrderOf g`. -/
theorem zmultiplesHom_ker_eq [AddGroup G] (g : G) :
    (zmultiplesHom G g).ker = zmultiples ↑(addOrderOf g) 
goal: ((zmultiplesHom G) g).ker = AddSubgroup.zmultiples ↑(addOrderOf g)

full_name: zpowersHom_ker_eq
code: /-- The kernel of `zpowersHom G g` is equal to the subgroup generated by `orderOf g`. -/
theorem zpowersHom_ker_eq [Group G] (g : G) :
    (zpowersHom G g).ker = zpowers (Multiplicative.ofAdd ↑(orderOf g)) 
goal: ((zpowersHom G) g).ker = Subgroup.zpowers (Multiplicative.ofAdd ↑(orderOf g))

full_name: zmodAddCyclicAddEquiv
code: /-- The isomorphism from `ZMod n` to any cyclic additive group of `Nat.card` equal to `n`. -/
noncomputable def zmodAddCyclicAddEquiv [AddGroup G] (h : IsAddCyclic G) :
    ZMod (Nat.card G) ≃+ G 
goal: ZMod (Nat.card G) ≃+ G

full_name: zmodCyclicMulEquiv
code: /-- The isomorphism from `Multiplicative (ZMod n)` to any cyclic group of `Nat.card` equal to `n`.
-/
noncomputable def zmodCyclicMulEquiv [Group G] (h : IsCyclic G) :
    Multiplicative (ZMod (Nat.card G)) ≃* G 
goal: Multiplicative (ZMod (Nat.card G)) ≃* G

full_name: addEquivOfAddCyclicCardEq
code: /-- Two cyclic additive groups of the same cardinality are isomorphic. -/
noncomputable def addEquivOfAddCyclicCardEq [AddGroup G] [AddGroup H] [hG : IsAddCyclic G]
    [hH : IsAddCyclic H] (hcard : Nat.card G = Nat.card H) : G ≃+ H 
goal: G ≃+ H

full_name: mulEquivOfCyclicCardEq
code: /-- Two cyclic groups of the same cardinality are isomorphic. -/
@[to_additive existing]
noncomputable def mulEquivOfCyclicCardEq [Group G] [Group H] [hG : IsCyclic G]
    [hH : IsCyclic H] (hcard : Nat.card G = Nat.card H) : G ≃* H 
goal: G ≃* H

full_name: mulEquivOfPrimeCardEq
code: /-- Two groups of the same prime cardinality are isomorphic. -/
@[to_additive "Two additive groups of the same prime cardinality are isomorphic."]
noncomputable def mulEquivOfPrimeCardEq {p : ℕ} [Fintype G] [Fintype H] [Group G] [Group H]
    [Fact p.Prime] (hG : Fintype.card G = p) (hH : Fintype.card H = p) : G ≃* H 
goal: G ≃* H

full_name: addEquivOfPrimeCardEq
code: /-- Two groups of the same prime cardinality are isomorphic. -/
@[to_additive "Two additive groups of the same prime cardinality are isomorphic."]
noncomputable def mulEquivOfPrimeCardEq {p : ℕ} [Fintype G] [Fintype H] [Group G] [Group H]
    [Fact p.Prime] (hG : Fintype.card G = p) (hH : Fintype.card H = p) : G ≃* H 
goal: G ≃+ H

full_name: addMonoidHomOfForallMemZmultiples
code: /-- If `g` generates the group `G` and `g'` is an element of another group `G'` whose order
divides that of `g`, then there is a homomorphism `G →* G'` mapping `g` to `g'`. -/
@[to_additive
   "If `g` generates the additive group `G` and `g'` is an element of another additive group `G'`
   whose order divides that of `g`, then there is a homomorphism `G →+ G'` mapping `g` to `g'`."]
noncomputable
def monoidHomOfForallMemZpowers : G →* G' 
goal: G →+ G'

full_name: monoidHomOfForallMemZpowers
code: /-- If `g` generates the group `G` and `g'` is an element of another group `G'` whose order
divides that of `g`, then there is a homomorphism `G →* G'` mapping `g` to `g'`. -/
@[to_additive
   "If `g` generates the additive group `G` and `g'` is an element of another additive group `G'`
   whose order divides that of `g`, then there is a homomorphism `G →+ G'` mapping `g` to `g'`."]
noncomputable
def monoidHomOfForallMemZpowers : G →* G' 
goal: G →* G'

full_name: addMonoidHomOfForallMemZmultiples_apply_gen
code: @[to_additive (attr := simp)]
lemma monoidHomOfForallMemZpowers_apply_gen :
    monoidHomOfForallMemZpowers hg hg' g = g' 
goal: (addMonoidHomOfForallMemZmultiples hg hg') g = g'

full_name: monoidHomOfForallMemZpowers_apply_gen
code: @[to_additive (attr := simp)]
lemma monoidHomOfForallMemZpowers_apply_gen :
    monoidHomOfForallMemZpowers hg hg' g = g' 
goal: (monoidHomOfForallMemZpowers hg hg') g = g'

full_name: AddMonoidHom.eq_iff_eq_on_generator
code: /-- Two group homomorphisms `G →* G'` are equal if and only if they agree on a generator of `G`. -/
@[to_additive
   "Two homomorphisms `G →+ G'` of additive groups are equal if and only if they agree
   on a generator of `G`."]
lemma MonoidHom.eq_iff_eq_on_generator (f₁ f₂ : G →* G') : f₁ = f₂ ↔ f₁ g = f₂ g 
goal: f₁ = f₂ ↔ f₁ g = f₂ g

full_name: MonoidHom.eq_iff_eq_on_generator
code: /-- Two group homomorphisms `G →* G'` are equal if and only if they agree on a generator of `G`. -/
@[to_additive
   "Two homomorphisms `G →+ G'` of additive groups are equal if and only if they agree
   on a generator of `G`."]
lemma MonoidHom.eq_iff_eq_on_generator (f₁ f₂ : G →* G') : f₁ = f₂ ↔ f₁ g = f₂ g 
goal: f₁ = f₂ ↔ f₁ g = f₂ g

full_name: MulEquiv.eq_iff_eq_on_generator
code: /-- Two group isomorphisms `G ≃* G'` are equal if and only if they agree on a generator of `G`. -/
@[to_additive
   "Two isomorphisms `G ≃+ G'` of additive groups are equal if and only if they agree
   on a generator of `G`."]
lemma MulEquiv.eq_iff_eq_on_generator (f₁ f₂ : G ≃* G') : f₁ = f₂ ↔ f₁ g = f₂ g 
goal: f₁ = f₂ ↔ f₁ g = f₂ g

full_name: AddEquiv.eq_iff_eq_on_generator
code: /-- Two group isomorphisms `G ≃* G'` are equal if and only if they agree on a generator of `G`. -/
@[to_additive
   "Two isomorphisms `G ≃+ G'` of additive groups are equal if and only if they agree
   on a generator of `G`."]
lemma MulEquiv.eq_iff_eq_on_generator (f₁ f₂ : G ≃* G') : f₁ = f₂ ↔ f₁ g = f₂ g 
goal: f₁ = f₂ ↔ f₁ g = f₂ g

full_name: addEquivOfAddOrderOfEq
code: /-- Given two groups that are generated by elements `g` and `g'` of the same order,
we obtain an isomorphism sending `g` to `g'`. -/
@[to_additive
   "Given two additive groups that are generated by elements `g` and `g'` of the same order,
   we obtain an isomorphism sending `g` to `g'`."]
noncomputable
def mulEquivOfOrderOfEq : G ≃* G' 
goal: G ≃+ G'

full_name: mulEquivOfOrderOfEq
code: /-- Given two groups that are generated by elements `g` and `g'` of the same order,
we obtain an isomorphism sending `g` to `g'`. -/
@[to_additive
   "Given two additive groups that are generated by elements `g` and `g'` of the same order,
   we obtain an isomorphism sending `g` to `g'`."]
noncomputable
def mulEquivOfOrderOfEq : G ≃* G' 
goal: G ≃* G'

full_name: addEquivOfAddOrderOfEq_apply_gen
code: @[to_additive (attr := simp)]
lemma mulEquivOfOrderOfEq_apply_gen : mulEquivOfOrderOfEq hg hg' h g = g' 
goal: (addEquivOfAddOrderOfEq hg hg' h) g = g'

full_name: mulEquivOfOrderOfEq_apply_gen
code: @[to_additive (attr := simp)]
lemma mulEquivOfOrderOfEq_apply_gen : mulEquivOfOrderOfEq hg hg' h g = g' 
goal: (mulEquivOfOrderOfEq hg hg' h) g = g'

full_name: mulEquivOfOrderOfEq_symm
code: @[to_additive (attr := simp)]
lemma mulEquivOfOrderOfEq_symm :
    (mulEquivOfOrderOfEq hg hg' h).symm = mulEquivOfOrderOfEq hg' hg h.symm 
goal: (mulEquivOfOrderOfEq hg hg' h).symm = mulEquivOfOrderOfEq hg' hg ⋯

full_name: addEquivOfAddOrderOfEq_symm
code: @[to_additive (attr := simp)]
lemma mulEquivOfOrderOfEq_symm :
    (mulEquivOfOrderOfEq hg hg' h).symm = mulEquivOfOrderOfEq hg' hg h.symm 
goal: (addEquivOfAddOrderOfEq hg hg' h).symm = addEquivOfAddOrderOfEq hg' hg ⋯

full_name: addEquivOfAddOrderOfEq_symm_apply_gen
code: @[to_additive] -- `simp` can prove this by a combination of the two preceding lemmas
lemma mulEquivOfOrderOfEq_symm_apply_gen : (mulEquivOfOrderOfEq hg hg' h).symm g' = g 
goal: (addEquivOfAddOrderOfEq hg hg' h).symm g' = g

full_name: mulEquivOfOrderOfEq_symm_apply_gen
code: @[to_additive] -- `simp` can prove this by a combination of the two preceding lemmas
lemma mulEquivOfOrderOfEq_symm_apply_gen : (mulEquivOfOrderOfEq hg hg' h).symm g' = g 
goal: (mulEquivOfOrderOfEq hg hg' h).symm g' = g