group_theory.specific_groups.cyclic
⟷
Mathlib.GroupTheory.SpecificGroups.Cyclic
The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(last sync)
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -231,7 +231,7 @@ instance Subgroup.isCyclic {α : Type u} [Group α] [IsCyclic α] (H : Subgroup
by_contradiction fun h =>
Nat.find_min hex
(Int.ofNat_lt.1 <| by
- rw [← hk₄] <;> exact Int.emod_lt_of_pos _ (Int.coe_nat_pos.2 (Nat.find_spec hex).1))
+ rw [← hk₄] <;> exact Int.emod_lt_of_pos _ (Int.natCast_pos.2 (Nat.find_spec hex).1))
⟨Nat.pos_of_ne_zero h, hk₅⟩
⟨k / (Nat.find hex : ℤ),
Subtype.ext_iff_val.2
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -3,7 +3,7 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl
-/
-import Algebra.BigOperators.Order
+import Algebra.Order.BigOperators.Group.Finset
import Data.Nat.Totient
import GroupTheory.OrderOfElement
import GroupTheory.Subgroup.Simple
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -188,7 +188,7 @@ theorem Infinite.orderOf_eq_zero_of_forall_mem_zpowers [Infinite α] {g : α}
rw [zpow_mod_orderOf] at hk
have : 0 ≤ t := Int.emod_nonneg (-k) (by exact_mod_cast ho.ne')
refine' ⟨t.to_nat, _⟩
- rwa [← zpow_coe_nat, Int.toNat_of_nonneg this]
+ rwa [← zpow_natCast, Int.toNat_of_nonneg this]
#align infinite.order_of_eq_zero_of_forall_mem_zpowers Infinite.orderOf_eq_zero_of_forall_mem_zpowers
#align infinite.add_order_of_eq_zero_of_forall_mem_zmultiples Infinite.addOrderOf_eq_zero_of_forall_mem_zmultiples
-/
@@ -210,15 +210,14 @@ instance Subgroup.isCyclic {α : Type u} [Group α] [IsCyclic α] (H : Subgroup
let ⟨x, hx₁, hx₂⟩ := hx
let ⟨k, hk⟩ := hg x
have hex : ∃ n : ℕ, 0 < n ∧ g ^ n ∈ H :=
- ⟨k.natAbs,
- Nat.pos_of_ne_zero fun h => hx₂ <| by rw [← hk, Int.eq_zero_of_natAbs_eq_zero h, zpow_zero],
+ ⟨k.natAbs, Nat.pos_of_ne_zero fun h => hx₂ <| by rw [← hk, Int.natAbs_eq_zero h, zpow_zero],
match k, hk with
- | (k : ℕ), hk => by rw [Int.natAbs_ofNat, ← zpow_coe_nat, hk] <;> exact hx₁
- | -[k+1], hk => by rw [Int.natAbs_of_negSucc, ← Subgroup.inv_mem_iff H] <;> simp_all⟩
+ | (k : ℕ), hk => by rw [Int.natAbs_ofNat, ← zpow_natCast, hk] <;> exact hx₁
+ | -[k+1], hk => by rw [Int.natAbs_negSucc, ← Subgroup.inv_mem_iff H] <;> simp_all⟩
⟨⟨⟨g ^ Nat.find hex, (Nat.find_spec hex).2⟩, fun ⟨x, hx⟩ =>
let ⟨k, hk⟩ := hg x
have hk₁ : g ^ ((Nat.find hex : ℤ) * (k / Nat.find hex)) ∈ zpowers (g ^ Nat.find hex) :=
- ⟨k / Nat.find hex, by rw [← zpow_coe_nat, zpow_mul]⟩
+ ⟨k / Nat.find hex, by rw [← zpow_natCast, zpow_mul]⟩
have hk₂ : g ^ ((Nat.find hex : ℤ) * (k / Nat.find hex)) ∈ H := by rw [zpow_mul];
apply H.zpow_mem; exact_mod_cast (Nat.find_spec hex).2
have hk₃ : g ^ (k % Nat.find hex) ∈ H :=
@@ -226,8 +225,8 @@ instance Subgroup.isCyclic {α : Type u} [Group α] [IsCyclic α] (H : Subgroup
rw [← zpow_add, Int.emod_add_ediv, hk] <;> exact hx
have hk₄ : k % Nat.find hex = (k % Nat.find hex).natAbs := by
rw [Int.natAbs_of_nonneg
- (Int.emod_nonneg _ (Int.coe_nat_ne_zero_iff_pos.2 (Nat.find_spec hex).1))]
- have hk₅ : g ^ (k % Nat.find hex).natAbs ∈ H := by rwa [← zpow_coe_nat, ← hk₄]
+ (Int.emod_nonneg _ (Int.natCast_ne_zero_iff_pos.2 (Nat.find_spec hex).1))]
+ have hk₅ : g ^ (k % Nat.find hex).natAbs ∈ H := by rwa [← zpow_natCast, ← hk₄]
have hk₆ : (k % (Nat.find hex : ℤ)).natAbs = 0 :=
by_contradiction fun h =>
Nat.find_min hex
@@ -238,9 +237,7 @@ instance Subgroup.isCyclic {α : Type u} [Group α] [IsCyclic α] (H : Subgroup
Subtype.ext_iff_val.2
(by
suffices g ^ ((Nat.find hex : ℤ) * (k / Nat.find hex)) = x by simpa [zpow_mul]
- rw [Int.mul_ediv_cancel'
- (Int.dvd_of_emod_eq_zero (Int.eq_zero_of_natAbs_eq_zero hk₆)),
- hk])⟩⟩⟩
+ rw [Int.mul_ediv_cancel' (Int.dvd_of_emod_eq_zero (Int.natAbs_eq_zero hk₆)), hk])⟩⟩⟩
else
by
have : H = (⊥ : Subgroup α) :=
@@ -273,7 +270,7 @@ theorem IsCyclic.card_pow_eq_one_le [DecidableEq α] [Fintype α] [IsCyclic α]
by
have hgmn : g ^ (m * Nat.gcd n (Fintype.card α)) = 1 := by
rw [pow_mul, hm, ← pow_gcd_card_eq_one_iff] <;> exact (mem_filter.1 hx).2
- rw [zpow_coe_nat, ← pow_mul, Nat.mul_div_cancel_left', hm]
+ rw [zpow_natCast, ← pow_mul, Nat.mul_div_cancel_left', hm]
refine' dvd_of_mul_dvd_mul_right (gcd_pos_of_pos_left (Fintype.card α) hn0) _
conv_lhs =>
rw [Nat.div_mul_cancel (Nat.gcd_dvd_right _ _), ←
@@ -351,7 +348,7 @@ private theorem card_pow_eq_one_eq_order_of_aux (a : α) :
mem_filter.2
⟨mem_univ _, by
let ⟨i, hi⟩ := b.2
- rw [← hi, ← zpow_coe_nat, ← zpow_mul, mul_comm, zpow_mul, zpow_coe_nat,
+ rw [← hi, ← zpow_natCast, ← zpow_mul, mul_comm, zpow_mul, zpow_natCast,
pow_orderOf_eq_one, one_zpow]⟩⟩)
fun _ _ h => Subtype.eq (Subtype.mk.inj h))
_ = (univ.filterₓ fun b : α => b ^ orderOf a = 1).card := Fintype.card_ofFinset _ _)
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -120,7 +120,7 @@ theorem isCyclic_of_orderOf_eq_card [Fintype α] (x : α) (hx : orderOf x = Fint
classical
use x
simp_rw [← SetLike.mem_coe, ← Set.eq_univ_iff_forall]
- rw [← Fintype.card_congr (Equiv.Set.univ α), Fintype.card_zpowers] at hx
+ rw [← Fintype.card_congr (Equiv.Set.univ α), Fintype.card_zpowers] at hx
exact Set.eq_of_subset_of_card_le (Set.subset_univ _) (ge_of_eq hx)
#align is_cyclic_of_order_of_eq_card isCyclic_of_orderOf_eq_card
#align is_add_cyclic_of_order_of_eq_card isAddCyclic_of_addOrderOf_eq_card
@@ -139,18 +139,18 @@ theorem isCyclic_of_prime_card {α : Type u} [Group α] [Fintype α] {p : ℕ} [
by
rw [← h]
apply card_subgroup_dvd_card
- rw [Nat.dvd_prime hp.1] at this
+ rw [Nat.dvd_prime hp.1] at this
cases this
- · rw [Fintype.card_eq_one_iff] at this
+ · rw [Fintype.card_eq_one_iff] at this
cases' this with t ht
suffices g = 1 by contradiction
have hgt := ht ⟨g, by change g ∈ Subgroup.zpowers g; exact Subgroup.mem_zpowers g⟩
- rw [← ht 1] at hgt
- change (⟨_, _⟩ : Subgroup.zpowers g) = ⟨_, _⟩ at hgt
+ rw [← ht 1] at hgt
+ change (⟨_, _⟩ : Subgroup.zpowers g) = ⟨_, _⟩ at hgt
simpa using hgt
· use g
intro x
- rw [← h] at this
+ rw [← h] at this
rw [Subgroup.eq_top_of_card_eq _ this]
exact Subgroup.mem_top _⟩
#align is_cyclic_of_prime_card isCyclic_of_prime_card
@@ -185,7 +185,7 @@ theorem Infinite.orderOf_eq_zero_of_forall_mem_zpowers [Infinite α] {g : α}
obtain ⟨k, rfl | rfl⟩ := k.eq_coe_or_neg
· exact ⟨k, by exact_mod_cast hk⟩
let t : ℤ := -k % orderOf g
- rw [zpow_mod_orderOf] at hk
+ rw [zpow_mod_orderOf] at hk
have : 0 ≤ t := Int.emod_nonneg (-k) (by exact_mod_cast ho.ne')
refine' ⟨t.to_nat, _⟩
rwa [← zpow_coe_nat, Int.toNat_of_nonneg this]
@@ -283,7 +283,7 @@ theorem IsCyclic.card_pow_eq_one_le [DecidableEq α] [Fintype α] [IsCyclic α]
let ⟨m, hm⟩ := Nat.gcd_dvd_right n (Fintype.card α)
have hm0 : 0 < m :=
Nat.pos_of_ne_zero fun hm0 => by
- rw [hm0, MulZeroClass.mul_zero, Fintype.card_eq_zero_iff] at hm ; exact hm.elim' 1
+ rw [hm0, MulZeroClass.mul_zero, Fintype.card_eq_zero_iff] at hm; exact hm.elim' 1
simp only [Set.toFinset_card, SetLike.coe_sort_coe]
rw [← Fintype.card_zpowers, orderOf_pow g, orderOf_eq_card_of_forall_mem_zpowers hg]
rw [hm]
@@ -314,7 +314,7 @@ variable [DecidableEq α] [Fintype α]
theorem IsCyclic.image_range_orderOf (ha : ∀ x : α, x ∈ zpowers a) :
Finset.image (fun i => a ^ i) (range (orderOf a)) = univ :=
by
- simp_rw [← SetLike.mem_coe] at ha
+ simp_rw [← SetLike.mem_coe] at ha
simp only [image_range_orderOf, set.eq_univ_iff_forall.mpr ha, Set.toFinset_univ]
#align is_cyclic.image_range_order_of IsCyclic.image_range_orderOf
#align is_add_cyclic.image_range_order_of IsAddCyclic.image_range_addOrderOf
@@ -376,7 +376,7 @@ private theorem card_order_of_eq_totient_aux₁ :
∑ m in d.proper_divisors, φ m :=
by
refine' Finset.sum_congr rfl fun m hm => _
- simp only [mem_filter, mem_range, mem_proper_divisors] at hm
+ simp only [mem_filter, mem_range, mem_proper_divisors] at hm
refine' IH m hm.2 (hm.1.trans hd) (Finset.card_pos.2 ⟨a ^ (d / m), _⟩)
simp only [mem_filter, mem_univ, orderOf_pow a, ha, true_and_iff,
Nat.gcd_eq_right (div_dvd_of_dvd hm.1), Nat.div_div_self hm.1 hd0]
@@ -394,7 +394,7 @@ theorem card_orderOf_eq_totient_aux₂ {d : ℕ} (hd : d ∣ Fintype.card α) :
have hc0 : 0 < c := Fintype.card_pos_iff.2 ⟨1⟩
apply card_order_of_eq_totient_aux₁ hn hd
by_contra h0
- simp only [not_lt, _root_.le_zero_iff, card_eq_zero] at h0
+ simp only [not_lt, _root_.le_zero_iff, card_eq_zero] at h0
apply lt_irrefl c
calc
c = ∑ m in c.divisors, (univ.filter fun a : α => orderOf a = m).card :=
@@ -411,7 +411,7 @@ theorem card_orderOf_eq_totient_aux₂ {d : ℕ} (hd : d ∣ Fintype.card α) :
_ ≤ ∑ m in c.divisors.erase d, φ m :=
by
refine' sum_le_sum fun m hm => _
- have hmc : m ∣ c := by simp only [mem_erase, mem_divisors] at hm ; tauto
+ have hmc : m ∣ c := by simp only [mem_erase, mem_divisors] at hm; tauto
rcases(Filter (fun a : α => orderOf a = m) univ).card.eq_zero_or_pos with (h1 | h1)
· simp [h1]; · simp [card_order_of_eq_totient_aux₁ hn hmc h1]
_ < ∑ m in c.divisors, φ m :=
@@ -467,12 +467,12 @@ theorem isSimpleGroup_of_prime_card {α : Type u} [Group α] [Fintype α] {p :
(h : Fintype.card α = p) : IsSimpleGroup α :=
⟨by
have h' := Nat.Prime.one_lt (Fact.out p.prime)
- rw [← h] at h'
+ rw [← h] at h'
haveI := Fintype.one_lt_card_iff_nontrivial.1 h'
apply exists_pair_ne α, fun H Hn => by
classical
have hcard := card_subgroup_dvd_card H
- rw [h, dvd_prime (Fact.out p.prime)] at hcard
+ rw [h, dvd_prime (Fact.out p.prime)] at hcard
refine' hcard.imp (fun h1 => _) fun hp => _
· haveI := Fintype.card_le_one_iff_subsingleton.1 (le_of_eq h1)
apply eq_bot_of_subsingleton
@@ -562,7 +562,7 @@ theorem prime_card [Fintype α] : (Fintype.card α).Prime :=
have hgo := orderOf_pow g
rw [orderOf_eq_card_of_forall_mem_zpowers hg, Nat.gcd_eq_right_iff_dvd.1 hn,
orderOf_eq_card_of_forall_mem_zpowers, eq_comm,
- Nat.div_eq_iff_eq_mul_left (Nat.pos_of_dvd_of_pos hn h0) hn] at hgo
+ Nat.div_eq_iff_eq_mul_left (Nat.pos_of_dvd_of_pos hn h0) hn] at hgo
· exact (mul_left_cancel₀ (ne_of_gt h0) ((mul_one (Fintype.card α)).trans hgo)).symm
· intro x
rw [h]
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -100,7 +100,7 @@ def IsCyclic.commGroup [hg : Group α] [IsCyclic α] : CommGroup α :=
variable [Group α]
#print MonoidHom.map_cyclic /-
-@[to_additive MonoidAddHom.map_add_cyclic]
+@[to_additive AddMonoidHom.map_addCyclic]
theorem MonoidHom.map_cyclic {G : Type _} [Group G] [h : IsCyclic G] (σ : G →* G) :
∃ m : ℤ, ∀ g : G, σ g = g ^ m :=
by
@@ -110,11 +110,11 @@ theorem MonoidHom.map_cyclic {G : Type _} [Group G] [h : IsCyclic G] (σ : G →
obtain ⟨n, rfl⟩ := hG g
rw [MonoidHom.map_zpow, ← hm, ← zpow_mul, ← zpow_mul']
#align monoid_hom.map_cyclic MonoidHom.map_cyclic
-#align monoid_add_hom.map_add_cyclic MonoidAddHom.map_add_cyclic
+#align monoid_add_hom.map_add_cyclic AddMonoidHom.map_addCyclic
-/
#print isCyclic_of_orderOf_eq_card /-
-@[to_additive isAddCyclic_of_orderOf_eq_card]
+@[to_additive isAddCyclic_of_addOrderOf_eq_card]
theorem isCyclic_of_orderOf_eq_card [Fintype α] (x : α) (hx : orderOf x = Fintype.card α) :
IsCyclic α := by
classical
@@ -123,7 +123,7 @@ theorem isCyclic_of_orderOf_eq_card [Fintype α] (x : α) (hx : orderOf x = Fint
rw [← Fintype.card_congr (Equiv.Set.univ α), Fintype.card_zpowers] at hx
exact Set.eq_of_subset_of_card_le (Set.subset_univ _) (ge_of_eq hx)
#align is_cyclic_of_order_of_eq_card isCyclic_of_orderOf_eq_card
-#align is_add_cyclic_of_order_of_eq_card isAddCyclic_of_orderOf_eq_card
+#align is_add_cyclic_of_order_of_eq_card isAddCyclic_of_addOrderOf_eq_card
-/
#print isCyclic_of_prime_card /-
@@ -259,7 +259,7 @@ open scoped Classical
/- ./././Mathport/Syntax/Translate/Tactic/Lean3.lean:133:4: warning: unsupported: rw with cfg: { occs := occurrences.pos[occurrences.pos] «expr[ ,]»([2, 3]) } -/
#print IsCyclic.card_pow_eq_one_le /-
-@[to_additive IsAddCyclic.card_pow_eq_one_le]
+@[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 :=
let ⟨g, hg⟩ := IsCyclic.exists_generator α
@@ -291,7 +291,7 @@ theorem IsCyclic.card_pow_eq_one_le [DecidableEq α] [Fintype α] [IsCyclic α]
Nat.mul_div_cancel _ hm0]
exact le_of_dvd hn0 (Nat.gcd_dvd_left _ _)
#align is_cyclic.card_pow_eq_one_le IsCyclic.card_pow_eq_one_le
-#align is_add_cyclic.card_pow_eq_one_le IsAddCyclic.card_pow_eq_one_le
+#align is_add_cyclic.card_pow_eq_one_le IsAddCyclic.card_nsmul_eq_zero_le
-/
end Classical
@@ -451,16 +451,14 @@ theorem IsCyclic.card_orderOf_eq_totient [IsCyclic α] [Fintype α] {d : ℕ}
#align is_cyclic.card_order_of_eq_totient IsCyclic.card_orderOf_eq_totient
-/
-#print IsAddCyclic.card_orderOf_eq_totient /-
-theorem IsAddCyclic.card_orderOf_eq_totient {α} [AddGroup α] [IsAddCyclic α] [Fintype α] {d : ℕ}
+theorem IsAddCyclic.card_order_of_eq_totient {α} [AddGroup α] [IsAddCyclic α] [Fintype α] {d : ℕ}
(hd : d ∣ Fintype.card α) : (univ.filterₓ fun a : α => addOrderOf a = d).card = totient d :=
by
obtain ⟨g, hg⟩ := id ‹IsAddCyclic α›
exact @IsCyclic.card_orderOf_eq_totient (Multiplicative α) _ ⟨⟨g, hg⟩⟩ _ _ hd
-#align is_add_cyclic.card_order_of_eq_totient IsAddCyclic.card_orderOf_eq_totient
--/
+#align is_add_cyclic.card_order_of_eq_totient IsAddCyclic.card_order_of_eq_totient
-attribute [to_additive IsCyclic.card_orderOf_eq_totient] IsAddCyclic.card_orderOf_eq_totient
+attribute [to_additive IsCyclic.card_orderOf_eq_totient] IsAddCyclic.card_order_of_eq_totient
#print isSimpleGroup_of_prime_card /-
/-- A finite group of prime order is simple. -/
@@ -494,7 +492,7 @@ variable {G : Type _} {H : Type _} [Group G] [Group H]
#print commutative_of_cyclic_center_quotient /-
/-- A group is commutative if the quotient by the center is cyclic.
Also see `comm_group_of_cycle_center_quotient` for the `comm_group` instance. -/
-@[to_additive commutative_of_add_cyclic_center_quotient
+@[to_additive commutative_of_addCyclic_center_quotient
"A group is commutative if the quotient by\n the center is cyclic. Also see `add_comm_group_of_cycle_center_quotient`\n for the `add_comm_group` instance."]
theorem commutative_of_cyclic_center_quotient [IsCyclic H] (f : G →* H) (hf : f.ker ≤ center G)
(a b : G) : a * b = b * a :=
@@ -514,7 +512,7 @@ theorem commutative_of_cyclic_center_quotient [IsCyclic H] (f : G →* H) (hf :
_ = y ^ m * y ^ n * y ^ (-m) * (y ^ (-n) * b * a) := by rw [mem_center_iff.1 hb]
_ = b * a := by group
#align commutative_of_cyclic_center_quotient commutative_of_cyclic_center_quotient
-#align commutative_of_add_cyclic_center_quotient commutative_of_add_cyclic_center_quotient
+#align commutative_of_add_cyclic_center_quotient commutative_of_addCyclic_center_quotient
-/
#print commGroupOfCycleCenterQuotient /-
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -188,7 +188,7 @@ theorem Infinite.orderOf_eq_zero_of_forall_mem_zpowers [Infinite α] {g : α}
rw [zpow_mod_orderOf] at hk
have : 0 ≤ t := Int.emod_nonneg (-k) (by exact_mod_cast ho.ne')
refine' ⟨t.to_nat, _⟩
- rwa [← zpow_ofNat, Int.toNat_of_nonneg this]
+ rwa [← zpow_coe_nat, Int.toNat_of_nonneg this]
#align infinite.order_of_eq_zero_of_forall_mem_zpowers Infinite.orderOf_eq_zero_of_forall_mem_zpowers
#align infinite.add_order_of_eq_zero_of_forall_mem_zmultiples Infinite.addOrderOf_eq_zero_of_forall_mem_zmultiples
-/
@@ -213,12 +213,12 @@ instance Subgroup.isCyclic {α : Type u} [Group α] [IsCyclic α] (H : Subgroup
⟨k.natAbs,
Nat.pos_of_ne_zero fun h => hx₂ <| by rw [← hk, Int.eq_zero_of_natAbs_eq_zero h, zpow_zero],
match k, hk with
- | (k : ℕ), hk => by rw [Int.natAbs_ofNat, ← zpow_ofNat, hk] <;> exact hx₁
+ | (k : ℕ), hk => by rw [Int.natAbs_ofNat, ← zpow_coe_nat, hk] <;> exact hx₁
| -[k+1], hk => by rw [Int.natAbs_of_negSucc, ← Subgroup.inv_mem_iff H] <;> simp_all⟩
⟨⟨⟨g ^ Nat.find hex, (Nat.find_spec hex).2⟩, fun ⟨x, hx⟩ =>
let ⟨k, hk⟩ := hg x
have hk₁ : g ^ ((Nat.find hex : ℤ) * (k / Nat.find hex)) ∈ zpowers (g ^ Nat.find hex) :=
- ⟨k / Nat.find hex, by rw [← zpow_ofNat, zpow_mul]⟩
+ ⟨k / Nat.find hex, by rw [← zpow_coe_nat, zpow_mul]⟩
have hk₂ : g ^ ((Nat.find hex : ℤ) * (k / Nat.find hex)) ∈ H := by rw [zpow_mul];
apply H.zpow_mem; exact_mod_cast (Nat.find_spec hex).2
have hk₃ : g ^ (k % Nat.find hex) ∈ H :=
@@ -227,7 +227,7 @@ instance Subgroup.isCyclic {α : Type u} [Group α] [IsCyclic α] (H : Subgroup
have hk₄ : k % Nat.find hex = (k % Nat.find hex).natAbs := by
rw [Int.natAbs_of_nonneg
(Int.emod_nonneg _ (Int.coe_nat_ne_zero_iff_pos.2 (Nat.find_spec hex).1))]
- have hk₅ : g ^ (k % Nat.find hex).natAbs ∈ H := by rwa [← zpow_ofNat, ← hk₄]
+ have hk₅ : g ^ (k % Nat.find hex).natAbs ∈ H := by rwa [← zpow_coe_nat, ← hk₄]
have hk₆ : (k % (Nat.find hex : ℤ)).natAbs = 0 :=
by_contradiction fun h =>
Nat.find_min hex
@@ -273,7 +273,7 @@ theorem IsCyclic.card_pow_eq_one_le [DecidableEq α] [Fintype α] [IsCyclic α]
by
have hgmn : g ^ (m * Nat.gcd n (Fintype.card α)) = 1 := by
rw [pow_mul, hm, ← pow_gcd_card_eq_one_iff] <;> exact (mem_filter.1 hx).2
- rw [zpow_ofNat, ← pow_mul, Nat.mul_div_cancel_left', hm]
+ rw [zpow_coe_nat, ← pow_mul, Nat.mul_div_cancel_left', hm]
refine' dvd_of_mul_dvd_mul_right (gcd_pos_of_pos_left (Fintype.card α) hn0) _
conv_lhs =>
rw [Nat.div_mul_cancel (Nat.gcd_dvd_right _ _), ←
@@ -351,7 +351,7 @@ private theorem card_pow_eq_one_eq_order_of_aux (a : α) :
mem_filter.2
⟨mem_univ _, by
let ⟨i, hi⟩ := b.2
- rw [← hi, ← zpow_ofNat, ← zpow_mul, mul_comm, zpow_mul, zpow_ofNat,
+ rw [← hi, ← zpow_coe_nat, ← zpow_mul, mul_comm, zpow_mul, zpow_coe_nat,
pow_orderOf_eq_one, one_zpow]⟩⟩)
fun _ _ h => Subtype.eq (Subtype.mk.inj h))
_ = (univ.filterₓ fun b : α => b ^ orderOf a = 1).card := Fintype.card_ofFinset _ _)
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -56,7 +56,7 @@ attribute [local instance] setFintype
open Subgroup
#print IsAddCyclic /-
-/- ./././Mathport/Syntax/Translate/Command.lean:404:30: infer kinds are unsupported in Lean 4: #[`exists_generator] [] -/
+/- ./././Mathport/Syntax/Translate/Command.lean:400:30: infer kinds are unsupported in Lean 4: #[`exists_generator] [] -/
/-- 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
@@ -64,7 +64,7 @@ class IsAddCyclic (α : Type u) [AddGroup α] : Prop where
-/
#print IsCyclic /-
-/- ./././Mathport/Syntax/Translate/Command.lean:404:30: infer kinds are unsupported in Lean 4: #[`exists_generator] [] -/
+/- ./././Mathport/Syntax/Translate/Command.lean:400:30: infer kinds are unsupported in Lean 4: #[`exists_generator] [] -/
/-- A group is called *cyclic* if it is generated by a single element. -/
@[to_additive IsAddCyclic]
class IsCyclic (α : Type u) [Group α] : Prop where
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -116,7 +116,12 @@ theorem MonoidHom.map_cyclic {G : Type _} [Group G] [h : IsCyclic G] (σ : G →
#print isCyclic_of_orderOf_eq_card /-
@[to_additive isAddCyclic_of_orderOf_eq_card]
theorem isCyclic_of_orderOf_eq_card [Fintype α] (x : α) (hx : orderOf x = Fintype.card α) :
- IsCyclic α := by classical
+ IsCyclic α := by
+ classical
+ use x
+ simp_rw [← SetLike.mem_coe, ← Set.eq_univ_iff_forall]
+ rw [← Fintype.card_congr (Equiv.Set.univ α), Fintype.card_zpowers] at hx
+ exact Set.eq_of_subset_of_card_le (Set.subset_univ _) (ge_of_eq hx)
#align is_cyclic_of_order_of_eq_card isCyclic_of_orderOf_eq_card
#align is_add_cyclic_of_order_of_eq_card isAddCyclic_of_orderOf_eq_card
-/
@@ -128,16 +133,38 @@ theorem isCyclic_of_prime_card {α : Type u} [Group α] [Fintype α] {p : ℕ} [
(h : Fintype.card α = p) : IsCyclic α :=
⟨by
obtain ⟨g, hg⟩ : ∃ g : α, g ≠ 1 := Fintype.exists_ne_of_one_lt_card (h.symm ▸ hp.1.one_lt) 1
- classical⟩
+ classical
+ -- for fintype (subgroup.zpowers g)
+ have : Fintype.card (Subgroup.zpowers g) ∣ p :=
+ by
+ rw [← h]
+ apply card_subgroup_dvd_card
+ rw [Nat.dvd_prime hp.1] at this
+ cases this
+ · rw [Fintype.card_eq_one_iff] at this
+ cases' this with t ht
+ suffices g = 1 by contradiction
+ have hgt := ht ⟨g, by change g ∈ Subgroup.zpowers g; exact Subgroup.mem_zpowers g⟩
+ rw [← ht 1] at hgt
+ change (⟨_, _⟩ : Subgroup.zpowers g) = ⟨_, _⟩ at hgt
+ simpa using hgt
+ · use g
+ intro x
+ rw [← h] at this
+ rw [Subgroup.eq_top_of_card_eq _ this]
+ exact Subgroup.mem_top _⟩
#align is_cyclic_of_prime_card isCyclic_of_prime_card
#align is_add_cyclic_of_prime_card isAddCyclic_of_prime_card
-/
#print orderOf_eq_card_of_forall_mem_zpowers /-
--- for fintype (subgroup.zpowers g)
@[to_additive addOrderOf_eq_card_of_forall_mem_zmultiples]
theorem orderOf_eq_card_of_forall_mem_zpowers [Fintype α] {g : α} (hx : ∀ x, x ∈ zpowers g) :
- orderOf g = Fintype.card α := by classical
+ orderOf g = Fintype.card α := by
+ classical
+ rw [Fintype.card_zpowers]
+ apply Fintype.card_of_finset'
+ simpa using hx
#align order_of_eq_card_of_forall_mem_zpowers orderOf_eq_card_of_forall_mem_zpowers
#align add_order_of_eq_card_of_forall_mem_zmultiples addOrderOf_eq_card_of_forall_mem_zmultiples
-/
@@ -145,7 +172,23 @@ theorem orderOf_eq_card_of_forall_mem_zpowers [Fintype α] {g : α} (hx : ∀ x,
#print Infinite.orderOf_eq_zero_of_forall_mem_zpowers /-
@[to_additive Infinite.addOrderOf_eq_zero_of_forall_mem_zmultiples]
theorem Infinite.orderOf_eq_zero_of_forall_mem_zpowers [Infinite α] {g : α}
- (h : ∀ x, x ∈ zpowers g) : orderOf g = 0 := by classical
+ (h : ∀ x, x ∈ zpowers g) : orderOf g = 0 := by
+ classical
+ rw [orderOf_eq_zero_iff']
+ refine' fun n hn hgn => _
+ have ho := IsOfFinOrder.orderOf_pos ((isOfFinOrder_iff_pow_eq_one g).mpr ⟨n, hn, hgn⟩)
+ obtain ⟨x, hx⟩ :=
+ Infinite.exists_not_mem_finset (Finset.image (pow g) <| Finset.range <| orderOf g)
+ apply hx
+ rw [← IsOfFinOrder.mem_powers_iff_mem_range_orderOf g x ho, Submonoid.mem_powers_iff]
+ obtain ⟨k, hk⟩ := h x
+ obtain ⟨k, rfl | rfl⟩ := k.eq_coe_or_neg
+ · exact ⟨k, by exact_mod_cast hk⟩
+ let t : ℤ := -k % orderOf g
+ rw [zpow_mod_orderOf] at hk
+ have : 0 ≤ t := Int.emod_nonneg (-k) (by exact_mod_cast ho.ne')
+ refine' ⟨t.to_nat, _⟩
+ rwa [← zpow_ofNat, Int.toNat_of_nonneg this]
#align infinite.order_of_eq_zero_of_forall_mem_zpowers Infinite.orderOf_eq_zero_of_forall_mem_zpowers
#align infinite.add_order_of_eq_zero_of_forall_mem_zmultiples Infinite.addOrderOf_eq_zero_of_forall_mem_zmultiples
-/
@@ -404,7 +447,7 @@ end Totient
#print IsCyclic.card_orderOf_eq_totient /-
theorem IsCyclic.card_orderOf_eq_totient [IsCyclic α] [Fintype α] {d : ℕ}
(hd : d ∣ Fintype.card α) : (univ.filterₓ fun a : α => orderOf a = d).card = totient d := by
- classical
+ classical apply card_orderOf_eq_totient_aux₂ (fun n => IsCyclic.card_pow_eq_one_le) hd
#align is_cyclic.card_order_of_eq_totient IsCyclic.card_orderOf_eq_totient
-/
@@ -428,7 +471,14 @@ theorem isSimpleGroup_of_prime_card {α : Type u} [Group α] [Fintype α] {p :
have h' := Nat.Prime.one_lt (Fact.out p.prime)
rw [← h] at h'
haveI := Fintype.one_lt_card_iff_nontrivial.1 h'
- apply exists_pair_ne α, fun H Hn => by classical⟩
+ apply exists_pair_ne α, fun H Hn => by
+ classical
+ have hcard := card_subgroup_dvd_card H
+ rw [h, dvd_prime (Fact.out p.prime)] at hcard
+ refine' hcard.imp (fun h1 => _) fun hp => _
+ · haveI := Fintype.card_le_one_iff_subsingleton.1 (le_of_eq h1)
+ apply eq_bot_of_subsingleton
+ · exact eq_top_of_card_eq _ (hp.trans h.symm)⟩
#align is_simple_group_of_prime_card isSimpleGroup_of_prime_card
#align is_simple_add_group_of_prime_card isSimpleAddGroup_of_prime_card
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -116,12 +116,7 @@ theorem MonoidHom.map_cyclic {G : Type _} [Group G] [h : IsCyclic G] (σ : G →
#print isCyclic_of_orderOf_eq_card /-
@[to_additive isAddCyclic_of_orderOf_eq_card]
theorem isCyclic_of_orderOf_eq_card [Fintype α] (x : α) (hx : orderOf x = Fintype.card α) :
- IsCyclic α := by
- classical
- use x
- simp_rw [← SetLike.mem_coe, ← Set.eq_univ_iff_forall]
- rw [← Fintype.card_congr (Equiv.Set.univ α), Fintype.card_zpowers] at hx
- exact Set.eq_of_subset_of_card_le (Set.subset_univ _) (ge_of_eq hx)
+ IsCyclic α := by classical
#align is_cyclic_of_order_of_eq_card isCyclic_of_orderOf_eq_card
#align is_add_cyclic_of_order_of_eq_card isAddCyclic_of_orderOf_eq_card
-/
@@ -133,38 +128,16 @@ theorem isCyclic_of_prime_card {α : Type u} [Group α] [Fintype α] {p : ℕ} [
(h : Fintype.card α = p) : IsCyclic α :=
⟨by
obtain ⟨g, hg⟩ : ∃ g : α, g ≠ 1 := Fintype.exists_ne_of_one_lt_card (h.symm ▸ hp.1.one_lt) 1
- classical
- -- for fintype (subgroup.zpowers g)
- have : Fintype.card (Subgroup.zpowers g) ∣ p :=
- by
- rw [← h]
- apply card_subgroup_dvd_card
- rw [Nat.dvd_prime hp.1] at this
- cases this
- · rw [Fintype.card_eq_one_iff] at this
- cases' this with t ht
- suffices g = 1 by contradiction
- have hgt := ht ⟨g, by change g ∈ Subgroup.zpowers g; exact Subgroup.mem_zpowers g⟩
- rw [← ht 1] at hgt
- change (⟨_, _⟩ : Subgroup.zpowers g) = ⟨_, _⟩ at hgt
- simpa using hgt
- · use g
- intro x
- rw [← h] at this
- rw [Subgroup.eq_top_of_card_eq _ this]
- exact Subgroup.mem_top _⟩
+ classical⟩
#align is_cyclic_of_prime_card isCyclic_of_prime_card
#align is_add_cyclic_of_prime_card isAddCyclic_of_prime_card
-/
#print orderOf_eq_card_of_forall_mem_zpowers /-
+-- for fintype (subgroup.zpowers g)
@[to_additive addOrderOf_eq_card_of_forall_mem_zmultiples]
theorem orderOf_eq_card_of_forall_mem_zpowers [Fintype α] {g : α} (hx : ∀ x, x ∈ zpowers g) :
- orderOf g = Fintype.card α := by
- classical
- rw [Fintype.card_zpowers]
- apply Fintype.card_of_finset'
- simpa using hx
+ orderOf g = Fintype.card α := by classical
#align order_of_eq_card_of_forall_mem_zpowers orderOf_eq_card_of_forall_mem_zpowers
#align add_order_of_eq_card_of_forall_mem_zmultiples addOrderOf_eq_card_of_forall_mem_zmultiples
-/
@@ -172,23 +145,7 @@ theorem orderOf_eq_card_of_forall_mem_zpowers [Fintype α] {g : α} (hx : ∀ x,
#print Infinite.orderOf_eq_zero_of_forall_mem_zpowers /-
@[to_additive Infinite.addOrderOf_eq_zero_of_forall_mem_zmultiples]
theorem Infinite.orderOf_eq_zero_of_forall_mem_zpowers [Infinite α] {g : α}
- (h : ∀ x, x ∈ zpowers g) : orderOf g = 0 := by
- classical
- rw [orderOf_eq_zero_iff']
- refine' fun n hn hgn => _
- have ho := IsOfFinOrder.orderOf_pos ((isOfFinOrder_iff_pow_eq_one g).mpr ⟨n, hn, hgn⟩)
- obtain ⟨x, hx⟩ :=
- Infinite.exists_not_mem_finset (Finset.image (pow g) <| Finset.range <| orderOf g)
- apply hx
- rw [← IsOfFinOrder.mem_powers_iff_mem_range_orderOf g x ho, Submonoid.mem_powers_iff]
- obtain ⟨k, hk⟩ := h x
- obtain ⟨k, rfl | rfl⟩ := k.eq_coe_or_neg
- · exact ⟨k, by exact_mod_cast hk⟩
- let t : ℤ := -k % orderOf g
- rw [zpow_mod_orderOf] at hk
- have : 0 ≤ t := Int.emod_nonneg (-k) (by exact_mod_cast ho.ne')
- refine' ⟨t.to_nat, _⟩
- rwa [← zpow_ofNat, Int.toNat_of_nonneg this]
+ (h : ∀ x, x ∈ zpowers g) : orderOf g = 0 := by classical
#align infinite.order_of_eq_zero_of_forall_mem_zpowers Infinite.orderOf_eq_zero_of_forall_mem_zpowers
#align infinite.add_order_of_eq_zero_of_forall_mem_zmultiples Infinite.addOrderOf_eq_zero_of_forall_mem_zmultiples
-/
@@ -447,7 +404,7 @@ end Totient
#print IsCyclic.card_orderOf_eq_totient /-
theorem IsCyclic.card_orderOf_eq_totient [IsCyclic α] [Fintype α] {d : ℕ}
(hd : d ∣ Fintype.card α) : (univ.filterₓ fun a : α => orderOf a = d).card = totient d := by
- classical apply card_orderOf_eq_totient_aux₂ (fun n => IsCyclic.card_pow_eq_one_le) hd
+ classical
#align is_cyclic.card_order_of_eq_totient IsCyclic.card_orderOf_eq_totient
-/
@@ -471,14 +428,7 @@ theorem isSimpleGroup_of_prime_card {α : Type u} [Group α] [Fintype α] {p :
have h' := Nat.Prime.one_lt (Fact.out p.prime)
rw [← h] at h'
haveI := Fintype.one_lt_card_iff_nontrivial.1 h'
- apply exists_pair_ne α, fun H Hn => by
- classical
- have hcard := card_subgroup_dvd_card H
- rw [h, dvd_prime (Fact.out p.prime)] at hcard
- refine' hcard.imp (fun h1 => _) fun hp => _
- · haveI := Fintype.card_le_one_iff_subsingleton.1 (le_of_eq h1)
- apply eq_bot_of_subsingleton
- · exact eq_top_of_card_eq _ (hp.trans h.symm)⟩
+ apply exists_pair_ne α, fun H Hn => by classical⟩
#align is_simple_group_of_prime_card isSimpleGroup_of_prime_card
#align is_simple_add_group_of_prime_card isSimpleAddGroup_of_prime_card
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -266,7 +266,7 @@ theorem IsCyclic.card_pow_eq_one_le [DecidableEq α] [Fintype α] [IsCyclic α]
calc
(univ.filterₓ fun a : α => a ^ n = 1).card ≤
(zpowers (g ^ (Fintype.card α / Nat.gcd n (Fintype.card α))) : Set α).toFinset.card :=
- card_le_of_subset fun x hx =>
+ card_le_card fun x hx =>
let ⟨m, hm⟩ := show x ∈ Submonoid.powers g from mem_powers_iff_mem_zpowers.2 <| hg x
Set.mem_toFinset.2
⟨(m / (Fintype.card α / Nat.gcd n (Fintype.card α)) : ℕ),
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -56,7 +56,7 @@ attribute [local instance] setFintype
open Subgroup
#print IsAddCyclic /-
-/- ./././Mathport/Syntax/Translate/Command.lean:394:30: infer kinds are unsupported in Lean 4: #[`exists_generator] [] -/
+/- ./././Mathport/Syntax/Translate/Command.lean:404:30: infer kinds are unsupported in Lean 4: #[`exists_generator] [] -/
/-- 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
@@ -64,7 +64,7 @@ class IsAddCyclic (α : Type u) [AddGroup α] : Prop where
-/
#print IsCyclic /-
-/- ./././Mathport/Syntax/Translate/Command.lean:394:30: infer kinds are unsupported in Lean 4: #[`exists_generator] [] -/
+/- ./././Mathport/Syntax/Translate/Command.lean:404:30: infer kinds are unsupported in Lean 4: #[`exists_generator] [] -/
/-- A group is called *cyclic* if it is generated by a single element. -/
@[to_additive IsAddCyclic]
class IsCyclic (α : Type u) [Group α] : Prop where
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -120,7 +120,7 @@ theorem isCyclic_of_orderOf_eq_card [Fintype α] (x : α) (hx : orderOf x = Fint
classical
use x
simp_rw [← SetLike.mem_coe, ← Set.eq_univ_iff_forall]
- rw [← Fintype.card_congr (Equiv.Set.univ α), orderOf_eq_card_zpowers] at hx
+ rw [← Fintype.card_congr (Equiv.Set.univ α), Fintype.card_zpowers] at hx
exact Set.eq_of_subset_of_card_le (Set.subset_univ _) (ge_of_eq hx)
#align is_cyclic_of_order_of_eq_card isCyclic_of_orderOf_eq_card
#align is_add_cyclic_of_order_of_eq_card isAddCyclic_of_orderOf_eq_card
@@ -162,7 +162,7 @@ theorem isCyclic_of_prime_card {α : Type u} [Group α] [Fintype α] {p : ℕ} [
theorem orderOf_eq_card_of_forall_mem_zpowers [Fintype α] {g : α} (hx : ∀ x, x ∈ zpowers g) :
orderOf g = Fintype.card α := by
classical
- rw [orderOf_eq_card_zpowers]
+ rw [Fintype.card_zpowers]
apply Fintype.card_of_finset'
simpa using hx
#align order_of_eq_card_of_forall_mem_zpowers orderOf_eq_card_of_forall_mem_zpowers
@@ -285,7 +285,7 @@ theorem IsCyclic.card_pow_eq_one_le [DecidableEq α] [Fintype α] [IsCyclic α]
Nat.pos_of_ne_zero fun hm0 => by
rw [hm0, MulZeroClass.mul_zero, Fintype.card_eq_zero_iff] at hm ; exact hm.elim' 1
simp only [Set.toFinset_card, SetLike.coe_sort_coe]
- rw [← orderOf_eq_card_zpowers, orderOf_pow g, orderOf_eq_card_of_forall_mem_zpowers hg]
+ rw [← Fintype.card_zpowers, orderOf_pow g, orderOf_eq_card_of_forall_mem_zpowers hg]
rw [hm]
rw [Nat.mul_div_cancel_left _ (gcd_pos_of_pos_left _ hn0), gcd_mul_left_left, hm,
Nat.mul_div_cancel _ hm0]
@@ -340,7 +340,7 @@ private theorem card_pow_eq_one_eq_order_of_aux (a : α) :
(Finset.univ.filterₓ fun b : α => b ^ orderOf a = 1).card = orderOf a :=
le_antisymm (hn _ (orderOf_pos a))
(calc
- orderOf a = @Fintype.card (zpowers a) (id _) := orderOf_eq_card_zpowers
+ orderOf a = @Fintype.card (zpowers a) (id _) := Fintype.card_zpowers
_ ≤
@Fintype.card (↑(univ.filterₓ fun b : α => b ^ orderOf a = 1) : Set α)
(Fintype.ofFinset _ fun _ => Iff.rfl) :=
@@ -610,7 +610,7 @@ theorem IsCyclic.exponent_eq_card [Group α] [IsCyclic α] [Fintype α] :
obtain ⟨g, hg⟩ := IsCyclic.exists_generator α
apply Nat.dvd_antisymm
· rw [← lcm_order_eq_exponent, Finset.lcm_dvd_iff]
- exact fun b _ => orderOf_dvd_card_univ
+ exact fun b _ => orderOf_dvd_card
rw [← orderOf_eq_card_of_forall_mem_zpowers hg]
exact order_dvd_exponent _
#align is_cyclic.exponent_eq_card IsCyclic.exponent_eq_card
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -176,16 +176,16 @@ theorem Infinite.orderOf_eq_zero_of_forall_mem_zpowers [Infinite α] {g : α}
classical
rw [orderOf_eq_zero_iff']
refine' fun n hn hgn => _
- have ho := orderOf_pos' ((isOfFinOrder_iff_pow_eq_one g).mpr ⟨n, hn, hgn⟩)
+ have ho := IsOfFinOrder.orderOf_pos ((isOfFinOrder_iff_pow_eq_one g).mpr ⟨n, hn, hgn⟩)
obtain ⟨x, hx⟩ :=
Infinite.exists_not_mem_finset (Finset.image (pow g) <| Finset.range <| orderOf g)
apply hx
- rw [← mem_powers_iff_mem_range_order_of' g x ho, Submonoid.mem_powers_iff]
+ rw [← IsOfFinOrder.mem_powers_iff_mem_range_orderOf g x ho, Submonoid.mem_powers_iff]
obtain ⟨k, hk⟩ := h x
obtain ⟨k, rfl | rfl⟩ := k.eq_coe_or_neg
· exact ⟨k, by exact_mod_cast hk⟩
let t : ℤ := -k % orderOf g
- rw [zpow_eq_mod_orderOf] at hk
+ rw [zpow_mod_orderOf] at hk
have : 0 ≤ t := Int.emod_nonneg (-k) (by exact_mod_cast ho.ne')
refine' ⟨t.to_nat, _⟩
rwa [← zpow_ofNat, Int.toNat_of_nonneg this]
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -3,12 +3,12 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl
-/
-import Mathbin.Algebra.BigOperators.Order
-import Mathbin.Data.Nat.Totient
-import Mathbin.GroupTheory.OrderOfElement
-import Mathbin.GroupTheory.Subgroup.Simple
-import Mathbin.Tactic.Group
-import Mathbin.GroupTheory.Exponent
+import Algebra.BigOperators.Order
+import Data.Nat.Totient
+import GroupTheory.OrderOfElement
+import GroupTheory.Subgroup.Simple
+import Tactic.Group
+import GroupTheory.Exponent
#align_import group_theory.specific_groups.cyclic from "leanprover-community/mathlib"@"0b7c740e25651db0ba63648fbae9f9d6f941e31b"
@@ -56,7 +56,7 @@ attribute [local instance] setFintype
open Subgroup
#print IsAddCyclic /-
-/- ./././Mathport/Syntax/Translate/Command.lean:393:30: infer kinds are unsupported in Lean 4: #[`exists_generator] [] -/
+/- ./././Mathport/Syntax/Translate/Command.lean:394:30: infer kinds are unsupported in Lean 4: #[`exists_generator] [] -/
/-- 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
@@ -64,7 +64,7 @@ class IsAddCyclic (α : Type u) [AddGroup α] : Prop where
-/
#print IsCyclic /-
-/- ./././Mathport/Syntax/Translate/Command.lean:393:30: infer kinds are unsupported in Lean 4: #[`exists_generator] [] -/
+/- ./././Mathport/Syntax/Translate/Command.lean:394:30: infer kinds are unsupported in Lean 4: #[`exists_generator] [] -/
/-- A group is called *cyclic* if it is generated by a single element. -/
@[to_additive IsAddCyclic]
class IsCyclic (α : Type u) [Group α] : Prop where
@@ -257,7 +257,7 @@ section Classical
open scoped Classical
-/- ./././Mathport/Syntax/Translate/Tactic/Lean3.lean:132:4: warning: unsupported: rw with cfg: { occs := occurrences.pos[occurrences.pos] «expr[ ,]»([2, 3]) } -/
+/- ./././Mathport/Syntax/Translate/Tactic/Lean3.lean:133:4: warning: unsupported: rw with cfg: { occs := occurrences.pos[occurrences.pos] «expr[ ,]»([2, 3]) } -/
#print IsCyclic.card_pow_eq_one_le /-
@[to_additive IsAddCyclic.card_pow_eq_one_le]
theorem IsCyclic.card_pow_eq_one_le [DecidableEq α] [Fintype α] [IsCyclic α] {n : ℕ} (hn0 : 0 < n) :
mathlib commit https://github.com/leanprover-community/mathlib/commit/8ea5598db6caeddde6cb734aa179cc2408dbd345
@@ -2,11 +2,6 @@
Copyright (c) 2018 Johannes Hölzl. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl
-
-! This file was ported from Lean 3 source module group_theory.specific_groups.cyclic
-! leanprover-community/mathlib commit 0b7c740e25651db0ba63648fbae9f9d6f941e31b
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathbin.Algebra.BigOperators.Order
import Mathbin.Data.Nat.Totient
@@ -15,6 +10,8 @@ import Mathbin.GroupTheory.Subgroup.Simple
import Mathbin.Tactic.Group
import Mathbin.GroupTheory.Exponent
+#align_import group_theory.specific_groups.cyclic from "leanprover-community/mathlib"@"0b7c740e25651db0ba63648fbae9f9d6f941e31b"
+
/-!
# Cyclic groups
mathlib commit https://github.com/leanprover-community/mathlib/commit/9fb8964792b4237dac6200193a0d533f1b3f7423
@@ -59,7 +59,7 @@ attribute [local instance] setFintype
open Subgroup
#print IsAddCyclic /-
-/- ./././Mathport/Syntax/Translate/Command.lean:394:30: infer kinds are unsupported in Lean 4: #[`exists_generator] [] -/
+/- ./././Mathport/Syntax/Translate/Command.lean:393:30: infer kinds are unsupported in Lean 4: #[`exists_generator] [] -/
/-- 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
@@ -67,7 +67,7 @@ class IsAddCyclic (α : Type u) [AddGroup α] : Prop where
-/
#print IsCyclic /-
-/- ./././Mathport/Syntax/Translate/Command.lean:394:30: infer kinds are unsupported in Lean 4: #[`exists_generator] [] -/
+/- ./././Mathport/Syntax/Translate/Command.lean:393:30: infer kinds are unsupported in Lean 4: #[`exists_generator] [] -/
/-- A group is called *cyclic* if it is generated by a single element. -/
@[to_additive IsAddCyclic]
class IsCyclic (α : Type u) [Group α] : Prop where
@@ -102,6 +102,7 @@ def IsCyclic.commGroup [hg : Group α] [IsCyclic α] : CommGroup α :=
variable [Group α]
+#print MonoidHom.map_cyclic /-
@[to_additive MonoidAddHom.map_add_cyclic]
theorem MonoidHom.map_cyclic {G : Type _} [Group G] [h : IsCyclic G] (σ : G →* G) :
∃ m : ℤ, ∀ g : G, σ g = g ^ m :=
@@ -113,6 +114,7 @@ theorem MonoidHom.map_cyclic {G : Type _} [Group G] [h : IsCyclic G] (σ : G →
rw [MonoidHom.map_zpow, ← hm, ← zpow_mul, ← zpow_mul']
#align monoid_hom.map_cyclic MonoidHom.map_cyclic
#align monoid_add_hom.map_add_cyclic MonoidAddHom.map_add_cyclic
+-/
#print isCyclic_of_orderOf_eq_card /-
@[to_additive isAddCyclic_of_orderOf_eq_card]
@@ -158,6 +160,7 @@ theorem isCyclic_of_prime_card {α : Type u} [Group α] [Fintype α] {p : ℕ} [
#align is_add_cyclic_of_prime_card isAddCyclic_of_prime_card
-/
+#print orderOf_eq_card_of_forall_mem_zpowers /-
@[to_additive addOrderOf_eq_card_of_forall_mem_zmultiples]
theorem orderOf_eq_card_of_forall_mem_zpowers [Fintype α] {g : α} (hx : ∀ x, x ∈ zpowers g) :
orderOf g = Fintype.card α := by
@@ -167,7 +170,9 @@ theorem orderOf_eq_card_of_forall_mem_zpowers [Fintype α] {g : α} (hx : ∀ x,
simpa using hx
#align order_of_eq_card_of_forall_mem_zpowers orderOf_eq_card_of_forall_mem_zpowers
#align add_order_of_eq_card_of_forall_mem_zmultiples addOrderOf_eq_card_of_forall_mem_zmultiples
+-/
+#print Infinite.orderOf_eq_zero_of_forall_mem_zpowers /-
@[to_additive Infinite.addOrderOf_eq_zero_of_forall_mem_zmultiples]
theorem Infinite.orderOf_eq_zero_of_forall_mem_zpowers [Infinite α] {g : α}
(h : ∀ x, x ∈ zpowers g) : orderOf g = 0 := by
@@ -189,13 +194,17 @@ theorem Infinite.orderOf_eq_zero_of_forall_mem_zpowers [Infinite α] {g : α}
rwa [← zpow_ofNat, Int.toNat_of_nonneg this]
#align infinite.order_of_eq_zero_of_forall_mem_zpowers Infinite.orderOf_eq_zero_of_forall_mem_zpowers
#align infinite.add_order_of_eq_zero_of_forall_mem_zmultiples Infinite.addOrderOf_eq_zero_of_forall_mem_zmultiples
+-/
+#print Bot.isCyclic /-
@[to_additive Bot.isAddCyclic]
instance Bot.isCyclic {α : Type u} [Group α] : IsCyclic (⊥ : Subgroup α) :=
⟨⟨1, fun x => ⟨0, Subtype.eq <| (zpow_zero (1 : α)).trans <| Eq.symm (Subgroup.mem_bot.1 x.2)⟩⟩⟩
#align bot.is_cyclic Bot.isCyclic
#align bot.is_add_cyclic Bot.isAddCyclic
+-/
+#print Subgroup.isCyclic /-
@[to_additive AddSubgroup.isAddCyclic]
instance Subgroup.isCyclic {α : Type u} [Group α] [IsCyclic α] (H : Subgroup α) : IsCyclic H :=
haveI := Classical.propDecidable
@@ -243,6 +252,7 @@ instance Subgroup.isCyclic {α : Type u} [Group α] [IsCyclic α] (H : Subgroup
clear _let_match <;> subst this <;> infer_instance
#align subgroup.is_cyclic Subgroup.isCyclic
#align add_subgroup.is_add_cyclic AddSubgroup.isAddCyclic
+-/
open Finset Nat
@@ -251,6 +261,7 @@ section Classical
open scoped Classical
/- ./././Mathport/Syntax/Translate/Tactic/Lean3.lean:132:4: warning: unsupported: rw with cfg: { occs := occurrences.pos[occurrences.pos] «expr[ ,]»([2, 3]) } -/
+#print IsCyclic.card_pow_eq_one_le /-
@[to_additive IsAddCyclic.card_pow_eq_one_le]
theorem IsCyclic.card_pow_eq_one_le [DecidableEq α] [Fintype α] [IsCyclic α] {n : ℕ} (hn0 : 0 < n) :
(univ.filterₓ fun a : α => a ^ n = 1).card ≤ n :=
@@ -284,20 +295,24 @@ theorem IsCyclic.card_pow_eq_one_le [DecidableEq α] [Fintype α] [IsCyclic α]
exact le_of_dvd hn0 (Nat.gcd_dvd_left _ _)
#align is_cyclic.card_pow_eq_one_le IsCyclic.card_pow_eq_one_le
#align is_add_cyclic.card_pow_eq_one_le IsAddCyclic.card_pow_eq_one_le
+-/
end Classical
+#print IsCyclic.exists_monoid_generator /-
@[to_additive]
theorem IsCyclic.exists_monoid_generator [Finite α] [IsCyclic α] :
∃ x : α, ∀ y : α, y ∈ Submonoid.powers x := by simp_rw [mem_powers_iff_mem_zpowers];
exact IsCyclic.exists_generator α
#align is_cyclic.exists_monoid_generator IsCyclic.exists_monoid_generator
#align is_add_cyclic.exists_add_monoid_generator IsAddCyclic.exists_addMonoid_generator
+-/
section
variable [DecidableEq α] [Fintype α]
+#print IsCyclic.image_range_orderOf /-
@[to_additive]
theorem IsCyclic.image_range_orderOf (ha : ∀ x : α, x ∈ zpowers a) :
Finset.image (fun i => a ^ i) (range (orderOf a)) = univ :=
@@ -306,13 +321,16 @@ theorem IsCyclic.image_range_orderOf (ha : ∀ x : α, x ∈ zpowers a) :
simp only [image_range_orderOf, set.eq_univ_iff_forall.mpr ha, Set.toFinset_univ]
#align is_cyclic.image_range_order_of IsCyclic.image_range_orderOf
#align is_add_cyclic.image_range_order_of IsAddCyclic.image_range_addOrderOf
+-/
+#print IsCyclic.image_range_card /-
@[to_additive]
theorem IsCyclic.image_range_card (ha : ∀ x : α, x ∈ zpowers a) :
Finset.image (fun i => a ^ i) (range (Fintype.card α)) = univ := by
rw [← orderOf_eq_card_of_forall_mem_zpowers ha, IsCyclic.image_range_orderOf ha]
#align is_cyclic.image_range_card IsCyclic.image_range_card
#align is_add_cyclic.image_range_card IsAddCyclic.image_range_card
+-/
end
@@ -321,8 +339,6 @@ section Totient
variable [DecidableEq α] [Fintype α]
(hn : ∀ n : ℕ, 0 < n → (univ.filterₓ fun a : α => a ^ n = 1).card ≤ n)
-include hn
-
private theorem card_pow_eq_one_eq_order_of_aux (a : α) :
(Finset.univ.filterₓ fun b : α => b ^ orderOf a = 1).card = orderOf a :=
le_antisymm (hn _ (orderOf_pos a))
@@ -373,6 +389,7 @@ private theorem card_order_of_eq_totient_aux₁ :
filter_dvd_eq_divisors hd0, sum_totient, ← ha, card_pow_eq_one_eq_order_of_aux hn a]
simpa [← cons_self_proper_divisors hd0, ← h1] using h2
+#print card_orderOf_eq_totient_aux₂ /-
theorem card_orderOf_eq_totient_aux₂ {d : ℕ} (hd : d ∣ Fintype.card α) :
(univ.filterₓ fun a : α => orderOf a = d).card = φ d :=
by
@@ -404,7 +421,9 @@ theorem card_orderOf_eq_totient_aux₂ {d : ℕ} (hd : d ∣ Fintype.card α) :
(sum_erase_lt_of_pos (mem_divisors.2 ⟨hd, hc0.ne'⟩) (totient_pos (pos_of_dvd_of_pos hd hc0)))
_ = c := sum_totient _
#align card_order_of_eq_totient_aux₂ card_orderOf_eq_totient_aux₂
+-/
+#print isCyclic_of_card_pow_eq_one_le /-
theorem isCyclic_of_card_pow_eq_one_le : IsCyclic α :=
have : (univ.filterₓ fun a : α => orderOf a = Fintype.card α).Nonempty :=
card_pos.1 <| by
@@ -413,29 +432,36 @@ theorem isCyclic_of_card_pow_eq_one_le : IsCyclic α :=
let ⟨x, hx⟩ := this
isCyclic_of_orderOf_eq_card x (Finset.mem_filter.1 hx).2
#align is_cyclic_of_card_pow_eq_one_le isCyclic_of_card_pow_eq_one_le
+-/
+#print isAddCyclic_of_card_pow_eq_one_le /-
theorem isAddCyclic_of_card_pow_eq_one_le {α} [AddGroup α] [DecidableEq α] [Fintype α]
(hn : ∀ n : ℕ, 0 < n → (univ.filterₓ fun a : α => n • a = 0).card ≤ n) : IsAddCyclic α :=
by
obtain ⟨g, hg⟩ := @isCyclic_of_card_pow_eq_one_le (Multiplicative α) _ _ _ hn
exact ⟨⟨g, hg⟩⟩
#align is_add_cyclic_of_card_pow_eq_one_le isAddCyclic_of_card_pow_eq_one_le
+-/
attribute [to_additive isCyclic_of_card_pow_eq_one_le] isAddCyclic_of_card_pow_eq_one_le
end Totient
+#print IsCyclic.card_orderOf_eq_totient /-
theorem IsCyclic.card_orderOf_eq_totient [IsCyclic α] [Fintype α] {d : ℕ}
(hd : d ∣ Fintype.card α) : (univ.filterₓ fun a : α => orderOf a = d).card = totient d := by
classical apply card_orderOf_eq_totient_aux₂ (fun n => IsCyclic.card_pow_eq_one_le) hd
#align is_cyclic.card_order_of_eq_totient IsCyclic.card_orderOf_eq_totient
+-/
+#print IsAddCyclic.card_orderOf_eq_totient /-
theorem IsAddCyclic.card_orderOf_eq_totient {α} [AddGroup α] [IsAddCyclic α] [Fintype α] {d : ℕ}
(hd : d ∣ Fintype.card α) : (univ.filterₓ fun a : α => addOrderOf a = d).card = totient d :=
by
obtain ⟨g, hg⟩ := id ‹IsAddCyclic α›
exact @IsCyclic.card_orderOf_eq_totient (Multiplicative α) _ ⟨⟨g, hg⟩⟩ _ _ hd
#align is_add_cyclic.card_order_of_eq_totient IsAddCyclic.card_orderOf_eq_totient
+-/
attribute [to_additive IsCyclic.card_orderOf_eq_totient] IsAddCyclic.card_orderOf_eq_totient
@@ -468,6 +494,7 @@ open Subgroup
variable {G : Type _} {H : Type _} [Group G] [Group H]
+#print commutative_of_cyclic_center_quotient /-
/-- A group is commutative if the quotient by the center is cyclic.
Also see `comm_group_of_cycle_center_quotient` for the `comm_group` instance. -/
@[to_additive commutative_of_add_cyclic_center_quotient
@@ -491,7 +518,9 @@ theorem commutative_of_cyclic_center_quotient [IsCyclic H] (f : G →* H) (hf :
_ = b * a := by group
#align commutative_of_cyclic_center_quotient commutative_of_cyclic_center_quotient
#align commutative_of_add_cyclic_center_quotient commutative_of_add_cyclic_center_quotient
+-/
+#print commGroupOfCycleCenterQuotient /-
/-- A group is commutative if the quotient by the center is cyclic. -/
@[to_additive commutativeOfAddCycleCenterQuotient
"A group is commutative if the quotient by\n the center is cyclic."]
@@ -500,6 +529,7 @@ def commGroupOfCycleCenterQuotient [IsCyclic H] (f : G →* H) (hf : f.ker ≤ c
{ show Group G by infer_instance with mul_comm := commutative_of_cyclic_center_quotient f hf }
#align comm_group_of_cycle_center_quotient commGroupOfCycleCenterQuotient
#align commutative_of_add_cycle_center_quotient commutativeOfAddCycleCenterQuotient
+-/
end QuotientCenter
mathlib commit https://github.com/leanprover-community/mathlib/commit/a3e83f0fa4391c8740f7d773a7a9b74e311ae2a3
@@ -359,7 +359,7 @@ private theorem card_order_of_eq_totient_aux₁ :
rcases card_pos.1 hpos with ⟨a, ha'⟩
have ha : orderOf a = d := (mem_filter.1 ha').2
have h1 :
- (∑ m in d.proper_divisors, (univ.filter fun a : α => orderOf a = m).card) =
+ ∑ m in d.proper_divisors, (univ.filter fun a : α => orderOf a = m).card =
∑ m in d.proper_divisors, φ m :=
by
refine' Finset.sum_congr rfl fun m hm => _
@@ -368,8 +368,7 @@ private theorem card_order_of_eq_totient_aux₁ :
simp only [mem_filter, mem_univ, orderOf_pow a, ha, true_and_iff,
Nat.gcd_eq_right (div_dvd_of_dvd hm.1), Nat.div_div_self hm.1 hd0]
have h2 :
- (∑ m in d.divisors, (univ.filter fun a : α => orderOf a = m).card) = ∑ m in d.divisors, φ m :=
- by
+ ∑ m in d.divisors, (univ.filter fun a : α => orderOf a = m).card = ∑ m in d.divisors, φ m := by
rw [← filter_dvd_eq_divisors hd0, sum_card_orderOf_eq_card_pow_eq_one hd0,
filter_dvd_eq_divisors hd0, sum_totient, ← ha, card_pow_eq_one_eq_order_of_aux hn a]
simpa [← cons_self_proper_divisors hd0, ← h1] using h2
mathlib commit https://github.com/leanprover-community/mathlib/commit/7e5137f579de09a059a5ce98f364a04e221aabf0
@@ -282,7 +282,6 @@ theorem IsCyclic.card_pow_eq_one_le [DecidableEq α] [Fintype α] [IsCyclic α]
rw [Nat.mul_div_cancel_left _ (gcd_pos_of_pos_left _ hn0), gcd_mul_left_left, hm,
Nat.mul_div_cancel _ hm0]
exact le_of_dvd hn0 (Nat.gcd_dvd_left _ _)
-
#align is_cyclic.card_pow_eq_one_le IsCyclic.card_pow_eq_one_le
#align is_add_cyclic.card_pow_eq_one_le IsAddCyclic.card_pow_eq_one_le
@@ -342,8 +341,7 @@ private theorem card_pow_eq_one_eq_order_of_aux (a : α) :
rw [← hi, ← zpow_ofNat, ← zpow_mul, mul_comm, zpow_mul, zpow_ofNat,
pow_orderOf_eq_one, one_zpow]⟩⟩)
fun _ _ h => Subtype.eq (Subtype.mk.inj h))
- _ = (univ.filterₓ fun b : α => b ^ orderOf a = 1).card := Fintype.card_ofFinset _ _
- )
+ _ = (univ.filterₓ fun b : α => b ^ orderOf a = 1).card := Fintype.card_ofFinset _ _)
open scoped Nat
@@ -406,7 +404,6 @@ theorem card_orderOf_eq_totient_aux₂ {d : ℕ} (hd : d ∣ Fintype.card α) :
_ < ∑ m in c.divisors, φ m :=
(sum_erase_lt_of_pos (mem_divisors.2 ⟨hd, hc0.ne'⟩) (totient_pos (pos_of_dvd_of_pos hd hc0)))
_ = c := sum_totient _
-
#align card_order_of_eq_totient_aux₂ card_orderOf_eq_totient_aux₂
theorem isCyclic_of_card_pow_eq_one_le : IsCyclic α :=
@@ -493,7 +490,6 @@ theorem commutative_of_cyclic_center_quotient [IsCyclic H] (f : G →* H) (hf :
_ = y ^ m * y ^ n * y ^ (-m) * (a * (y ^ (-n) * b)) := by simp [mul_assoc]
_ = y ^ m * y ^ n * y ^ (-m) * (y ^ (-n) * b * a) := by rw [mem_center_iff.1 hb]
_ = b * a := by group
-
#align commutative_of_cyclic_center_quotient commutative_of_cyclic_center_quotient
#align commutative_of_add_cyclic_center_quotient commutative_of_add_cyclic_center_quotient
mathlib commit https://github.com/leanprover-community/mathlib/commit/5f25c089cb34db4db112556f23c50d12da81b297
@@ -59,7 +59,7 @@ attribute [local instance] setFintype
open Subgroup
#print IsAddCyclic /-
-/- ./././Mathport/Syntax/Translate/Command.lean:393:30: infer kinds are unsupported in Lean 4: #[`exists_generator] [] -/
+/- ./././Mathport/Syntax/Translate/Command.lean:394:30: infer kinds are unsupported in Lean 4: #[`exists_generator] [] -/
/-- 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
@@ -67,7 +67,7 @@ class IsAddCyclic (α : Type u) [AddGroup α] : Prop where
-/
#print IsCyclic /-
-/- ./././Mathport/Syntax/Translate/Command.lean:393:30: infer kinds are unsupported in Lean 4: #[`exists_generator] [] -/
+/- ./././Mathport/Syntax/Translate/Command.lean:394:30: infer kinds are unsupported in Lean 4: #[`exists_generator] [] -/
/-- A group is called *cyclic* if it is generated by a single element. -/
@[to_additive IsAddCyclic]
class IsCyclic (α : Type u) [Group α] : Prop where
@@ -119,10 +119,10 @@ theorem MonoidHom.map_cyclic {G : Type _} [Group G] [h : IsCyclic G] (σ : G →
theorem isCyclic_of_orderOf_eq_card [Fintype α] (x : α) (hx : orderOf x = Fintype.card α) :
IsCyclic α := by
classical
- use x
- simp_rw [← SetLike.mem_coe, ← Set.eq_univ_iff_forall]
- rw [← Fintype.card_congr (Equiv.Set.univ α), orderOf_eq_card_zpowers] at hx
- exact Set.eq_of_subset_of_card_le (Set.subset_univ _) (ge_of_eq hx)
+ use x
+ simp_rw [← SetLike.mem_coe, ← Set.eq_univ_iff_forall]
+ rw [← Fintype.card_congr (Equiv.Set.univ α), orderOf_eq_card_zpowers] at hx
+ exact Set.eq_of_subset_of_card_le (Set.subset_univ _) (ge_of_eq hx)
#align is_cyclic_of_order_of_eq_card isCyclic_of_orderOf_eq_card
#align is_add_cyclic_of_order_of_eq_card isAddCyclic_of_orderOf_eq_card
-/
@@ -135,25 +135,25 @@ theorem isCyclic_of_prime_card {α : Type u} [Group α] [Fintype α] {p : ℕ} [
⟨by
obtain ⟨g, hg⟩ : ∃ g : α, g ≠ 1 := Fintype.exists_ne_of_one_lt_card (h.symm ▸ hp.1.one_lt) 1
classical
- -- for fintype (subgroup.zpowers g)
- have : Fintype.card (Subgroup.zpowers g) ∣ p :=
- by
- rw [← h]
- apply card_subgroup_dvd_card
- rw [Nat.dvd_prime hp.1] at this
- cases this
- · rw [Fintype.card_eq_one_iff] at this
- cases' this with t ht
- suffices g = 1 by contradiction
- have hgt := ht ⟨g, by change g ∈ Subgroup.zpowers g; exact Subgroup.mem_zpowers g⟩
- rw [← ht 1] at hgt
- change (⟨_, _⟩ : Subgroup.zpowers g) = ⟨_, _⟩ at hgt
- simpa using hgt
- · use g
- intro x
- rw [← h] at this
- rw [Subgroup.eq_top_of_card_eq _ this]
- exact Subgroup.mem_top _⟩
+ -- for fintype (subgroup.zpowers g)
+ have : Fintype.card (Subgroup.zpowers g) ∣ p :=
+ by
+ rw [← h]
+ apply card_subgroup_dvd_card
+ rw [Nat.dvd_prime hp.1] at this
+ cases this
+ · rw [Fintype.card_eq_one_iff] at this
+ cases' this with t ht
+ suffices g = 1 by contradiction
+ have hgt := ht ⟨g, by change g ∈ Subgroup.zpowers g; exact Subgroup.mem_zpowers g⟩
+ rw [← ht 1] at hgt
+ change (⟨_, _⟩ : Subgroup.zpowers g) = ⟨_, _⟩ at hgt
+ simpa using hgt
+ · use g
+ intro x
+ rw [← h] at this
+ rw [Subgroup.eq_top_of_card_eq _ this]
+ exact Subgroup.mem_top _⟩
#align is_cyclic_of_prime_card isCyclic_of_prime_card
#align is_add_cyclic_of_prime_card isAddCyclic_of_prime_card
-/
@@ -162,9 +162,9 @@ theorem isCyclic_of_prime_card {α : Type u} [Group α] [Fintype α] {p : ℕ} [
theorem orderOf_eq_card_of_forall_mem_zpowers [Fintype α] {g : α} (hx : ∀ x, x ∈ zpowers g) :
orderOf g = Fintype.card α := by
classical
- rw [orderOf_eq_card_zpowers]
- apply Fintype.card_of_finset'
- simpa using hx
+ rw [orderOf_eq_card_zpowers]
+ apply Fintype.card_of_finset'
+ simpa using hx
#align order_of_eq_card_of_forall_mem_zpowers orderOf_eq_card_of_forall_mem_zpowers
#align add_order_of_eq_card_of_forall_mem_zmultiples addOrderOf_eq_card_of_forall_mem_zmultiples
@@ -172,21 +172,21 @@ theorem orderOf_eq_card_of_forall_mem_zpowers [Fintype α] {g : α} (hx : ∀ x,
theorem Infinite.orderOf_eq_zero_of_forall_mem_zpowers [Infinite α] {g : α}
(h : ∀ x, x ∈ zpowers g) : orderOf g = 0 := by
classical
- rw [orderOf_eq_zero_iff']
- refine' fun n hn hgn => _
- have ho := orderOf_pos' ((isOfFinOrder_iff_pow_eq_one g).mpr ⟨n, hn, hgn⟩)
- obtain ⟨x, hx⟩ :=
- Infinite.exists_not_mem_finset (Finset.image (pow g) <| Finset.range <| orderOf g)
- apply hx
- rw [← mem_powers_iff_mem_range_order_of' g x ho, Submonoid.mem_powers_iff]
- obtain ⟨k, hk⟩ := h x
- obtain ⟨k, rfl | rfl⟩ := k.eq_coe_or_neg
- · exact ⟨k, by exact_mod_cast hk⟩
- let t : ℤ := -k % orderOf g
- rw [zpow_eq_mod_orderOf] at hk
- have : 0 ≤ t := Int.emod_nonneg (-k) (by exact_mod_cast ho.ne')
- refine' ⟨t.to_nat, _⟩
- rwa [← zpow_ofNat, Int.toNat_of_nonneg this]
+ rw [orderOf_eq_zero_iff']
+ refine' fun n hn hgn => _
+ have ho := orderOf_pos' ((isOfFinOrder_iff_pow_eq_one g).mpr ⟨n, hn, hgn⟩)
+ obtain ⟨x, hx⟩ :=
+ Infinite.exists_not_mem_finset (Finset.image (pow g) <| Finset.range <| orderOf g)
+ apply hx
+ rw [← mem_powers_iff_mem_range_order_of' g x ho, Submonoid.mem_powers_iff]
+ obtain ⟨k, hk⟩ := h x
+ obtain ⟨k, rfl | rfl⟩ := k.eq_coe_or_neg
+ · exact ⟨k, by exact_mod_cast hk⟩
+ let t : ℤ := -k % orderOf g
+ rw [zpow_eq_mod_orderOf] at hk
+ have : 0 ≤ t := Int.emod_nonneg (-k) (by exact_mod_cast ho.ne')
+ refine' ⟨t.to_nat, _⟩
+ rwa [← zpow_ofNat, Int.toNat_of_nonneg this]
#align infinite.order_of_eq_zero_of_forall_mem_zpowers Infinite.orderOf_eq_zero_of_forall_mem_zpowers
#align infinite.add_order_of_eq_zero_of_forall_mem_zmultiples Infinite.addOrderOf_eq_zero_of_forall_mem_zmultiples
@@ -454,12 +454,12 @@ theorem isSimpleGroup_of_prime_card {α : Type u} [Group α] [Fintype α] {p :
haveI := Fintype.one_lt_card_iff_nontrivial.1 h'
apply exists_pair_ne α, fun H Hn => by
classical
- have hcard := card_subgroup_dvd_card H
- rw [h, dvd_prime (Fact.out p.prime)] at hcard
- refine' hcard.imp (fun h1 => _) fun hp => _
- · haveI := Fintype.card_le_one_iff_subsingleton.1 (le_of_eq h1)
- apply eq_bot_of_subsingleton
- · exact eq_top_of_card_eq _ (hp.trans h.symm)⟩
+ have hcard := card_subgroup_dvd_card H
+ rw [h, dvd_prime (Fact.out p.prime)] at hcard
+ refine' hcard.imp (fun h1 => _) fun hp => _
+ · haveI := Fintype.card_le_one_iff_subsingleton.1 (le_of_eq h1)
+ apply eq_bot_of_subsingleton
+ · exact eq_top_of_card_eq _ (hp.trans h.symm)⟩
#align is_simple_group_of_prime_card isSimpleGroup_of_prime_card
#align is_simple_add_group_of_prime_card isSimpleAddGroup_of_prime_card
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/cca40788df1b8755d5baf17ab2f27dacc2e17acb
@@ -121,7 +121,7 @@ theorem isCyclic_of_orderOf_eq_card [Fintype α] (x : α) (hx : orderOf x = Fint
classical
use x
simp_rw [← SetLike.mem_coe, ← Set.eq_univ_iff_forall]
- rw [← Fintype.card_congr (Equiv.Set.univ α), orderOf_eq_card_zpowers] at hx
+ rw [← Fintype.card_congr (Equiv.Set.univ α), orderOf_eq_card_zpowers] at hx
exact Set.eq_of_subset_of_card_le (Set.subset_univ _) (ge_of_eq hx)
#align is_cyclic_of_order_of_eq_card isCyclic_of_orderOf_eq_card
#align is_add_cyclic_of_order_of_eq_card isAddCyclic_of_orderOf_eq_card
@@ -140,18 +140,18 @@ theorem isCyclic_of_prime_card {α : Type u} [Group α] [Fintype α] {p : ℕ} [
by
rw [← h]
apply card_subgroup_dvd_card
- rw [Nat.dvd_prime hp.1] at this
+ rw [Nat.dvd_prime hp.1] at this
cases this
- · rw [Fintype.card_eq_one_iff] at this
+ · rw [Fintype.card_eq_one_iff] at this
cases' this with t ht
suffices g = 1 by contradiction
have hgt := ht ⟨g, by change g ∈ Subgroup.zpowers g; exact Subgroup.mem_zpowers g⟩
- rw [← ht 1] at hgt
- change (⟨_, _⟩ : Subgroup.zpowers g) = ⟨_, _⟩ at hgt
+ rw [← ht 1] at hgt
+ change (⟨_, _⟩ : Subgroup.zpowers g) = ⟨_, _⟩ at hgt
simpa using hgt
· use g
intro x
- rw [← h] at this
+ rw [← h] at this
rw [Subgroup.eq_top_of_card_eq _ this]
exact Subgroup.mem_top _⟩
#align is_cyclic_of_prime_card isCyclic_of_prime_card
@@ -183,7 +183,7 @@ theorem Infinite.orderOf_eq_zero_of_forall_mem_zpowers [Infinite α] {g : α}
obtain ⟨k, rfl | rfl⟩ := k.eq_coe_or_neg
· exact ⟨k, by exact_mod_cast hk⟩
let t : ℤ := -k % orderOf g
- rw [zpow_eq_mod_orderOf] at hk
+ rw [zpow_eq_mod_orderOf] at hk
have : 0 ≤ t := Int.emod_nonneg (-k) (by exact_mod_cast ho.ne')
refine' ⟨t.to_nat, _⟩
rwa [← zpow_ofNat, Int.toNat_of_nonneg this]
@@ -275,7 +275,7 @@ theorem IsCyclic.card_pow_eq_one_le [DecidableEq α] [Fintype α] [IsCyclic α]
let ⟨m, hm⟩ := Nat.gcd_dvd_right n (Fintype.card α)
have hm0 : 0 < m :=
Nat.pos_of_ne_zero fun hm0 => by
- rw [hm0, MulZeroClass.mul_zero, Fintype.card_eq_zero_iff] at hm; exact hm.elim' 1
+ rw [hm0, MulZeroClass.mul_zero, Fintype.card_eq_zero_iff] at hm ; exact hm.elim' 1
simp only [Set.toFinset_card, SetLike.coe_sort_coe]
rw [← orderOf_eq_card_zpowers, orderOf_pow g, orderOf_eq_card_of_forall_mem_zpowers hg]
rw [hm]
@@ -303,7 +303,7 @@ variable [DecidableEq α] [Fintype α]
theorem IsCyclic.image_range_orderOf (ha : ∀ x : α, x ∈ zpowers a) :
Finset.image (fun i => a ^ i) (range (orderOf a)) = univ :=
by
- simp_rw [← SetLike.mem_coe] at ha
+ simp_rw [← SetLike.mem_coe] at ha
simp only [image_range_orderOf, set.eq_univ_iff_forall.mpr ha, Set.toFinset_univ]
#align is_cyclic.image_range_order_of IsCyclic.image_range_orderOf
#align is_add_cyclic.image_range_order_of IsAddCyclic.image_range_addOrderOf
@@ -365,7 +365,7 @@ private theorem card_order_of_eq_totient_aux₁ :
∑ m in d.proper_divisors, φ m :=
by
refine' Finset.sum_congr rfl fun m hm => _
- simp only [mem_filter, mem_range, mem_proper_divisors] at hm
+ simp only [mem_filter, mem_range, mem_proper_divisors] at hm
refine' IH m hm.2 (hm.1.trans hd) (Finset.card_pos.2 ⟨a ^ (d / m), _⟩)
simp only [mem_filter, mem_univ, orderOf_pow a, ha, true_and_iff,
Nat.gcd_eq_right (div_dvd_of_dvd hm.1), Nat.div_div_self hm.1 hd0]
@@ -383,7 +383,7 @@ theorem card_orderOf_eq_totient_aux₂ {d : ℕ} (hd : d ∣ Fintype.card α) :
have hc0 : 0 < c := Fintype.card_pos_iff.2 ⟨1⟩
apply card_order_of_eq_totient_aux₁ hn hd
by_contra h0
- simp only [not_lt, _root_.le_zero_iff, card_eq_zero] at h0
+ simp only [not_lt, _root_.le_zero_iff, card_eq_zero] at h0
apply lt_irrefl c
calc
c = ∑ m in c.divisors, (univ.filter fun a : α => orderOf a = m).card :=
@@ -400,7 +400,7 @@ theorem card_orderOf_eq_totient_aux₂ {d : ℕ} (hd : d ∣ Fintype.card α) :
_ ≤ ∑ m in c.divisors.erase d, φ m :=
by
refine' sum_le_sum fun m hm => _
- have hmc : m ∣ c := by simp only [mem_erase, mem_divisors] at hm; tauto
+ have hmc : m ∣ c := by simp only [mem_erase, mem_divisors] at hm ; tauto
rcases(Filter (fun a : α => orderOf a = m) univ).card.eq_zero_or_pos with (h1 | h1)
· simp [h1]; · simp [card_order_of_eq_totient_aux₁ hn hmc h1]
_ < ∑ m in c.divisors, φ m :=
@@ -450,12 +450,12 @@ theorem isSimpleGroup_of_prime_card {α : Type u} [Group α] [Fintype α] {p :
(h : Fintype.card α = p) : IsSimpleGroup α :=
⟨by
have h' := Nat.Prime.one_lt (Fact.out p.prime)
- rw [← h] at h'
+ rw [← h] at h'
haveI := Fintype.one_lt_card_iff_nontrivial.1 h'
apply exists_pair_ne α, fun H Hn => by
classical
have hcard := card_subgroup_dvd_card H
- rw [h, dvd_prime (Fact.out p.prime)] at hcard
+ rw [h, dvd_prime (Fact.out p.prime)] at hcard
refine' hcard.imp (fun h1 => _) fun hp => _
· haveI := Fintype.card_le_one_iff_subsingleton.1 (le_of_eq h1)
apply eq_bot_of_subsingleton
@@ -542,7 +542,7 @@ theorem prime_card [Fintype α] : (Fintype.card α).Prime :=
have hgo := orderOf_pow g
rw [orderOf_eq_card_of_forall_mem_zpowers hg, Nat.gcd_eq_right_iff_dvd.1 hn,
orderOf_eq_card_of_forall_mem_zpowers, eq_comm,
- Nat.div_eq_iff_eq_mul_left (Nat.pos_of_dvd_of_pos hn h0) hn] at hgo
+ Nat.div_eq_iff_eq_mul_left (Nat.pos_of_dvd_of_pos hn h0) hn] at hgo
· exact (mul_left_cancel₀ (ne_of_gt h0) ((mul_one (Fintype.card α)).trans hgo)).symm
· intro x
rw [h]
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -52,7 +52,7 @@ variable {α : Type u} {a : α}
section Cyclic
-open BigOperators
+open scoped BigOperators
attribute [local instance] setFintype
@@ -248,7 +248,7 @@ open Finset Nat
section Classical
-open Classical
+open scoped Classical
/- ./././Mathport/Syntax/Translate/Tactic/Lean3.lean:132:4: warning: unsupported: rw with cfg: { occs := occurrences.pos[occurrences.pos] «expr[ ,]»([2, 3]) } -/
@[to_additive IsAddCyclic.card_pow_eq_one_le]
@@ -345,7 +345,7 @@ private theorem card_pow_eq_one_eq_order_of_aux (a : α) :
_ = (univ.filterₓ fun b : α => b ^ orderOf a = 1).card := Fintype.card_ofFinset _ _
)
-open Nat
+open scoped Nat
-- use φ for nat.totient
private theorem card_order_of_eq_totient_aux₁ :
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -102,12 +102,6 @@ def IsCyclic.commGroup [hg : Group α] [IsCyclic α] : CommGroup α :=
variable [Group α]
-/- warning: monoid_hom.map_cyclic -> MonoidHom.map_cyclic is a dubious translation:
-lean 3 declaration is
- forall {G : Type.{u1}} [_inst_2 : Group.{u1} G] [h : IsCyclic.{u1} G _inst_2] (σ : MonoidHom.{u1, u1} G G (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_2))) (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_2)))), Exists.{1} Int (fun (m : Int) => forall (g : G), Eq.{succ u1} G (coeFn.{succ u1, succ u1} (MonoidHom.{u1, u1} G G (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_2))) (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_2)))) (fun (_x : MonoidHom.{u1, u1} G G (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_2))) (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_2)))) => G -> G) (MonoidHom.hasCoeToFun.{u1, u1} G G (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_2))) (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_2)))) σ g) (HPow.hPow.{u1, 0, u1} G Int G (instHPow.{u1, 0} G Int (DivInvMonoid.Pow.{u1} G (Group.toDivInvMonoid.{u1} G _inst_2))) g m))
-but is expected to have type
- forall {G : Type.{u1}} [_inst_2 : Group.{u1} G] [h : IsCyclic.{u1} G _inst_2] (σ : MonoidHom.{u1, u1} G G (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_2))) (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_2)))), Exists.{1} Int (fun (m : Int) => forall (g : G), Eq.{succ u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : G) => G) g) (FunLike.coe.{succ u1, succ u1, succ u1} (MonoidHom.{u1, u1} G G (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_2))) (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_2)))) G (fun (_x : G) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : G) => G) _x) (MulHomClass.toFunLike.{u1, u1, u1} (MonoidHom.{u1, u1} G G (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_2))) (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_2)))) G G (MulOneClass.toMul.{u1} G (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_2)))) (MulOneClass.toMul.{u1} G (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_2)))) (MonoidHomClass.toMulHomClass.{u1, u1, u1} (MonoidHom.{u1, u1} G G (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_2))) (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_2)))) G G (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_2))) (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_2))) (MonoidHom.monoidHomClass.{u1, u1} G G (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_2))) (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_2)))))) σ g) (HPow.hPow.{u1, 0, u1} G Int G (instHPow.{u1, 0} G Int (DivInvMonoid.Pow.{u1} G (Group.toDivInvMonoid.{u1} G _inst_2))) g m))
-Case conversion may be inaccurate. Consider using '#align monoid_hom.map_cyclic MonoidHom.map_cyclicₓ'. -/
@[to_additive MonoidAddHom.map_add_cyclic]
theorem MonoidHom.map_cyclic {G : Type _} [Group G] [h : IsCyclic G] (σ : G →* G) :
∃ m : ℤ, ∀ g : G, σ g = g ^ m :=
@@ -164,12 +158,6 @@ theorem isCyclic_of_prime_card {α : Type u} [Group α] [Fintype α] {p : ℕ} [
#align is_add_cyclic_of_prime_card isAddCyclic_of_prime_card
-/
-/- warning: order_of_eq_card_of_forall_mem_zpowers -> orderOf_eq_card_of_forall_mem_zpowers is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Group.{u1} α] [_inst_2 : Fintype.{u1} α] {g : α}, (forall (x : α), Membership.Mem.{u1, u1} α (Subgroup.{u1} α _inst_1) (SetLike.hasMem.{u1, u1} (Subgroup.{u1} α _inst_1) α (Subgroup.setLike.{u1} α _inst_1)) x (Subgroup.zpowers.{u1} α _inst_1 g)) -> (Eq.{1} Nat (orderOf.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)) g) (Fintype.card.{u1} α _inst_2))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Group.{u1} α] [_inst_2 : Fintype.{u1} α] {g : α}, (forall (x : α), Membership.mem.{u1, u1} α (Subgroup.{u1} α _inst_1) (SetLike.instMembership.{u1, u1} (Subgroup.{u1} α _inst_1) α (Subgroup.instSetLikeSubgroup.{u1} α _inst_1)) x (Subgroup.zpowers.{u1} α _inst_1 g)) -> (Eq.{1} Nat (orderOf.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)) g) (Fintype.card.{u1} α _inst_2))
-Case conversion may be inaccurate. Consider using '#align order_of_eq_card_of_forall_mem_zpowers orderOf_eq_card_of_forall_mem_zpowersₓ'. -/
@[to_additive addOrderOf_eq_card_of_forall_mem_zmultiples]
theorem orderOf_eq_card_of_forall_mem_zpowers [Fintype α] {g : α} (hx : ∀ x, x ∈ zpowers g) :
orderOf g = Fintype.card α := by
@@ -180,12 +168,6 @@ theorem orderOf_eq_card_of_forall_mem_zpowers [Fintype α] {g : α} (hx : ∀ x,
#align order_of_eq_card_of_forall_mem_zpowers orderOf_eq_card_of_forall_mem_zpowers
#align add_order_of_eq_card_of_forall_mem_zmultiples addOrderOf_eq_card_of_forall_mem_zmultiples
-/- warning: infinite.order_of_eq_zero_of_forall_mem_zpowers -> Infinite.orderOf_eq_zero_of_forall_mem_zpowers is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Group.{u1} α] [_inst_2 : Infinite.{succ u1} α] {g : α}, (forall (x : α), Membership.Mem.{u1, u1} α (Subgroup.{u1} α _inst_1) (SetLike.hasMem.{u1, u1} (Subgroup.{u1} α _inst_1) α (Subgroup.setLike.{u1} α _inst_1)) x (Subgroup.zpowers.{u1} α _inst_1 g)) -> (Eq.{1} Nat (orderOf.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)) g) (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Group.{u1} α] [_inst_2 : Infinite.{succ u1} α] {g : α}, (forall (x : α), Membership.mem.{u1, u1} α (Subgroup.{u1} α _inst_1) (SetLike.instMembership.{u1, u1} (Subgroup.{u1} α _inst_1) α (Subgroup.instSetLikeSubgroup.{u1} α _inst_1)) x (Subgroup.zpowers.{u1} α _inst_1 g)) -> (Eq.{1} Nat (orderOf.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)) g) (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))
-Case conversion may be inaccurate. Consider using '#align infinite.order_of_eq_zero_of_forall_mem_zpowers Infinite.orderOf_eq_zero_of_forall_mem_zpowersₓ'. -/
@[to_additive Infinite.addOrderOf_eq_zero_of_forall_mem_zmultiples]
theorem Infinite.orderOf_eq_zero_of_forall_mem_zpowers [Infinite α] {g : α}
(h : ∀ x, x ∈ zpowers g) : orderOf g = 0 := by
@@ -208,24 +190,12 @@ theorem Infinite.orderOf_eq_zero_of_forall_mem_zpowers [Infinite α] {g : α}
#align infinite.order_of_eq_zero_of_forall_mem_zpowers Infinite.orderOf_eq_zero_of_forall_mem_zpowers
#align infinite.add_order_of_eq_zero_of_forall_mem_zmultiples Infinite.addOrderOf_eq_zero_of_forall_mem_zmultiples
-/- warning: bot.is_cyclic -> Bot.isCyclic is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_2 : Group.{u1} α], IsCyclic.{u1} (coeSort.{succ u1, succ (succ u1)} (Subgroup.{u1} α _inst_2) Type.{u1} (SetLike.hasCoeToSort.{u1, u1} (Subgroup.{u1} α _inst_2) α (Subgroup.setLike.{u1} α _inst_2)) (Bot.bot.{u1} (Subgroup.{u1} α _inst_2) (Subgroup.hasBot.{u1} α _inst_2))) (Subgroup.toGroup.{u1} α _inst_2 (Bot.bot.{u1} (Subgroup.{u1} α _inst_2) (Subgroup.hasBot.{u1} α _inst_2)))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_2 : Group.{u1} α], IsCyclic.{u1} (Subtype.{succ u1} α (fun (x : α) => Membership.mem.{u1, u1} α (Subgroup.{u1} α _inst_2) (SetLike.instMembership.{u1, u1} (Subgroup.{u1} α _inst_2) α (Subgroup.instSetLikeSubgroup.{u1} α _inst_2)) x (Bot.bot.{u1} (Subgroup.{u1} α _inst_2) (Subgroup.instBotSubgroup.{u1} α _inst_2)))) (Subgroup.toGroup.{u1} α _inst_2 (Bot.bot.{u1} (Subgroup.{u1} α _inst_2) (Subgroup.instBotSubgroup.{u1} α _inst_2)))
-Case conversion may be inaccurate. Consider using '#align bot.is_cyclic Bot.isCyclicₓ'. -/
@[to_additive Bot.isAddCyclic]
instance Bot.isCyclic {α : Type u} [Group α] : IsCyclic (⊥ : Subgroup α) :=
⟨⟨1, fun x => ⟨0, Subtype.eq <| (zpow_zero (1 : α)).trans <| Eq.symm (Subgroup.mem_bot.1 x.2)⟩⟩⟩
#align bot.is_cyclic Bot.isCyclic
#align bot.is_add_cyclic Bot.isAddCyclic
-/- warning: subgroup.is_cyclic -> Subgroup.isCyclic is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_2 : Group.{u1} α] [_inst_3 : IsCyclic.{u1} α _inst_2] (H : Subgroup.{u1} α _inst_2), IsCyclic.{u1} (coeSort.{succ u1, succ (succ u1)} (Subgroup.{u1} α _inst_2) Type.{u1} (SetLike.hasCoeToSort.{u1, u1} (Subgroup.{u1} α _inst_2) α (Subgroup.setLike.{u1} α _inst_2)) H) (Subgroup.toGroup.{u1} α _inst_2 H)
-but is expected to have type
- forall {α : Type.{u1}} [_inst_2 : Group.{u1} α] [_inst_3 : IsCyclic.{u1} α _inst_2] (H : Subgroup.{u1} α _inst_2), IsCyclic.{u1} (Subtype.{succ u1} α (fun (x : α) => Membership.mem.{u1, u1} α (Subgroup.{u1} α _inst_2) (SetLike.instMembership.{u1, u1} (Subgroup.{u1} α _inst_2) α (Subgroup.instSetLikeSubgroup.{u1} α _inst_2)) x H)) (Subgroup.toGroup.{u1} α _inst_2 H)
-Case conversion may be inaccurate. Consider using '#align subgroup.is_cyclic Subgroup.isCyclicₓ'. -/
@[to_additive AddSubgroup.isAddCyclic]
instance Subgroup.isCyclic {α : Type u} [Group α] [IsCyclic α] (H : Subgroup α) : IsCyclic H :=
haveI := Classical.propDecidable
@@ -280,12 +250,6 @@ section Classical
open Classical
-/- warning: is_cyclic.card_pow_eq_one_le -> IsCyclic.card_pow_eq_one_le is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Group.{u1} α] [_inst_2 : DecidableEq.{succ u1} α] [_inst_3 : Fintype.{u1} α] [_inst_4 : IsCyclic.{u1} α _inst_1] {n : Nat}, (LT.lt.{0} Nat Nat.hasLt (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) n) -> (LE.le.{0} Nat Nat.hasLe (Finset.card.{u1} α (Finset.filter.{u1} α (fun (a : α) => Eq.{succ u1} α (HPow.hPow.{u1, 0, u1} α Nat α (instHPow.{u1, 0} α Nat (Monoid.Pow.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))) a n) (OfNat.ofNat.{u1} α 1 (OfNat.mk.{u1} α 1 (One.one.{u1} α (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))))))) (fun (a : α) => _inst_2 (HPow.hPow.{u1, 0, u1} α Nat α (instHPow.{u1, 0} α Nat (Monoid.Pow.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))) a n) (OfNat.ofNat.{u1} α 1 (OfNat.mk.{u1} α 1 (One.one.{u1} α (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))))))) (Finset.univ.{u1} α _inst_3))) n)
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Group.{u1} α] [_inst_2 : DecidableEq.{succ u1} α] [_inst_3 : Fintype.{u1} α] [_inst_4 : IsCyclic.{u1} α _inst_1] {n : Nat}, (LT.lt.{0} Nat instLTNat (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) n) -> (LE.le.{0} Nat instLENat (Finset.card.{u1} α (Finset.filter.{u1} α (fun (a : α) => Eq.{succ u1} α (HPow.hPow.{u1, 0, u1} α Nat α (instHPow.{u1, 0} α Nat (Monoid.Pow.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))) a n) (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α (InvOneClass.toOne.{u1} α (DivInvOneMonoid.toInvOneClass.{u1} α (DivisionMonoid.toDivInvOneMonoid.{u1} α (Group.toDivisionMonoid.{u1} α _inst_1))))))) (fun (a : α) => _inst_2 (HPow.hPow.{u1, 0, u1} α Nat α (instHPow.{u1, 0} α Nat (Monoid.Pow.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))) a n) (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α (InvOneClass.toOne.{u1} α (DivInvOneMonoid.toInvOneClass.{u1} α (DivisionMonoid.toDivInvOneMonoid.{u1} α (Group.toDivisionMonoid.{u1} α _inst_1))))))) (Finset.univ.{u1} α _inst_3))) n)
-Case conversion may be inaccurate. Consider using '#align is_cyclic.card_pow_eq_one_le IsCyclic.card_pow_eq_one_leₓ'. -/
/- ./././Mathport/Syntax/Translate/Tactic/Lean3.lean:132:4: warning: unsupported: rw with cfg: { occs := occurrences.pos[occurrences.pos] «expr[ ,]»([2, 3]) } -/
@[to_additive IsAddCyclic.card_pow_eq_one_le]
theorem IsCyclic.card_pow_eq_one_le [DecidableEq α] [Fintype α] [IsCyclic α] {n : ℕ} (hn0 : 0 < n) :
@@ -324,12 +288,6 @@ theorem IsCyclic.card_pow_eq_one_le [DecidableEq α] [Fintype α] [IsCyclic α]
end Classical
-/- warning: is_cyclic.exists_monoid_generator -> IsCyclic.exists_monoid_generator is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Group.{u1} α] [_inst_2 : Finite.{succ u1} α] [_inst_3 : IsCyclic.{u1} α _inst_1], Exists.{succ u1} α (fun (x : α) => forall (y : α), Membership.Mem.{u1, u1} α (Submonoid.{u1} α (Monoid.toMulOneClass.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))) (SetLike.hasMem.{u1, u1} (Submonoid.{u1} α (Monoid.toMulOneClass.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))) α (Submonoid.setLike.{u1} α (Monoid.toMulOneClass.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1))))) y (Submonoid.powers.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)) x))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Group.{u1} α] [_inst_2 : Finite.{succ u1} α] [_inst_3 : IsCyclic.{u1} α _inst_1], Exists.{succ u1} α (fun (x : α) => forall (y : α), Membership.mem.{u1, u1} α (Submonoid.{u1} α (Monoid.toMulOneClass.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))) (SetLike.instMembership.{u1, u1} (Submonoid.{u1} α (Monoid.toMulOneClass.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))) α (Submonoid.instSetLikeSubmonoid.{u1} α (Monoid.toMulOneClass.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1))))) y (Submonoid.powers.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)) x))
-Case conversion may be inaccurate. Consider using '#align is_cyclic.exists_monoid_generator IsCyclic.exists_monoid_generatorₓ'. -/
@[to_additive]
theorem IsCyclic.exists_monoid_generator [Finite α] [IsCyclic α] :
∃ x : α, ∀ y : α, y ∈ Submonoid.powers x := by simp_rw [mem_powers_iff_mem_zpowers];
@@ -341,12 +299,6 @@ section
variable [DecidableEq α] [Fintype α]
-/- warning: is_cyclic.image_range_order_of -> IsCyclic.image_range_orderOf is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {a : α} [_inst_1 : Group.{u1} α] [_inst_2 : DecidableEq.{succ u1} α] [_inst_3 : Fintype.{u1} α], (forall (x : α), Membership.Mem.{u1, u1} α (Subgroup.{u1} α _inst_1) (SetLike.hasMem.{u1, u1} (Subgroup.{u1} α _inst_1) α (Subgroup.setLike.{u1} α _inst_1)) x (Subgroup.zpowers.{u1} α _inst_1 a)) -> (Eq.{succ u1} (Finset.{u1} α) (Finset.image.{0, u1} Nat α (fun (a : α) (b : α) => _inst_2 a b) (fun (i : Nat) => HPow.hPow.{u1, 0, u1} α Nat α (instHPow.{u1, 0} α Nat (Monoid.Pow.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))) a i) (Finset.range (orderOf.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)) a))) (Finset.univ.{u1} α _inst_3))
-but is expected to have type
- forall {α : Type.{u1}} {a : α} [_inst_1 : Group.{u1} α] [_inst_2 : DecidableEq.{succ u1} α] [_inst_3 : Fintype.{u1} α], (forall (x : α), Membership.mem.{u1, u1} α (Subgroup.{u1} α _inst_1) (SetLike.instMembership.{u1, u1} (Subgroup.{u1} α _inst_1) α (Subgroup.instSetLikeSubgroup.{u1} α _inst_1)) x (Subgroup.zpowers.{u1} α _inst_1 a)) -> (Eq.{succ u1} (Finset.{u1} α) (Finset.image.{0, u1} Nat α (fun (a : α) (b : α) => _inst_2 a b) (fun (i : Nat) => HPow.hPow.{u1, 0, u1} α Nat α (instHPow.{u1, 0} α Nat (Monoid.Pow.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))) a i) (Finset.range (orderOf.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)) a))) (Finset.univ.{u1} α _inst_3))
-Case conversion may be inaccurate. Consider using '#align is_cyclic.image_range_order_of IsCyclic.image_range_orderOfₓ'. -/
@[to_additive]
theorem IsCyclic.image_range_orderOf (ha : ∀ x : α, x ∈ zpowers a) :
Finset.image (fun i => a ^ i) (range (orderOf a)) = univ :=
@@ -356,12 +308,6 @@ theorem IsCyclic.image_range_orderOf (ha : ∀ x : α, x ∈ zpowers a) :
#align is_cyclic.image_range_order_of IsCyclic.image_range_orderOf
#align is_add_cyclic.image_range_order_of IsAddCyclic.image_range_addOrderOf
-/- warning: is_cyclic.image_range_card -> IsCyclic.image_range_card is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {a : α} [_inst_1 : Group.{u1} α] [_inst_2 : DecidableEq.{succ u1} α] [_inst_3 : Fintype.{u1} α], (forall (x : α), Membership.Mem.{u1, u1} α (Subgroup.{u1} α _inst_1) (SetLike.hasMem.{u1, u1} (Subgroup.{u1} α _inst_1) α (Subgroup.setLike.{u1} α _inst_1)) x (Subgroup.zpowers.{u1} α _inst_1 a)) -> (Eq.{succ u1} (Finset.{u1} α) (Finset.image.{0, u1} Nat α (fun (a : α) (b : α) => _inst_2 a b) (fun (i : Nat) => HPow.hPow.{u1, 0, u1} α Nat α (instHPow.{u1, 0} α Nat (Monoid.Pow.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))) a i) (Finset.range (Fintype.card.{u1} α _inst_3))) (Finset.univ.{u1} α _inst_3))
-but is expected to have type
- forall {α : Type.{u1}} {a : α} [_inst_1 : Group.{u1} α] [_inst_2 : DecidableEq.{succ u1} α] [_inst_3 : Fintype.{u1} α], (forall (x : α), Membership.mem.{u1, u1} α (Subgroup.{u1} α _inst_1) (SetLike.instMembership.{u1, u1} (Subgroup.{u1} α _inst_1) α (Subgroup.instSetLikeSubgroup.{u1} α _inst_1)) x (Subgroup.zpowers.{u1} α _inst_1 a)) -> (Eq.{succ u1} (Finset.{u1} α) (Finset.image.{0, u1} Nat α (fun (a : α) (b : α) => _inst_2 a b) (fun (i : Nat) => HPow.hPow.{u1, 0, u1} α Nat α (instHPow.{u1, 0} α Nat (Monoid.Pow.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))) a i) (Finset.range (Fintype.card.{u1} α _inst_3))) (Finset.univ.{u1} α _inst_3))
-Case conversion may be inaccurate. Consider using '#align is_cyclic.image_range_card IsCyclic.image_range_cardₓ'. -/
@[to_additive]
theorem IsCyclic.image_range_card (ha : ∀ x : α, x ∈ zpowers a) :
Finset.image (fun i => a ^ i) (range (Fintype.card α)) = univ := by
@@ -430,12 +376,6 @@ private theorem card_order_of_eq_totient_aux₁ :
filter_dvd_eq_divisors hd0, sum_totient, ← ha, card_pow_eq_one_eq_order_of_aux hn a]
simpa [← cons_self_proper_divisors hd0, ← h1] using h2
-/- warning: card_order_of_eq_totient_aux₂ -> card_orderOf_eq_totient_aux₂ is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Group.{u1} α] [_inst_2 : DecidableEq.{succ u1} α] [_inst_3 : Fintype.{u1} α], (forall (n : Nat), (LT.lt.{0} Nat Nat.hasLt (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) n) -> (LE.le.{0} Nat Nat.hasLe (Finset.card.{u1} α (Finset.filter.{u1} α (fun (a : α) => Eq.{succ u1} α (HPow.hPow.{u1, 0, u1} α Nat α (instHPow.{u1, 0} α Nat (Monoid.Pow.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))) a n) (OfNat.ofNat.{u1} α 1 (OfNat.mk.{u1} α 1 (One.one.{u1} α (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))))))) (fun (a : α) => _inst_2 (HPow.hPow.{u1, 0, u1} α Nat α (instHPow.{u1, 0} α Nat (Monoid.Pow.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))) a n) (OfNat.ofNat.{u1} α 1 (OfNat.mk.{u1} α 1 (One.one.{u1} α (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))))))) (Finset.univ.{u1} α _inst_3))) n)) -> (forall {d : Nat}, (Dvd.Dvd.{0} Nat Nat.hasDvd d (Fintype.card.{u1} α _inst_3)) -> (Eq.{1} Nat (Finset.card.{u1} α (Finset.filter.{u1} α (fun (a : α) => Eq.{1} Nat (orderOf.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)) a) d) (fun (a : α) => Nat.decidableEq (orderOf.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)) a) d) (Finset.univ.{u1} α _inst_3))) (Nat.totient d)))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Group.{u1} α] [_inst_2 : DecidableEq.{succ u1} α] [_inst_3 : Fintype.{u1} α], (forall (n : Nat), (LT.lt.{0} Nat instLTNat (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) n) -> (LE.le.{0} Nat instLENat (Finset.card.{u1} α (Finset.filter.{u1} α (fun (a : α) => Eq.{succ u1} α (HPow.hPow.{u1, 0, u1} α Nat α (instHPow.{u1, 0} α Nat (Monoid.Pow.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))) a n) (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α (InvOneClass.toOne.{u1} α (DivInvOneMonoid.toInvOneClass.{u1} α (DivisionMonoid.toDivInvOneMonoid.{u1} α (Group.toDivisionMonoid.{u1} α _inst_1))))))) (fun (a : α) => _inst_2 (HPow.hPow.{u1, 0, u1} α Nat α (instHPow.{u1, 0} α Nat (Monoid.Pow.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))) a n) (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α (InvOneClass.toOne.{u1} α (DivInvOneMonoid.toInvOneClass.{u1} α (DivisionMonoid.toDivInvOneMonoid.{u1} α (Group.toDivisionMonoid.{u1} α _inst_1))))))) (Finset.univ.{u1} α _inst_3))) n)) -> (forall {d : Nat}, (Dvd.dvd.{0} Nat Nat.instDvdNat d (Fintype.card.{u1} α _inst_3)) -> (Eq.{1} Nat (Finset.card.{u1} α (Finset.filter.{u1} α (fun (a : α) => Eq.{1} Nat (orderOf.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)) a) d) (fun (a : α) => instDecidableEqNat (orderOf.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)) a) d) (Finset.univ.{u1} α _inst_3))) (Nat.totient d)))
-Case conversion may be inaccurate. Consider using '#align card_order_of_eq_totient_aux₂ card_orderOf_eq_totient_aux₂ₓ'. -/
theorem card_orderOf_eq_totient_aux₂ {d : ℕ} (hd : d ∣ Fintype.card α) :
(univ.filterₓ fun a : α => orderOf a = d).card = φ d :=
by
@@ -469,12 +409,6 @@ theorem card_orderOf_eq_totient_aux₂ {d : ℕ} (hd : d ∣ Fintype.card α) :
#align card_order_of_eq_totient_aux₂ card_orderOf_eq_totient_aux₂
-/- warning: is_cyclic_of_card_pow_eq_one_le -> isCyclic_of_card_pow_eq_one_le is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Group.{u1} α] [_inst_2 : DecidableEq.{succ u1} α] [_inst_3 : Fintype.{u1} α], (forall (n : Nat), (LT.lt.{0} Nat Nat.hasLt (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) n) -> (LE.le.{0} Nat Nat.hasLe (Finset.card.{u1} α (Finset.filter.{u1} α (fun (a : α) => Eq.{succ u1} α (HPow.hPow.{u1, 0, u1} α Nat α (instHPow.{u1, 0} α Nat (Monoid.Pow.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))) a n) (OfNat.ofNat.{u1} α 1 (OfNat.mk.{u1} α 1 (One.one.{u1} α (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))))))) (fun (a : α) => _inst_2 (HPow.hPow.{u1, 0, u1} α Nat α (instHPow.{u1, 0} α Nat (Monoid.Pow.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))) a n) (OfNat.ofNat.{u1} α 1 (OfNat.mk.{u1} α 1 (One.one.{u1} α (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))))))) (Finset.univ.{u1} α _inst_3))) n)) -> (IsCyclic.{u1} α _inst_1)
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Group.{u1} α] [_inst_2 : DecidableEq.{succ u1} α] [_inst_3 : Fintype.{u1} α], (forall (n : Nat), (LT.lt.{0} Nat instLTNat (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) n) -> (LE.le.{0} Nat instLENat (Finset.card.{u1} α (Finset.filter.{u1} α (fun (a : α) => Eq.{succ u1} α (HPow.hPow.{u1, 0, u1} α Nat α (instHPow.{u1, 0} α Nat (Monoid.Pow.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))) a n) (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α (InvOneClass.toOne.{u1} α (DivInvOneMonoid.toInvOneClass.{u1} α (DivisionMonoid.toDivInvOneMonoid.{u1} α (Group.toDivisionMonoid.{u1} α _inst_1))))))) (fun (a : α) => _inst_2 (HPow.hPow.{u1, 0, u1} α Nat α (instHPow.{u1, 0} α Nat (Monoid.Pow.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))) a n) (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α (InvOneClass.toOne.{u1} α (DivInvOneMonoid.toInvOneClass.{u1} α (DivisionMonoid.toDivInvOneMonoid.{u1} α (Group.toDivisionMonoid.{u1} α _inst_1))))))) (Finset.univ.{u1} α _inst_3))) n)) -> (IsCyclic.{u1} α _inst_1)
-Case conversion may be inaccurate. Consider using '#align is_cyclic_of_card_pow_eq_one_le isCyclic_of_card_pow_eq_one_leₓ'. -/
theorem isCyclic_of_card_pow_eq_one_le : IsCyclic α :=
have : (univ.filterₓ fun a : α => orderOf a = Fintype.card α).Nonempty :=
card_pos.1 <| by
@@ -484,12 +418,6 @@ theorem isCyclic_of_card_pow_eq_one_le : IsCyclic α :=
isCyclic_of_orderOf_eq_card x (Finset.mem_filter.1 hx).2
#align is_cyclic_of_card_pow_eq_one_le isCyclic_of_card_pow_eq_one_le
-/- warning: is_add_cyclic_of_card_pow_eq_one_le -> isAddCyclic_of_card_pow_eq_one_le is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_4 : AddGroup.{u1} α] [_inst_5 : DecidableEq.{succ u1} α] [_inst_6 : Fintype.{u1} α], (forall (n : Nat), (LT.lt.{0} Nat Nat.hasLt (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) n) -> (LE.le.{0} Nat Nat.hasLe (Finset.card.{u1} α (Finset.filter.{u1} α (fun (a : α) => Eq.{succ u1} α (SMul.smul.{0, u1} Nat α (AddMonoid.SMul.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_4))) n a) (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α (AddZeroClass.toHasZero.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_4)))))))) (fun (a : α) => _inst_5 (SMul.smul.{0, u1} Nat α (AddMonoid.SMul.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_4))) n a) (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α (AddZeroClass.toHasZero.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_4)))))))) (Finset.univ.{u1} α _inst_6))) n)) -> (IsAddCyclic.{u1} α _inst_4)
-but is expected to have type
- forall {α : Type.{u1}} [_inst_4 : AddGroup.{u1} α] [_inst_5 : DecidableEq.{succ u1} α] [_inst_6 : Fintype.{u1} α], (forall (n : Nat), (LT.lt.{0} Nat instLTNat (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) n) -> (LE.le.{0} Nat instLENat (Finset.card.{u1} α (Finset.filter.{u1} α (fun (a : α) => Eq.{succ u1} α (HSMul.hSMul.{0, u1, u1} Nat α α (instHSMul.{0, u1} Nat α (AddMonoid.SMul.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_4)))) n a) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_4))))))) (fun (a : α) => _inst_5 (HSMul.hSMul.{0, u1, u1} Nat α α (instHSMul.{0, u1} Nat α (AddMonoid.SMul.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_4)))) n a) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_4))))))) (Finset.univ.{u1} α _inst_6))) n)) -> (IsAddCyclic.{u1} α _inst_4)
-Case conversion may be inaccurate. Consider using '#align is_add_cyclic_of_card_pow_eq_one_le isAddCyclic_of_card_pow_eq_one_leₓ'. -/
theorem isAddCyclic_of_card_pow_eq_one_le {α} [AddGroup α] [DecidableEq α] [Fintype α]
(hn : ∀ n : ℕ, 0 < n → (univ.filterₓ fun a : α => n • a = 0).card ≤ n) : IsAddCyclic α :=
by
@@ -501,23 +429,11 @@ attribute [to_additive isCyclic_of_card_pow_eq_one_le] isAddCyclic_of_card_pow_e
end Totient
-/- warning: is_cyclic.card_order_of_eq_totient -> IsCyclic.card_orderOf_eq_totient is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Group.{u1} α] [_inst_2 : IsCyclic.{u1} α _inst_1] [_inst_3 : Fintype.{u1} α] {d : Nat}, (Dvd.Dvd.{0} Nat Nat.hasDvd d (Fintype.card.{u1} α _inst_3)) -> (Eq.{1} Nat (Finset.card.{u1} α (Finset.filter.{u1} α (fun (a : α) => Eq.{1} Nat (orderOf.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)) a) d) (fun (a : α) => Nat.decidableEq (orderOf.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)) a) d) (Finset.univ.{u1} α _inst_3))) (Nat.totient d))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Group.{u1} α] [_inst_2 : IsCyclic.{u1} α _inst_1] [_inst_3 : Fintype.{u1} α] {d : Nat}, (Dvd.dvd.{0} Nat Nat.instDvdNat d (Fintype.card.{u1} α _inst_3)) -> (Eq.{1} Nat (Finset.card.{u1} α (Finset.filter.{u1} α (fun (a : α) => Eq.{1} Nat (orderOf.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)) a) d) (fun (a : α) => instDecidableEqNat (orderOf.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)) a) d) (Finset.univ.{u1} α _inst_3))) (Nat.totient d))
-Case conversion may be inaccurate. Consider using '#align is_cyclic.card_order_of_eq_totient IsCyclic.card_orderOf_eq_totientₓ'. -/
theorem IsCyclic.card_orderOf_eq_totient [IsCyclic α] [Fintype α] {d : ℕ}
(hd : d ∣ Fintype.card α) : (univ.filterₓ fun a : α => orderOf a = d).card = totient d := by
classical apply card_orderOf_eq_totient_aux₂ (fun n => IsCyclic.card_pow_eq_one_le) hd
#align is_cyclic.card_order_of_eq_totient IsCyclic.card_orderOf_eq_totient
-/- warning: is_add_cyclic.card_order_of_eq_totient -> IsAddCyclic.card_orderOf_eq_totient is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_2 : AddGroup.{u1} α] [_inst_3 : IsAddCyclic.{u1} α _inst_2] [_inst_4 : Fintype.{u1} α] {d : Nat}, (Dvd.Dvd.{0} Nat Nat.hasDvd d (Fintype.card.{u1} α _inst_4)) -> (Eq.{1} Nat (Finset.card.{u1} α (Finset.filter.{u1} α (fun (a : α) => Eq.{1} Nat (addOrderOf.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_2)) a) d) (fun (a : α) => Nat.decidableEq (addOrderOf.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_2)) a) d) (Finset.univ.{u1} α _inst_4))) (Nat.totient d))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_2 : AddGroup.{u1} α] [_inst_3 : IsAddCyclic.{u1} α _inst_2] [_inst_4 : Fintype.{u1} α] {d : Nat}, (Dvd.dvd.{0} Nat Nat.instDvdNat d (Fintype.card.{u1} α _inst_4)) -> (Eq.{1} Nat (Finset.card.{u1} α (Finset.filter.{u1} α (fun (a : α) => Eq.{1} Nat (addOrderOf.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_2)) a) d) (fun (a : α) => instDecidableEqNat (addOrderOf.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_2)) a) d) (Finset.univ.{u1} α _inst_4))) (Nat.totient d))
-Case conversion may be inaccurate. Consider using '#align is_add_cyclic.card_order_of_eq_totient IsAddCyclic.card_orderOf_eq_totientₓ'. -/
theorem IsAddCyclic.card_orderOf_eq_totient {α} [AddGroup α] [IsAddCyclic α] [Fintype α] {d : ℕ}
(hd : d ∣ Fintype.card α) : (univ.filterₓ fun a : α => addOrderOf a = d).card = totient d :=
by
@@ -556,12 +472,6 @@ open Subgroup
variable {G : Type _} {H : Type _} [Group G] [Group H]
-/- warning: commutative_of_cyclic_center_quotient -> commutative_of_cyclic_center_quotient is a dubious translation:
-lean 3 declaration is
- forall {G : Type.{u1}} {H : Type.{u2}} [_inst_1 : Group.{u1} G] [_inst_2 : Group.{u2} H] [_inst_3 : IsCyclic.{u2} H _inst_2] (f : MonoidHom.{u1, u2} G H (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_1))) (Monoid.toMulOneClass.{u2} H (DivInvMonoid.toMonoid.{u2} H (Group.toDivInvMonoid.{u2} H _inst_2)))), (LE.le.{u1} (Subgroup.{u1} G _inst_1) (Preorder.toHasLe.{u1} (Subgroup.{u1} G _inst_1) (PartialOrder.toPreorder.{u1} (Subgroup.{u1} G _inst_1) (SetLike.partialOrder.{u1, u1} (Subgroup.{u1} G _inst_1) G (Subgroup.setLike.{u1} G _inst_1)))) (MonoidHom.ker.{u1, u2} G _inst_1 H (Monoid.toMulOneClass.{u2} H (DivInvMonoid.toMonoid.{u2} H (Group.toDivInvMonoid.{u2} H _inst_2))) f) (Subgroup.center.{u1} G _inst_1)) -> (forall (a : G) (b : G), Eq.{succ u1} G (HMul.hMul.{u1, u1, u1} G G G (instHMul.{u1} G (MulOneClass.toHasMul.{u1} G (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_1))))) a b) (HMul.hMul.{u1, u1, u1} G G G (instHMul.{u1} G (MulOneClass.toHasMul.{u1} G (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_1))))) b a))
-but is expected to have type
- forall {G : Type.{u1}} {H : Type.{u2}} [_inst_1 : Group.{u1} G] [_inst_2 : Group.{u2} H] [_inst_3 : IsCyclic.{u2} H _inst_2] (f : MonoidHom.{u1, u2} G H (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_1))) (Monoid.toMulOneClass.{u2} H (DivInvMonoid.toMonoid.{u2} H (Group.toDivInvMonoid.{u2} H _inst_2)))), (LE.le.{u1} (Subgroup.{u1} G _inst_1) (Preorder.toLE.{u1} (Subgroup.{u1} G _inst_1) (PartialOrder.toPreorder.{u1} (Subgroup.{u1} G _inst_1) (OmegaCompletePartialOrder.toPartialOrder.{u1} (Subgroup.{u1} G _inst_1) (CompleteLattice.instOmegaCompletePartialOrder.{u1} (Subgroup.{u1} G _inst_1) (Subgroup.instCompleteLatticeSubgroup.{u1} G _inst_1))))) (MonoidHom.ker.{u1, u2} G _inst_1 H (Monoid.toMulOneClass.{u2} H (DivInvMonoid.toMonoid.{u2} H (Group.toDivInvMonoid.{u2} H _inst_2))) f) (Subgroup.center.{u1} G _inst_1)) -> (forall (a : G) (b : G), Eq.{succ u1} G (HMul.hMul.{u1, u1, u1} G G G (instHMul.{u1} G (MulOneClass.toMul.{u1} G (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_1))))) a b) (HMul.hMul.{u1, u1, u1} G G G (instHMul.{u1} G (MulOneClass.toMul.{u1} G (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_1))))) b a))
-Case conversion may be inaccurate. Consider using '#align commutative_of_cyclic_center_quotient commutative_of_cyclic_center_quotientₓ'. -/
/-- A group is commutative if the quotient by the center is cyclic.
Also see `comm_group_of_cycle_center_quotient` for the `comm_group` instance. -/
@[to_additive commutative_of_add_cyclic_center_quotient
@@ -587,12 +497,6 @@ theorem commutative_of_cyclic_center_quotient [IsCyclic H] (f : G →* H) (hf :
#align commutative_of_cyclic_center_quotient commutative_of_cyclic_center_quotient
#align commutative_of_add_cyclic_center_quotient commutative_of_add_cyclic_center_quotient
-/- warning: comm_group_of_cycle_center_quotient -> commGroupOfCycleCenterQuotient is a dubious translation:
-lean 3 declaration is
- forall {G : Type.{u1}} {H : Type.{u2}} [_inst_1 : Group.{u1} G] [_inst_2 : Group.{u2} H] [_inst_3 : IsCyclic.{u2} H _inst_2] (f : MonoidHom.{u1, u2} G H (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_1))) (Monoid.toMulOneClass.{u2} H (DivInvMonoid.toMonoid.{u2} H (Group.toDivInvMonoid.{u2} H _inst_2)))), (LE.le.{u1} (Subgroup.{u1} G _inst_1) (Preorder.toHasLe.{u1} (Subgroup.{u1} G _inst_1) (PartialOrder.toPreorder.{u1} (Subgroup.{u1} G _inst_1) (SetLike.partialOrder.{u1, u1} (Subgroup.{u1} G _inst_1) G (Subgroup.setLike.{u1} G _inst_1)))) (MonoidHom.ker.{u1, u2} G _inst_1 H (Monoid.toMulOneClass.{u2} H (DivInvMonoid.toMonoid.{u2} H (Group.toDivInvMonoid.{u2} H _inst_2))) f) (Subgroup.center.{u1} G _inst_1)) -> (CommGroup.{u1} G)
-but is expected to have type
- forall {G : Type.{u1}} {H : Type.{u2}} [_inst_1 : Group.{u1} G] [_inst_2 : Group.{u2} H] [_inst_3 : IsCyclic.{u2} H _inst_2] (f : MonoidHom.{u1, u2} G H (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_1))) (Monoid.toMulOneClass.{u2} H (DivInvMonoid.toMonoid.{u2} H (Group.toDivInvMonoid.{u2} H _inst_2)))), (LE.le.{u1} (Subgroup.{u1} G _inst_1) (Preorder.toLE.{u1} (Subgroup.{u1} G _inst_1) (PartialOrder.toPreorder.{u1} (Subgroup.{u1} G _inst_1) (OmegaCompletePartialOrder.toPartialOrder.{u1} (Subgroup.{u1} G _inst_1) (CompleteLattice.instOmegaCompletePartialOrder.{u1} (Subgroup.{u1} G _inst_1) (Subgroup.instCompleteLatticeSubgroup.{u1} G _inst_1))))) (MonoidHom.ker.{u1, u2} G _inst_1 H (Monoid.toMulOneClass.{u2} H (DivInvMonoid.toMonoid.{u2} H (Group.toDivInvMonoid.{u2} H _inst_2))) f) (Subgroup.center.{u1} G _inst_1)) -> (CommGroup.{u1} G)
-Case conversion may be inaccurate. Consider using '#align comm_group_of_cycle_center_quotient commGroupOfCycleCenterQuotientₓ'. -/
/-- A group is commutative if the quotient by the center is cyclic. -/
@[to_additive commutativeOfAddCycleCenterQuotient
"A group is commutative if the quotient by\n the center is cyclic."]
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -79,9 +79,7 @@ class IsCyclic (α : Type u) [Group α] : Prop where
#print isCyclic_of_subsingleton /-
@[to_additive isAddCyclic_of_subsingleton]
instance (priority := 100) isCyclic_of_subsingleton [Group α] [Subsingleton α] : IsCyclic α :=
- ⟨⟨1, fun x => by
- rw [Subsingleton.elim x 1]
- exact mem_zpowers 1⟩⟩
+ ⟨⟨1, fun x => by rw [Subsingleton.elim x 1]; exact mem_zpowers 1⟩⟩
#align is_cyclic_of_subsingleton isCyclic_of_subsingleton
#align is_add_cyclic_of_subsingleton isAddCyclic_of_subsingleton
-/
@@ -153,11 +151,7 @@ theorem isCyclic_of_prime_card {α : Type u} [Group α] [Fintype α] {p : ℕ} [
· rw [Fintype.card_eq_one_iff] at this
cases' this with t ht
suffices g = 1 by contradiction
- have hgt :=
- ht
- ⟨g, by
- change g ∈ Subgroup.zpowers g
- exact Subgroup.mem_zpowers g⟩
+ have hgt := ht ⟨g, by change g ∈ Subgroup.zpowers g; exact Subgroup.mem_zpowers g⟩
rw [← ht 1] at hgt
change (⟨_, _⟩ : Subgroup.zpowers g) = ⟨_, _⟩ at hgt
simpa using hgt
@@ -249,11 +243,8 @@ instance Subgroup.isCyclic {α : Type u} [Group α] [IsCyclic α] (H : Subgroup
let ⟨k, hk⟩ := hg x
have hk₁ : g ^ ((Nat.find hex : ℤ) * (k / Nat.find hex)) ∈ zpowers (g ^ Nat.find hex) :=
⟨k / Nat.find hex, by rw [← zpow_ofNat, zpow_mul]⟩
- have hk₂ : g ^ ((Nat.find hex : ℤ) * (k / Nat.find hex)) ∈ H :=
- by
- rw [zpow_mul]
- apply H.zpow_mem
- exact_mod_cast (Nat.find_spec hex).2
+ have hk₂ : g ^ ((Nat.find hex : ℤ) * (k / Nat.find hex)) ∈ H := by rw [zpow_mul];
+ apply H.zpow_mem; exact_mod_cast (Nat.find_spec hex).2
have hk₃ : g ^ (k % Nat.find hex) ∈ H :=
(Subgroup.mul_mem_cancel_right H hk₂).1 <| by
rw [← zpow_add, Int.emod_add_ediv, hk] <;> exact hx
@@ -319,10 +310,8 @@ theorem IsCyclic.card_pow_eq_one_le [DecidableEq α] [Fintype α] [IsCyclic α]
_ ≤ n := by
let ⟨m, hm⟩ := Nat.gcd_dvd_right n (Fintype.card α)
have hm0 : 0 < m :=
- Nat.pos_of_ne_zero fun hm0 =>
- by
- rw [hm0, MulZeroClass.mul_zero, Fintype.card_eq_zero_iff] at hm
- exact hm.elim' 1
+ Nat.pos_of_ne_zero fun hm0 => by
+ rw [hm0, MulZeroClass.mul_zero, Fintype.card_eq_zero_iff] at hm; exact hm.elim' 1
simp only [Set.toFinset_card, SetLike.coe_sort_coe]
rw [← orderOf_eq_card_zpowers, orderOf_pow g, orderOf_eq_card_of_forall_mem_zpowers hg]
rw [hm]
@@ -343,9 +332,7 @@ but is expected to have type
Case conversion may be inaccurate. Consider using '#align is_cyclic.exists_monoid_generator IsCyclic.exists_monoid_generatorₓ'. -/
@[to_additive]
theorem IsCyclic.exists_monoid_generator [Finite α] [IsCyclic α] :
- ∃ x : α, ∀ y : α, y ∈ Submonoid.powers x :=
- by
- simp_rw [mem_powers_iff_mem_zpowers]
+ ∃ x : α, ∀ y : α, y ∈ Submonoid.powers x := by simp_rw [mem_powers_iff_mem_zpowers];
exact IsCyclic.exists_generator α
#align is_cyclic.exists_monoid_generator IsCyclic.exists_monoid_generator
#align is_add_cyclic.exists_add_monoid_generator IsAddCyclic.exists_addMonoid_generator
@@ -468,19 +455,14 @@ theorem card_orderOf_eq_totient_aux₂ {d : ℕ} (hd : d ∣ Fintype.card α) :
by
rw [eq_comm]
refine' sum_subset (erase_subset _ _) fun m hm₁ hm₂ => _
- have : m = d := by
- contrapose! hm₂
- exact mem_erase_of_ne_of_mem hm₂ hm₁
+ have : m = d := by contrapose! hm₂; exact mem_erase_of_ne_of_mem hm₂ hm₁
simp [this, h0]
_ ≤ ∑ m in c.divisors.erase d, φ m :=
by
refine' sum_le_sum fun m hm => _
- have hmc : m ∣ c := by
- simp only [mem_erase, mem_divisors] at hm
- tauto
+ have hmc : m ∣ c := by simp only [mem_erase, mem_divisors] at hm; tauto
rcases(Filter (fun a : α => orderOf a = m) univ).card.eq_zero_or_pos with (h1 | h1)
- · simp [h1]
- · simp [card_order_of_eq_totient_aux₁ hn hmc h1]
+ · simp [h1]; · simp [card_order_of_eq_totient_aux₁ hn hmc h1]
_ < ∑ m in c.divisors, φ m :=
(sum_erase_lt_of_pos (mem_divisors.2 ⟨hd, hc0.ne'⟩) (totient_pos (pos_of_dvd_of_pos hd hc0)))
_ = c := sum_totient _
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl
! This file was ported from Lean 3 source module group_theory.specific_groups.cyclic
-! leanprover-community/mathlib commit 0f6670b8af2dff699de1c0b4b49039b31bc13c46
+! leanprover-community/mathlib commit 0b7c740e25651db0ba63648fbae9f9d6f941e31b
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -18,6 +18,9 @@ import Mathbin.GroupTheory.Exponent
/-!
# Cyclic groups
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
A group `G` is called cyclic if there exists an element `g : G` such that every element of `G` is of
the form `g ^ n` for some `n : ℕ`. This file only deals with the predicate on a group to be cyclic.
For the concrete cyclic group of order `n`, see `data.zmod.basic`.
@@ -74,13 +77,13 @@ class IsCyclic (α : Type u) [Group α] : Prop where
-/
#print isCyclic_of_subsingleton /-
-@[to_additive is_add_cyclic_of_subsingleton]
+@[to_additive isAddCyclic_of_subsingleton]
instance (priority := 100) isCyclic_of_subsingleton [Group α] [Subsingleton α] : IsCyclic α :=
⟨⟨1, fun x => by
rw [Subsingleton.elim x 1]
exact mem_zpowers 1⟩⟩
#align is_cyclic_of_subsingleton isCyclic_of_subsingleton
-#align is_add_cyclic_of_subsingleton is_add_cyclic_of_subsingleton
+#align is_add_cyclic_of_subsingleton isAddCyclic_of_subsingleton
-/
#print IsCyclic.commGroup /-
@@ -120,7 +123,7 @@ theorem MonoidHom.map_cyclic {G : Type _} [Group G] [h : IsCyclic G] (σ : G →
#align monoid_add_hom.map_add_cyclic MonoidAddHom.map_add_cyclic
#print isCyclic_of_orderOf_eq_card /-
-@[to_additive is_add_cyclic_of_orderOf_eq_card]
+@[to_additive isAddCyclic_of_orderOf_eq_card]
theorem isCyclic_of_orderOf_eq_card [Fintype α] (x : α) (hx : orderOf x = Fintype.card α) :
IsCyclic α := by
classical
@@ -129,12 +132,12 @@ theorem isCyclic_of_orderOf_eq_card [Fintype α] (x : α) (hx : orderOf x = Fint
rw [← Fintype.card_congr (Equiv.Set.univ α), orderOf_eq_card_zpowers] at hx
exact Set.eq_of_subset_of_card_le (Set.subset_univ _) (ge_of_eq hx)
#align is_cyclic_of_order_of_eq_card isCyclic_of_orderOf_eq_card
-#align is_add_cyclic_of_order_of_eq_card is_add_cyclic_of_orderOf_eq_card
+#align is_add_cyclic_of_order_of_eq_card isAddCyclic_of_orderOf_eq_card
-/
#print isCyclic_of_prime_card /-
/-- A finite group of prime order is cyclic. -/
-@[to_additive is_add_cyclic_of_prime_card "A finite group of prime order is cyclic."]
+@[to_additive isAddCyclic_of_prime_card "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 α :=
⟨by
@@ -164,7 +167,7 @@ theorem isCyclic_of_prime_card {α : Type u} [Group α] [Fintype α] {p : ℕ} [
rw [Subgroup.eq_top_of_card_eq _ this]
exact Subgroup.mem_top _⟩
#align is_cyclic_of_prime_card isCyclic_of_prime_card
-#align is_add_cyclic_of_prime_card is_add_cyclic_of_prime_card
+#align is_add_cyclic_of_prime_card isAddCyclic_of_prime_card
-/
/- warning: order_of_eq_card_of_forall_mem_zpowers -> orderOf_eq_card_of_forall_mem_zpowers is a dubious translation:
@@ -217,11 +220,11 @@ lean 3 declaration is
but is expected to have type
forall {α : Type.{u1}} [_inst_2 : Group.{u1} α], IsCyclic.{u1} (Subtype.{succ u1} α (fun (x : α) => Membership.mem.{u1, u1} α (Subgroup.{u1} α _inst_2) (SetLike.instMembership.{u1, u1} (Subgroup.{u1} α _inst_2) α (Subgroup.instSetLikeSubgroup.{u1} α _inst_2)) x (Bot.bot.{u1} (Subgroup.{u1} α _inst_2) (Subgroup.instBotSubgroup.{u1} α _inst_2)))) (Subgroup.toGroup.{u1} α _inst_2 (Bot.bot.{u1} (Subgroup.{u1} α _inst_2) (Subgroup.instBotSubgroup.{u1} α _inst_2)))
Case conversion may be inaccurate. Consider using '#align bot.is_cyclic Bot.isCyclicₓ'. -/
-@[to_additive Bot.is_add_cyclic]
+@[to_additive Bot.isAddCyclic]
instance Bot.isCyclic {α : Type u} [Group α] : IsCyclic (⊥ : Subgroup α) :=
⟨⟨1, fun x => ⟨0, Subtype.eq <| (zpow_zero (1 : α)).trans <| Eq.symm (Subgroup.mem_bot.1 x.2)⟩⟩⟩
#align bot.is_cyclic Bot.isCyclic
-#align bot.is_add_cyclic Bot.is_add_cyclic
+#align bot.is_add_cyclic Bot.isAddCyclic
/- warning: subgroup.is_cyclic -> Subgroup.isCyclic is a dubious translation:
lean 3 declaration is
@@ -229,7 +232,7 @@ lean 3 declaration is
but is expected to have type
forall {α : Type.{u1}} [_inst_2 : Group.{u1} α] [_inst_3 : IsCyclic.{u1} α _inst_2] (H : Subgroup.{u1} α _inst_2), IsCyclic.{u1} (Subtype.{succ u1} α (fun (x : α) => Membership.mem.{u1, u1} α (Subgroup.{u1} α _inst_2) (SetLike.instMembership.{u1, u1} (Subgroup.{u1} α _inst_2) α (Subgroup.instSetLikeSubgroup.{u1} α _inst_2)) x H)) (Subgroup.toGroup.{u1} α _inst_2 H)
Case conversion may be inaccurate. Consider using '#align subgroup.is_cyclic Subgroup.isCyclicₓ'. -/
-@[to_additive AddSubgroup.is_add_cyclic]
+@[to_additive AddSubgroup.isAddCyclic]
instance Subgroup.isCyclic {α : Type u} [Group α] [IsCyclic α] (H : Subgroup α) : IsCyclic H :=
haveI := Classical.propDecidable
let ⟨g, hg⟩ := IsCyclic.exists_generator α
@@ -278,7 +281,7 @@ instance Subgroup.isCyclic {α : Type u} [Group α] [IsCyclic α] (H : Subgroup
⟨fun h => by simp at * <;> tauto, fun h => by rw [Subgroup.mem_bot.1 h] <;> exact H.one_mem⟩
clear _let_match <;> subst this <;> infer_instance
#align subgroup.is_cyclic Subgroup.isCyclic
-#align add_subgroup.is_add_cyclic AddSubgroup.is_add_cyclic
+#align add_subgroup.is_add_cyclic AddSubgroup.isAddCyclic
open Finset Nat
@@ -408,7 +411,6 @@ private theorem card_pow_eq_one_eq_order_of_aux (a : α) :
fun _ _ h => Subtype.eq (Subtype.mk.inj h))
_ = (univ.filterₓ fun b : α => b ^ orderOf a = 1).card := Fintype.card_ofFinset _ _
)
-#align card_pow_eq_one_eq_order_of_aux card_pow_eq_one_eq_order_of_aux
open Nat
@@ -440,7 +442,6 @@ private theorem card_order_of_eq_totient_aux₁ :
rw [← filter_dvd_eq_divisors hd0, sum_card_orderOf_eq_card_pow_eq_one hd0,
filter_dvd_eq_divisors hd0, sum_totient, ← ha, card_pow_eq_one_eq_order_of_aux hn a]
simpa [← cons_self_proper_divisors hd0, ← h1] using h2
-#align card_order_of_eq_totient_aux₁ card_order_of_eq_totient_aux₁
/- warning: card_order_of_eq_totient_aux₂ -> card_orderOf_eq_totient_aux₂ is a dubious translation:
lean 3 declaration is
@@ -627,7 +628,7 @@ section CommGroup
variable [CommGroup α] [IsSimpleGroup α]
-@[to_additive IsSimpleAddGroup.is_add_cyclic]
+@[to_additive IsSimpleAddGroup.isAddCyclic]
instance (priority := 100) : IsCyclic α :=
by
cases' subsingleton_or_nontrivial α with hi hi <;> haveI := hi
@@ -675,7 +676,7 @@ end CommGroup
end IsSimpleGroup
#print CommGroup.is_simple_iff_isCyclic_and_prime_card /-
-@[to_additive AddCommGroup.is_simple_iff_is_add_cyclic_and_prime_card]
+@[to_additive AddCommGroup.is_simple_iff_isAddCyclic_and_prime_card]
theorem CommGroup.is_simple_iff_isCyclic_and_prime_card [Fintype α] [CommGroup α] :
IsSimpleGroup α ↔ IsCyclic α ∧ (Fintype.card α).Prime :=
by
@@ -686,7 +687,7 @@ theorem CommGroup.is_simple_iff_isCyclic_and_prime_card [Fintype α] [CommGroup
haveI : Fact (Fintype.card α).Prime := ⟨hp⟩
exact isSimpleGroup_of_prime_card rfl
#align comm_group.is_simple_iff_is_cyclic_and_prime_card CommGroup.is_simple_iff_isCyclic_and_prime_card
-#align add_comm_group.is_simple_iff_is_add_cyclic_and_prime_card AddCommGroup.is_simple_iff_is_add_cyclic_and_prime_card
+#align add_comm_group.is_simple_iff_is_add_cyclic_and_prime_card AddCommGroup.is_simple_iff_isAddCyclic_and_prime_card
-/
section Exponent
mathlib commit https://github.com/leanprover-community/mathlib/commit/ef95945cd48c932c9e034872bd25c3c220d9c946
@@ -55,12 +55,15 @@ attribute [local instance] setFintype
open Subgroup
+#print IsAddCyclic /-
/- ./././Mathport/Syntax/Translate/Command.lean:393:30: infer kinds are unsupported in Lean 4: #[`exists_generator] [] -/
/-- 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
#align is_add_cyclic IsAddCyclic
+-/
+#print IsCyclic /-
/- ./././Mathport/Syntax/Translate/Command.lean:393:30: infer kinds are unsupported in Lean 4: #[`exists_generator] [] -/
/-- A group is called *cyclic* if it is generated by a single element. -/
@[to_additive IsAddCyclic]
@@ -68,7 +71,9 @@ class IsCyclic (α : Type u) [Group α] : Prop where
exists_generator : ∃ g : α, ∀ x, x ∈ zpowers g
#align is_cyclic IsCyclic
#align is_add_cyclic IsAddCyclic
+-/
+#print isCyclic_of_subsingleton /-
@[to_additive is_add_cyclic_of_subsingleton]
instance (priority := 100) isCyclic_of_subsingleton [Group α] [Subsingleton α] : IsCyclic α :=
⟨⟨1, fun x => by
@@ -76,7 +81,9 @@ instance (priority := 100) isCyclic_of_subsingleton [Group α] [Subsingleton α]
exact mem_zpowers 1⟩⟩
#align is_cyclic_of_subsingleton isCyclic_of_subsingleton
#align is_add_cyclic_of_subsingleton is_add_cyclic_of_subsingleton
+-/
+#print IsCyclic.commGroup /-
/-- A cyclic group is always commutative. This is not an `instance` because often we have a better
proof of `comm_group`. -/
@[to_additive
@@ -90,9 +97,16 @@ def IsCyclic.commGroup [hg : Group α] [IsCyclic α] : CommGroup α :=
hm ▸ hn ▸ zpow_mul_comm _ _ _ }
#align is_cyclic.comm_group IsCyclic.commGroup
#align is_add_cyclic.add_comm_group IsAddCyclic.addCommGroup
+-/
variable [Group α]
+/- warning: monoid_hom.map_cyclic -> MonoidHom.map_cyclic is a dubious translation:
+lean 3 declaration is
+ forall {G : Type.{u1}} [_inst_2 : Group.{u1} G] [h : IsCyclic.{u1} G _inst_2] (σ : MonoidHom.{u1, u1} G G (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_2))) (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_2)))), Exists.{1} Int (fun (m : Int) => forall (g : G), Eq.{succ u1} G (coeFn.{succ u1, succ u1} (MonoidHom.{u1, u1} G G (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_2))) (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_2)))) (fun (_x : MonoidHom.{u1, u1} G G (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_2))) (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_2)))) => G -> G) (MonoidHom.hasCoeToFun.{u1, u1} G G (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_2))) (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_2)))) σ g) (HPow.hPow.{u1, 0, u1} G Int G (instHPow.{u1, 0} G Int (DivInvMonoid.Pow.{u1} G (Group.toDivInvMonoid.{u1} G _inst_2))) g m))
+but is expected to have type
+ forall {G : Type.{u1}} [_inst_2 : Group.{u1} G] [h : IsCyclic.{u1} G _inst_2] (σ : MonoidHom.{u1, u1} G G (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_2))) (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_2)))), Exists.{1} Int (fun (m : Int) => forall (g : G), Eq.{succ u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : G) => G) g) (FunLike.coe.{succ u1, succ u1, succ u1} (MonoidHom.{u1, u1} G G (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_2))) (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_2)))) G (fun (_x : G) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : G) => G) _x) (MulHomClass.toFunLike.{u1, u1, u1} (MonoidHom.{u1, u1} G G (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_2))) (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_2)))) G G (MulOneClass.toMul.{u1} G (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_2)))) (MulOneClass.toMul.{u1} G (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_2)))) (MonoidHomClass.toMulHomClass.{u1, u1, u1} (MonoidHom.{u1, u1} G G (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_2))) (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_2)))) G G (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_2))) (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_2))) (MonoidHom.monoidHomClass.{u1, u1} G G (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_2))) (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_2)))))) σ g) (HPow.hPow.{u1, 0, u1} G Int G (instHPow.{u1, 0} G Int (DivInvMonoid.Pow.{u1} G (Group.toDivInvMonoid.{u1} G _inst_2))) g m))
+Case conversion may be inaccurate. Consider using '#align monoid_hom.map_cyclic MonoidHom.map_cyclicₓ'. -/
@[to_additive MonoidAddHom.map_add_cyclic]
theorem MonoidHom.map_cyclic {G : Type _} [Group G] [h : IsCyclic G] (σ : G →* G) :
∃ m : ℤ, ∀ g : G, σ g = g ^ m :=
@@ -105,6 +119,7 @@ theorem MonoidHom.map_cyclic {G : Type _} [Group G] [h : IsCyclic G] (σ : G →
#align monoid_hom.map_cyclic MonoidHom.map_cyclic
#align monoid_add_hom.map_add_cyclic MonoidAddHom.map_add_cyclic
+#print isCyclic_of_orderOf_eq_card /-
@[to_additive is_add_cyclic_of_orderOf_eq_card]
theorem isCyclic_of_orderOf_eq_card [Fintype α] (x : α) (hx : orderOf x = Fintype.card α) :
IsCyclic α := by
@@ -115,7 +130,9 @@ theorem isCyclic_of_orderOf_eq_card [Fintype α] (x : α) (hx : orderOf x = Fint
exact Set.eq_of_subset_of_card_le (Set.subset_univ _) (ge_of_eq hx)
#align is_cyclic_of_order_of_eq_card isCyclic_of_orderOf_eq_card
#align is_add_cyclic_of_order_of_eq_card is_add_cyclic_of_orderOf_eq_card
+-/
+#print isCyclic_of_prime_card /-
/-- A finite group of prime order is cyclic. -/
@[to_additive is_add_cyclic_of_prime_card "A finite group of prime order is cyclic."]
theorem isCyclic_of_prime_card {α : Type u} [Group α] [Fintype α] {p : ℕ} [hp : Fact p.Prime]
@@ -148,8 +165,15 @@ theorem isCyclic_of_prime_card {α : Type u} [Group α] [Fintype α] {p : ℕ} [
exact Subgroup.mem_top _⟩
#align is_cyclic_of_prime_card isCyclic_of_prime_card
#align is_add_cyclic_of_prime_card is_add_cyclic_of_prime_card
+-/
-@[to_additive add_orderOf_eq_card_of_forall_mem_zmultiples]
+/- warning: order_of_eq_card_of_forall_mem_zpowers -> orderOf_eq_card_of_forall_mem_zpowers is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} [_inst_1 : Group.{u1} α] [_inst_2 : Fintype.{u1} α] {g : α}, (forall (x : α), Membership.Mem.{u1, u1} α (Subgroup.{u1} α _inst_1) (SetLike.hasMem.{u1, u1} (Subgroup.{u1} α _inst_1) α (Subgroup.setLike.{u1} α _inst_1)) x (Subgroup.zpowers.{u1} α _inst_1 g)) -> (Eq.{1} Nat (orderOf.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)) g) (Fintype.card.{u1} α _inst_2))
+but is expected to have type
+ forall {α : Type.{u1}} [_inst_1 : Group.{u1} α] [_inst_2 : Fintype.{u1} α] {g : α}, (forall (x : α), Membership.mem.{u1, u1} α (Subgroup.{u1} α _inst_1) (SetLike.instMembership.{u1, u1} (Subgroup.{u1} α _inst_1) α (Subgroup.instSetLikeSubgroup.{u1} α _inst_1)) x (Subgroup.zpowers.{u1} α _inst_1 g)) -> (Eq.{1} Nat (orderOf.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)) g) (Fintype.card.{u1} α _inst_2))
+Case conversion may be inaccurate. Consider using '#align order_of_eq_card_of_forall_mem_zpowers orderOf_eq_card_of_forall_mem_zpowersₓ'. -/
+@[to_additive addOrderOf_eq_card_of_forall_mem_zmultiples]
theorem orderOf_eq_card_of_forall_mem_zpowers [Fintype α] {g : α} (hx : ∀ x, x ∈ zpowers g) :
orderOf g = Fintype.card α := by
classical
@@ -157,9 +181,15 @@ theorem orderOf_eq_card_of_forall_mem_zpowers [Fintype α] {g : α} (hx : ∀ x,
apply Fintype.card_of_finset'
simpa using hx
#align order_of_eq_card_of_forall_mem_zpowers orderOf_eq_card_of_forall_mem_zpowers
-#align add_order_of_eq_card_of_forall_mem_zmultiples add_orderOf_eq_card_of_forall_mem_zmultiples
-
-@[to_additive Infinite.add_orderOf_eq_zero_of_forall_mem_zmultiples]
+#align add_order_of_eq_card_of_forall_mem_zmultiples addOrderOf_eq_card_of_forall_mem_zmultiples
+
+/- warning: infinite.order_of_eq_zero_of_forall_mem_zpowers -> Infinite.orderOf_eq_zero_of_forall_mem_zpowers is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} [_inst_1 : Group.{u1} α] [_inst_2 : Infinite.{succ u1} α] {g : α}, (forall (x : α), Membership.Mem.{u1, u1} α (Subgroup.{u1} α _inst_1) (SetLike.hasMem.{u1, u1} (Subgroup.{u1} α _inst_1) α (Subgroup.setLike.{u1} α _inst_1)) x (Subgroup.zpowers.{u1} α _inst_1 g)) -> (Eq.{1} Nat (orderOf.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)) g) (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))))
+but is expected to have type
+ forall {α : Type.{u1}} [_inst_1 : Group.{u1} α] [_inst_2 : Infinite.{succ u1} α] {g : α}, (forall (x : α), Membership.mem.{u1, u1} α (Subgroup.{u1} α _inst_1) (SetLike.instMembership.{u1, u1} (Subgroup.{u1} α _inst_1) α (Subgroup.instSetLikeSubgroup.{u1} α _inst_1)) x (Subgroup.zpowers.{u1} α _inst_1 g)) -> (Eq.{1} Nat (orderOf.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)) g) (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))
+Case conversion may be inaccurate. Consider using '#align infinite.order_of_eq_zero_of_forall_mem_zpowers Infinite.orderOf_eq_zero_of_forall_mem_zpowersₓ'. -/
+@[to_additive Infinite.addOrderOf_eq_zero_of_forall_mem_zmultiples]
theorem Infinite.orderOf_eq_zero_of_forall_mem_zpowers [Infinite α] {g : α}
(h : ∀ x, x ∈ zpowers g) : orderOf g = 0 := by
classical
@@ -179,14 +209,26 @@ theorem Infinite.orderOf_eq_zero_of_forall_mem_zpowers [Infinite α] {g : α}
refine' ⟨t.to_nat, _⟩
rwa [← zpow_ofNat, Int.toNat_of_nonneg this]
#align infinite.order_of_eq_zero_of_forall_mem_zpowers Infinite.orderOf_eq_zero_of_forall_mem_zpowers
-#align infinite.add_order_of_eq_zero_of_forall_mem_zmultiples Infinite.add_orderOf_eq_zero_of_forall_mem_zmultiples
-
+#align infinite.add_order_of_eq_zero_of_forall_mem_zmultiples Infinite.addOrderOf_eq_zero_of_forall_mem_zmultiples
+
+/- warning: bot.is_cyclic -> Bot.isCyclic is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} [_inst_2 : Group.{u1} α], IsCyclic.{u1} (coeSort.{succ u1, succ (succ u1)} (Subgroup.{u1} α _inst_2) Type.{u1} (SetLike.hasCoeToSort.{u1, u1} (Subgroup.{u1} α _inst_2) α (Subgroup.setLike.{u1} α _inst_2)) (Bot.bot.{u1} (Subgroup.{u1} α _inst_2) (Subgroup.hasBot.{u1} α _inst_2))) (Subgroup.toGroup.{u1} α _inst_2 (Bot.bot.{u1} (Subgroup.{u1} α _inst_2) (Subgroup.hasBot.{u1} α _inst_2)))
+but is expected to have type
+ forall {α : Type.{u1}} [_inst_2 : Group.{u1} α], IsCyclic.{u1} (Subtype.{succ u1} α (fun (x : α) => Membership.mem.{u1, u1} α (Subgroup.{u1} α _inst_2) (SetLike.instMembership.{u1, u1} (Subgroup.{u1} α _inst_2) α (Subgroup.instSetLikeSubgroup.{u1} α _inst_2)) x (Bot.bot.{u1} (Subgroup.{u1} α _inst_2) (Subgroup.instBotSubgroup.{u1} α _inst_2)))) (Subgroup.toGroup.{u1} α _inst_2 (Bot.bot.{u1} (Subgroup.{u1} α _inst_2) (Subgroup.instBotSubgroup.{u1} α _inst_2)))
+Case conversion may be inaccurate. Consider using '#align bot.is_cyclic Bot.isCyclicₓ'. -/
@[to_additive Bot.is_add_cyclic]
instance Bot.isCyclic {α : Type u} [Group α] : IsCyclic (⊥ : Subgroup α) :=
⟨⟨1, fun x => ⟨0, Subtype.eq <| (zpow_zero (1 : α)).trans <| Eq.symm (Subgroup.mem_bot.1 x.2)⟩⟩⟩
#align bot.is_cyclic Bot.isCyclic
#align bot.is_add_cyclic Bot.is_add_cyclic
+/- warning: subgroup.is_cyclic -> Subgroup.isCyclic is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} [_inst_2 : Group.{u1} α] [_inst_3 : IsCyclic.{u1} α _inst_2] (H : Subgroup.{u1} α _inst_2), IsCyclic.{u1} (coeSort.{succ u1, succ (succ u1)} (Subgroup.{u1} α _inst_2) Type.{u1} (SetLike.hasCoeToSort.{u1, u1} (Subgroup.{u1} α _inst_2) α (Subgroup.setLike.{u1} α _inst_2)) H) (Subgroup.toGroup.{u1} α _inst_2 H)
+but is expected to have type
+ forall {α : Type.{u1}} [_inst_2 : Group.{u1} α] [_inst_3 : IsCyclic.{u1} α _inst_2] (H : Subgroup.{u1} α _inst_2), IsCyclic.{u1} (Subtype.{succ u1} α (fun (x : α) => Membership.mem.{u1, u1} α (Subgroup.{u1} α _inst_2) (SetLike.instMembership.{u1, u1} (Subgroup.{u1} α _inst_2) α (Subgroup.instSetLikeSubgroup.{u1} α _inst_2)) x H)) (Subgroup.toGroup.{u1} α _inst_2 H)
+Case conversion may be inaccurate. Consider using '#align subgroup.is_cyclic Subgroup.isCyclicₓ'. -/
@[to_additive AddSubgroup.is_add_cyclic]
instance Subgroup.isCyclic {α : Type u} [Group α] [IsCyclic α] (H : Subgroup α) : IsCyclic H :=
haveI := Classical.propDecidable
@@ -244,6 +286,12 @@ section Classical
open Classical
+/- warning: is_cyclic.card_pow_eq_one_le -> IsCyclic.card_pow_eq_one_le is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} [_inst_1 : Group.{u1} α] [_inst_2 : DecidableEq.{succ u1} α] [_inst_3 : Fintype.{u1} α] [_inst_4 : IsCyclic.{u1} α _inst_1] {n : Nat}, (LT.lt.{0} Nat Nat.hasLt (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) n) -> (LE.le.{0} Nat Nat.hasLe (Finset.card.{u1} α (Finset.filter.{u1} α (fun (a : α) => Eq.{succ u1} α (HPow.hPow.{u1, 0, u1} α Nat α (instHPow.{u1, 0} α Nat (Monoid.Pow.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))) a n) (OfNat.ofNat.{u1} α 1 (OfNat.mk.{u1} α 1 (One.one.{u1} α (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))))))) (fun (a : α) => _inst_2 (HPow.hPow.{u1, 0, u1} α Nat α (instHPow.{u1, 0} α Nat (Monoid.Pow.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))) a n) (OfNat.ofNat.{u1} α 1 (OfNat.mk.{u1} α 1 (One.one.{u1} α (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))))))) (Finset.univ.{u1} α _inst_3))) n)
+but is expected to have type
+ forall {α : Type.{u1}} [_inst_1 : Group.{u1} α] [_inst_2 : DecidableEq.{succ u1} α] [_inst_3 : Fintype.{u1} α] [_inst_4 : IsCyclic.{u1} α _inst_1] {n : Nat}, (LT.lt.{0} Nat instLTNat (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) n) -> (LE.le.{0} Nat instLENat (Finset.card.{u1} α (Finset.filter.{u1} α (fun (a : α) => Eq.{succ u1} α (HPow.hPow.{u1, 0, u1} α Nat α (instHPow.{u1, 0} α Nat (Monoid.Pow.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))) a n) (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α (InvOneClass.toOne.{u1} α (DivInvOneMonoid.toInvOneClass.{u1} α (DivisionMonoid.toDivInvOneMonoid.{u1} α (Group.toDivisionMonoid.{u1} α _inst_1))))))) (fun (a : α) => _inst_2 (HPow.hPow.{u1, 0, u1} α Nat α (instHPow.{u1, 0} α Nat (Monoid.Pow.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))) a n) (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α (InvOneClass.toOne.{u1} α (DivInvOneMonoid.toInvOneClass.{u1} α (DivisionMonoid.toDivInvOneMonoid.{u1} α (Group.toDivisionMonoid.{u1} α _inst_1))))))) (Finset.univ.{u1} α _inst_3))) n)
+Case conversion may be inaccurate. Consider using '#align is_cyclic.card_pow_eq_one_le IsCyclic.card_pow_eq_one_leₓ'. -/
/- ./././Mathport/Syntax/Translate/Tactic/Lean3.lean:132:4: warning: unsupported: rw with cfg: { occs := occurrences.pos[occurrences.pos] «expr[ ,]»([2, 3]) } -/
@[to_additive IsAddCyclic.card_pow_eq_one_le]
theorem IsCyclic.card_pow_eq_one_le [DecidableEq α] [Fintype α] [IsCyclic α] {n : ℕ} (hn0 : 0 < n) :
@@ -284,6 +332,12 @@ theorem IsCyclic.card_pow_eq_one_le [DecidableEq α] [Fintype α] [IsCyclic α]
end Classical
+/- warning: is_cyclic.exists_monoid_generator -> IsCyclic.exists_monoid_generator is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} [_inst_1 : Group.{u1} α] [_inst_2 : Finite.{succ u1} α] [_inst_3 : IsCyclic.{u1} α _inst_1], Exists.{succ u1} α (fun (x : α) => forall (y : α), Membership.Mem.{u1, u1} α (Submonoid.{u1} α (Monoid.toMulOneClass.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))) (SetLike.hasMem.{u1, u1} (Submonoid.{u1} α (Monoid.toMulOneClass.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))) α (Submonoid.setLike.{u1} α (Monoid.toMulOneClass.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1))))) y (Submonoid.powers.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)) x))
+but is expected to have type
+ forall {α : Type.{u1}} [_inst_1 : Group.{u1} α] [_inst_2 : Finite.{succ u1} α] [_inst_3 : IsCyclic.{u1} α _inst_1], Exists.{succ u1} α (fun (x : α) => forall (y : α), Membership.mem.{u1, u1} α (Submonoid.{u1} α (Monoid.toMulOneClass.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))) (SetLike.instMembership.{u1, u1} (Submonoid.{u1} α (Monoid.toMulOneClass.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))) α (Submonoid.instSetLikeSubmonoid.{u1} α (Monoid.toMulOneClass.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1))))) y (Submonoid.powers.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)) x))
+Case conversion may be inaccurate. Consider using '#align is_cyclic.exists_monoid_generator IsCyclic.exists_monoid_generatorₓ'. -/
@[to_additive]
theorem IsCyclic.exists_monoid_generator [Finite α] [IsCyclic α] :
∃ x : α, ∀ y : α, y ∈ Submonoid.powers x :=
@@ -291,12 +345,18 @@ theorem IsCyclic.exists_monoid_generator [Finite α] [IsCyclic α] :
simp_rw [mem_powers_iff_mem_zpowers]
exact IsCyclic.exists_generator α
#align is_cyclic.exists_monoid_generator IsCyclic.exists_monoid_generator
-#align is_add_cyclic.exists_add_monoid_generator IsAddCyclic.exists_add_monoid_generator
+#align is_add_cyclic.exists_add_monoid_generator IsAddCyclic.exists_addMonoid_generator
section
variable [DecidableEq α] [Fintype α]
+/- warning: is_cyclic.image_range_order_of -> IsCyclic.image_range_orderOf is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} {a : α} [_inst_1 : Group.{u1} α] [_inst_2 : DecidableEq.{succ u1} α] [_inst_3 : Fintype.{u1} α], (forall (x : α), Membership.Mem.{u1, u1} α (Subgroup.{u1} α _inst_1) (SetLike.hasMem.{u1, u1} (Subgroup.{u1} α _inst_1) α (Subgroup.setLike.{u1} α _inst_1)) x (Subgroup.zpowers.{u1} α _inst_1 a)) -> (Eq.{succ u1} (Finset.{u1} α) (Finset.image.{0, u1} Nat α (fun (a : α) (b : α) => _inst_2 a b) (fun (i : Nat) => HPow.hPow.{u1, 0, u1} α Nat α (instHPow.{u1, 0} α Nat (Monoid.Pow.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))) a i) (Finset.range (orderOf.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)) a))) (Finset.univ.{u1} α _inst_3))
+but is expected to have type
+ forall {α : Type.{u1}} {a : α} [_inst_1 : Group.{u1} α] [_inst_2 : DecidableEq.{succ u1} α] [_inst_3 : Fintype.{u1} α], (forall (x : α), Membership.mem.{u1, u1} α (Subgroup.{u1} α _inst_1) (SetLike.instMembership.{u1, u1} (Subgroup.{u1} α _inst_1) α (Subgroup.instSetLikeSubgroup.{u1} α _inst_1)) x (Subgroup.zpowers.{u1} α _inst_1 a)) -> (Eq.{succ u1} (Finset.{u1} α) (Finset.image.{0, u1} Nat α (fun (a : α) (b : α) => _inst_2 a b) (fun (i : Nat) => HPow.hPow.{u1, 0, u1} α Nat α (instHPow.{u1, 0} α Nat (Monoid.Pow.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))) a i) (Finset.range (orderOf.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)) a))) (Finset.univ.{u1} α _inst_3))
+Case conversion may be inaccurate. Consider using '#align is_cyclic.image_range_order_of IsCyclic.image_range_orderOfₓ'. -/
@[to_additive]
theorem IsCyclic.image_range_orderOf (ha : ∀ x : α, x ∈ zpowers a) :
Finset.image (fun i => a ^ i) (range (orderOf a)) = univ :=
@@ -304,8 +364,14 @@ theorem IsCyclic.image_range_orderOf (ha : ∀ x : α, x ∈ zpowers a) :
simp_rw [← SetLike.mem_coe] at ha
simp only [image_range_orderOf, set.eq_univ_iff_forall.mpr ha, Set.toFinset_univ]
#align is_cyclic.image_range_order_of IsCyclic.image_range_orderOf
-#align is_add_cyclic.image_range_order_of IsAddCyclic.image_range_orderOf
-
+#align is_add_cyclic.image_range_order_of IsAddCyclic.image_range_addOrderOf
+
+/- warning: is_cyclic.image_range_card -> IsCyclic.image_range_card is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} {a : α} [_inst_1 : Group.{u1} α] [_inst_2 : DecidableEq.{succ u1} α] [_inst_3 : Fintype.{u1} α], (forall (x : α), Membership.Mem.{u1, u1} α (Subgroup.{u1} α _inst_1) (SetLike.hasMem.{u1, u1} (Subgroup.{u1} α _inst_1) α (Subgroup.setLike.{u1} α _inst_1)) x (Subgroup.zpowers.{u1} α _inst_1 a)) -> (Eq.{succ u1} (Finset.{u1} α) (Finset.image.{0, u1} Nat α (fun (a : α) (b : α) => _inst_2 a b) (fun (i : Nat) => HPow.hPow.{u1, 0, u1} α Nat α (instHPow.{u1, 0} α Nat (Monoid.Pow.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))) a i) (Finset.range (Fintype.card.{u1} α _inst_3))) (Finset.univ.{u1} α _inst_3))
+but is expected to have type
+ forall {α : Type.{u1}} {a : α} [_inst_1 : Group.{u1} α] [_inst_2 : DecidableEq.{succ u1} α] [_inst_3 : Fintype.{u1} α], (forall (x : α), Membership.mem.{u1, u1} α (Subgroup.{u1} α _inst_1) (SetLike.instMembership.{u1, u1} (Subgroup.{u1} α _inst_1) α (Subgroup.instSetLikeSubgroup.{u1} α _inst_1)) x (Subgroup.zpowers.{u1} α _inst_1 a)) -> (Eq.{succ u1} (Finset.{u1} α) (Finset.image.{0, u1} Nat α (fun (a : α) (b : α) => _inst_2 a b) (fun (i : Nat) => HPow.hPow.{u1, 0, u1} α Nat α (instHPow.{u1, 0} α Nat (Monoid.Pow.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))) a i) (Finset.range (Fintype.card.{u1} α _inst_3))) (Finset.univ.{u1} α _inst_3))
+Case conversion may be inaccurate. Consider using '#align is_cyclic.image_range_card IsCyclic.image_range_cardₓ'. -/
@[to_additive]
theorem IsCyclic.image_range_card (ha : ∀ x : α, x ∈ zpowers a) :
Finset.image (fun i => a ^ i) (range (Fintype.card α)) = univ := by
@@ -376,6 +442,12 @@ private theorem card_order_of_eq_totient_aux₁ :
simpa [← cons_self_proper_divisors hd0, ← h1] using h2
#align card_order_of_eq_totient_aux₁ card_order_of_eq_totient_aux₁
+/- warning: card_order_of_eq_totient_aux₂ -> card_orderOf_eq_totient_aux₂ is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} [_inst_1 : Group.{u1} α] [_inst_2 : DecidableEq.{succ u1} α] [_inst_3 : Fintype.{u1} α], (forall (n : Nat), (LT.lt.{0} Nat Nat.hasLt (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) n) -> (LE.le.{0} Nat Nat.hasLe (Finset.card.{u1} α (Finset.filter.{u1} α (fun (a : α) => Eq.{succ u1} α (HPow.hPow.{u1, 0, u1} α Nat α (instHPow.{u1, 0} α Nat (Monoid.Pow.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))) a n) (OfNat.ofNat.{u1} α 1 (OfNat.mk.{u1} α 1 (One.one.{u1} α (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))))))) (fun (a : α) => _inst_2 (HPow.hPow.{u1, 0, u1} α Nat α (instHPow.{u1, 0} α Nat (Monoid.Pow.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))) a n) (OfNat.ofNat.{u1} α 1 (OfNat.mk.{u1} α 1 (One.one.{u1} α (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))))))) (Finset.univ.{u1} α _inst_3))) n)) -> (forall {d : Nat}, (Dvd.Dvd.{0} Nat Nat.hasDvd d (Fintype.card.{u1} α _inst_3)) -> (Eq.{1} Nat (Finset.card.{u1} α (Finset.filter.{u1} α (fun (a : α) => Eq.{1} Nat (orderOf.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)) a) d) (fun (a : α) => Nat.decidableEq (orderOf.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)) a) d) (Finset.univ.{u1} α _inst_3))) (Nat.totient d)))
+but is expected to have type
+ forall {α : Type.{u1}} [_inst_1 : Group.{u1} α] [_inst_2 : DecidableEq.{succ u1} α] [_inst_3 : Fintype.{u1} α], (forall (n : Nat), (LT.lt.{0} Nat instLTNat (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) n) -> (LE.le.{0} Nat instLENat (Finset.card.{u1} α (Finset.filter.{u1} α (fun (a : α) => Eq.{succ u1} α (HPow.hPow.{u1, 0, u1} α Nat α (instHPow.{u1, 0} α Nat (Monoid.Pow.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))) a n) (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α (InvOneClass.toOne.{u1} α (DivInvOneMonoid.toInvOneClass.{u1} α (DivisionMonoid.toDivInvOneMonoid.{u1} α (Group.toDivisionMonoid.{u1} α _inst_1))))))) (fun (a : α) => _inst_2 (HPow.hPow.{u1, 0, u1} α Nat α (instHPow.{u1, 0} α Nat (Monoid.Pow.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))) a n) (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α (InvOneClass.toOne.{u1} α (DivInvOneMonoid.toInvOneClass.{u1} α (DivisionMonoid.toDivInvOneMonoid.{u1} α (Group.toDivisionMonoid.{u1} α _inst_1))))))) (Finset.univ.{u1} α _inst_3))) n)) -> (forall {d : Nat}, (Dvd.dvd.{0} Nat Nat.instDvdNat d (Fintype.card.{u1} α _inst_3)) -> (Eq.{1} Nat (Finset.card.{u1} α (Finset.filter.{u1} α (fun (a : α) => Eq.{1} Nat (orderOf.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)) a) d) (fun (a : α) => instDecidableEqNat (orderOf.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)) a) d) (Finset.univ.{u1} α _inst_3))) (Nat.totient d)))
+Case conversion may be inaccurate. Consider using '#align card_order_of_eq_totient_aux₂ card_orderOf_eq_totient_aux₂ₓ'. -/
theorem card_orderOf_eq_totient_aux₂ {d : ℕ} (hd : d ∣ Fintype.card α) :
(univ.filterₓ fun a : α => orderOf a = d).card = φ d :=
by
@@ -414,6 +486,12 @@ theorem card_orderOf_eq_totient_aux₂ {d : ℕ} (hd : d ∣ Fintype.card α) :
#align card_order_of_eq_totient_aux₂ card_orderOf_eq_totient_aux₂
+/- warning: is_cyclic_of_card_pow_eq_one_le -> isCyclic_of_card_pow_eq_one_le is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} [_inst_1 : Group.{u1} α] [_inst_2 : DecidableEq.{succ u1} α] [_inst_3 : Fintype.{u1} α], (forall (n : Nat), (LT.lt.{0} Nat Nat.hasLt (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) n) -> (LE.le.{0} Nat Nat.hasLe (Finset.card.{u1} α (Finset.filter.{u1} α (fun (a : α) => Eq.{succ u1} α (HPow.hPow.{u1, 0, u1} α Nat α (instHPow.{u1, 0} α Nat (Monoid.Pow.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))) a n) (OfNat.ofNat.{u1} α 1 (OfNat.mk.{u1} α 1 (One.one.{u1} α (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))))))) (fun (a : α) => _inst_2 (HPow.hPow.{u1, 0, u1} α Nat α (instHPow.{u1, 0} α Nat (Monoid.Pow.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))) a n) (OfNat.ofNat.{u1} α 1 (OfNat.mk.{u1} α 1 (One.one.{u1} α (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))))))) (Finset.univ.{u1} α _inst_3))) n)) -> (IsCyclic.{u1} α _inst_1)
+but is expected to have type
+ forall {α : Type.{u1}} [_inst_1 : Group.{u1} α] [_inst_2 : DecidableEq.{succ u1} α] [_inst_3 : Fintype.{u1} α], (forall (n : Nat), (LT.lt.{0} Nat instLTNat (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) n) -> (LE.le.{0} Nat instLENat (Finset.card.{u1} α (Finset.filter.{u1} α (fun (a : α) => Eq.{succ u1} α (HPow.hPow.{u1, 0, u1} α Nat α (instHPow.{u1, 0} α Nat (Monoid.Pow.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))) a n) (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α (InvOneClass.toOne.{u1} α (DivInvOneMonoid.toInvOneClass.{u1} α (DivisionMonoid.toDivInvOneMonoid.{u1} α (Group.toDivisionMonoid.{u1} α _inst_1))))))) (fun (a : α) => _inst_2 (HPow.hPow.{u1, 0, u1} α Nat α (instHPow.{u1, 0} α Nat (Monoid.Pow.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)))) a n) (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α (InvOneClass.toOne.{u1} α (DivInvOneMonoid.toInvOneClass.{u1} α (DivisionMonoid.toDivInvOneMonoid.{u1} α (Group.toDivisionMonoid.{u1} α _inst_1))))))) (Finset.univ.{u1} α _inst_3))) n)) -> (IsCyclic.{u1} α _inst_1)
+Case conversion may be inaccurate. Consider using '#align is_cyclic_of_card_pow_eq_one_le isCyclic_of_card_pow_eq_one_leₓ'. -/
theorem isCyclic_of_card_pow_eq_one_le : IsCyclic α :=
have : (univ.filterₓ fun a : α => orderOf a = Fintype.card α).Nonempty :=
card_pos.1 <| by
@@ -423,6 +501,12 @@ theorem isCyclic_of_card_pow_eq_one_le : IsCyclic α :=
isCyclic_of_orderOf_eq_card x (Finset.mem_filter.1 hx).2
#align is_cyclic_of_card_pow_eq_one_le isCyclic_of_card_pow_eq_one_le
+/- warning: is_add_cyclic_of_card_pow_eq_one_le -> isAddCyclic_of_card_pow_eq_one_le is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} [_inst_4 : AddGroup.{u1} α] [_inst_5 : DecidableEq.{succ u1} α] [_inst_6 : Fintype.{u1} α], (forall (n : Nat), (LT.lt.{0} Nat Nat.hasLt (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) n) -> (LE.le.{0} Nat Nat.hasLe (Finset.card.{u1} α (Finset.filter.{u1} α (fun (a : α) => Eq.{succ u1} α (SMul.smul.{0, u1} Nat α (AddMonoid.SMul.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_4))) n a) (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α (AddZeroClass.toHasZero.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_4)))))))) (fun (a : α) => _inst_5 (SMul.smul.{0, u1} Nat α (AddMonoid.SMul.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_4))) n a) (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α (AddZeroClass.toHasZero.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_4)))))))) (Finset.univ.{u1} α _inst_6))) n)) -> (IsAddCyclic.{u1} α _inst_4)
+but is expected to have type
+ forall {α : Type.{u1}} [_inst_4 : AddGroup.{u1} α] [_inst_5 : DecidableEq.{succ u1} α] [_inst_6 : Fintype.{u1} α], (forall (n : Nat), (LT.lt.{0} Nat instLTNat (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) n) -> (LE.le.{0} Nat instLENat (Finset.card.{u1} α (Finset.filter.{u1} α (fun (a : α) => Eq.{succ u1} α (HSMul.hSMul.{0, u1, u1} Nat α α (instHSMul.{0, u1} Nat α (AddMonoid.SMul.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_4)))) n a) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_4))))))) (fun (a : α) => _inst_5 (HSMul.hSMul.{0, u1, u1} Nat α α (instHSMul.{0, u1} Nat α (AddMonoid.SMul.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_4)))) n a) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_4))))))) (Finset.univ.{u1} α _inst_6))) n)) -> (IsAddCyclic.{u1} α _inst_4)
+Case conversion may be inaccurate. Consider using '#align is_add_cyclic_of_card_pow_eq_one_le isAddCyclic_of_card_pow_eq_one_leₓ'. -/
theorem isAddCyclic_of_card_pow_eq_one_le {α} [AddGroup α] [DecidableEq α] [Fintype α]
(hn : ∀ n : ℕ, 0 < n → (univ.filterₓ fun a : α => n • a = 0).card ≤ n) : IsAddCyclic α :=
by
@@ -434,20 +518,33 @@ attribute [to_additive isCyclic_of_card_pow_eq_one_le] isAddCyclic_of_card_pow_e
end Totient
+/- warning: is_cyclic.card_order_of_eq_totient -> IsCyclic.card_orderOf_eq_totient is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} [_inst_1 : Group.{u1} α] [_inst_2 : IsCyclic.{u1} α _inst_1] [_inst_3 : Fintype.{u1} α] {d : Nat}, (Dvd.Dvd.{0} Nat Nat.hasDvd d (Fintype.card.{u1} α _inst_3)) -> (Eq.{1} Nat (Finset.card.{u1} α (Finset.filter.{u1} α (fun (a : α) => Eq.{1} Nat (orderOf.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)) a) d) (fun (a : α) => Nat.decidableEq (orderOf.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)) a) d) (Finset.univ.{u1} α _inst_3))) (Nat.totient d))
+but is expected to have type
+ forall {α : Type.{u1}} [_inst_1 : Group.{u1} α] [_inst_2 : IsCyclic.{u1} α _inst_1] [_inst_3 : Fintype.{u1} α] {d : Nat}, (Dvd.dvd.{0} Nat Nat.instDvdNat d (Fintype.card.{u1} α _inst_3)) -> (Eq.{1} Nat (Finset.card.{u1} α (Finset.filter.{u1} α (fun (a : α) => Eq.{1} Nat (orderOf.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)) a) d) (fun (a : α) => instDecidableEqNat (orderOf.{u1} α (DivInvMonoid.toMonoid.{u1} α (Group.toDivInvMonoid.{u1} α _inst_1)) a) d) (Finset.univ.{u1} α _inst_3))) (Nat.totient d))
+Case conversion may be inaccurate. Consider using '#align is_cyclic.card_order_of_eq_totient IsCyclic.card_orderOf_eq_totientₓ'. -/
theorem IsCyclic.card_orderOf_eq_totient [IsCyclic α] [Fintype α] {d : ℕ}
(hd : d ∣ Fintype.card α) : (univ.filterₓ fun a : α => orderOf a = d).card = totient d := by
classical apply card_orderOf_eq_totient_aux₂ (fun n => IsCyclic.card_pow_eq_one_le) hd
#align is_cyclic.card_order_of_eq_totient IsCyclic.card_orderOf_eq_totient
-theorem IsAddCyclic.card_order_of_eq_totient {α} [AddGroup α] [IsAddCyclic α] [Fintype α] {d : ℕ}
+/- warning: is_add_cyclic.card_order_of_eq_totient -> IsAddCyclic.card_orderOf_eq_totient is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} [_inst_2 : AddGroup.{u1} α] [_inst_3 : IsAddCyclic.{u1} α _inst_2] [_inst_4 : Fintype.{u1} α] {d : Nat}, (Dvd.Dvd.{0} Nat Nat.hasDvd d (Fintype.card.{u1} α _inst_4)) -> (Eq.{1} Nat (Finset.card.{u1} α (Finset.filter.{u1} α (fun (a : α) => Eq.{1} Nat (addOrderOf.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_2)) a) d) (fun (a : α) => Nat.decidableEq (addOrderOf.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_2)) a) d) (Finset.univ.{u1} α _inst_4))) (Nat.totient d))
+but is expected to have type
+ forall {α : Type.{u1}} [_inst_2 : AddGroup.{u1} α] [_inst_3 : IsAddCyclic.{u1} α _inst_2] [_inst_4 : Fintype.{u1} α] {d : Nat}, (Dvd.dvd.{0} Nat Nat.instDvdNat d (Fintype.card.{u1} α _inst_4)) -> (Eq.{1} Nat (Finset.card.{u1} α (Finset.filter.{u1} α (fun (a : α) => Eq.{1} Nat (addOrderOf.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_2)) a) d) (fun (a : α) => instDecidableEqNat (addOrderOf.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_2)) a) d) (Finset.univ.{u1} α _inst_4))) (Nat.totient d))
+Case conversion may be inaccurate. Consider using '#align is_add_cyclic.card_order_of_eq_totient IsAddCyclic.card_orderOf_eq_totientₓ'. -/
+theorem IsAddCyclic.card_orderOf_eq_totient {α} [AddGroup α] [IsAddCyclic α] [Fintype α] {d : ℕ}
(hd : d ∣ Fintype.card α) : (univ.filterₓ fun a : α => addOrderOf a = d).card = totient d :=
by
obtain ⟨g, hg⟩ := id ‹IsAddCyclic α›
exact @IsCyclic.card_orderOf_eq_totient (Multiplicative α) _ ⟨⟨g, hg⟩⟩ _ _ hd
-#align is_add_cyclic.card_order_of_eq_totient IsAddCyclic.card_order_of_eq_totient
+#align is_add_cyclic.card_order_of_eq_totient IsAddCyclic.card_orderOf_eq_totient
-attribute [to_additive IsCyclic.card_orderOf_eq_totient] IsAddCyclic.card_order_of_eq_totient
+attribute [to_additive IsCyclic.card_orderOf_eq_totient] IsAddCyclic.card_orderOf_eq_totient
+#print isSimpleGroup_of_prime_card /-
/-- 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]
@@ -465,7 +562,8 @@ theorem isSimpleGroup_of_prime_card {α : Type u} [Group α] [Fintype α] {p :
apply eq_bot_of_subsingleton
· exact eq_top_of_card_eq _ (hp.trans h.symm)⟩
#align is_simple_group_of_prime_card isSimpleGroup_of_prime_card
-#align is_simple_add_group_of_prime_card is_simple_add_group_of_prime_card
+#align is_simple_add_group_of_prime_card isSimpleAddGroup_of_prime_card
+-/
end Cyclic
@@ -475,6 +573,12 @@ open Subgroup
variable {G : Type _} {H : Type _} [Group G] [Group H]
+/- warning: commutative_of_cyclic_center_quotient -> commutative_of_cyclic_center_quotient is a dubious translation:
+lean 3 declaration is
+ forall {G : Type.{u1}} {H : Type.{u2}} [_inst_1 : Group.{u1} G] [_inst_2 : Group.{u2} H] [_inst_3 : IsCyclic.{u2} H _inst_2] (f : MonoidHom.{u1, u2} G H (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_1))) (Monoid.toMulOneClass.{u2} H (DivInvMonoid.toMonoid.{u2} H (Group.toDivInvMonoid.{u2} H _inst_2)))), (LE.le.{u1} (Subgroup.{u1} G _inst_1) (Preorder.toHasLe.{u1} (Subgroup.{u1} G _inst_1) (PartialOrder.toPreorder.{u1} (Subgroup.{u1} G _inst_1) (SetLike.partialOrder.{u1, u1} (Subgroup.{u1} G _inst_1) G (Subgroup.setLike.{u1} G _inst_1)))) (MonoidHom.ker.{u1, u2} G _inst_1 H (Monoid.toMulOneClass.{u2} H (DivInvMonoid.toMonoid.{u2} H (Group.toDivInvMonoid.{u2} H _inst_2))) f) (Subgroup.center.{u1} G _inst_1)) -> (forall (a : G) (b : G), Eq.{succ u1} G (HMul.hMul.{u1, u1, u1} G G G (instHMul.{u1} G (MulOneClass.toHasMul.{u1} G (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_1))))) a b) (HMul.hMul.{u1, u1, u1} G G G (instHMul.{u1} G (MulOneClass.toHasMul.{u1} G (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_1))))) b a))
+but is expected to have type
+ forall {G : Type.{u1}} {H : Type.{u2}} [_inst_1 : Group.{u1} G] [_inst_2 : Group.{u2} H] [_inst_3 : IsCyclic.{u2} H _inst_2] (f : MonoidHom.{u1, u2} G H (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_1))) (Monoid.toMulOneClass.{u2} H (DivInvMonoid.toMonoid.{u2} H (Group.toDivInvMonoid.{u2} H _inst_2)))), (LE.le.{u1} (Subgroup.{u1} G _inst_1) (Preorder.toLE.{u1} (Subgroup.{u1} G _inst_1) (PartialOrder.toPreorder.{u1} (Subgroup.{u1} G _inst_1) (OmegaCompletePartialOrder.toPartialOrder.{u1} (Subgroup.{u1} G _inst_1) (CompleteLattice.instOmegaCompletePartialOrder.{u1} (Subgroup.{u1} G _inst_1) (Subgroup.instCompleteLatticeSubgroup.{u1} G _inst_1))))) (MonoidHom.ker.{u1, u2} G _inst_1 H (Monoid.toMulOneClass.{u2} H (DivInvMonoid.toMonoid.{u2} H (Group.toDivInvMonoid.{u2} H _inst_2))) f) (Subgroup.center.{u1} G _inst_1)) -> (forall (a : G) (b : G), Eq.{succ u1} G (HMul.hMul.{u1, u1, u1} G G G (instHMul.{u1} G (MulOneClass.toMul.{u1} G (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_1))))) a b) (HMul.hMul.{u1, u1, u1} G G G (instHMul.{u1} G (MulOneClass.toMul.{u1} G (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_1))))) b a))
+Case conversion may be inaccurate. Consider using '#align commutative_of_cyclic_center_quotient commutative_of_cyclic_center_quotientₓ'. -/
/-- A group is commutative if the quotient by the center is cyclic.
Also see `comm_group_of_cycle_center_quotient` for the `comm_group` instance. -/
@[to_additive commutative_of_add_cyclic_center_quotient
@@ -500,6 +604,12 @@ theorem commutative_of_cyclic_center_quotient [IsCyclic H] (f : G →* H) (hf :
#align commutative_of_cyclic_center_quotient commutative_of_cyclic_center_quotient
#align commutative_of_add_cyclic_center_quotient commutative_of_add_cyclic_center_quotient
+/- warning: comm_group_of_cycle_center_quotient -> commGroupOfCycleCenterQuotient is a dubious translation:
+lean 3 declaration is
+ forall {G : Type.{u1}} {H : Type.{u2}} [_inst_1 : Group.{u1} G] [_inst_2 : Group.{u2} H] [_inst_3 : IsCyclic.{u2} H _inst_2] (f : MonoidHom.{u1, u2} G H (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_1))) (Monoid.toMulOneClass.{u2} H (DivInvMonoid.toMonoid.{u2} H (Group.toDivInvMonoid.{u2} H _inst_2)))), (LE.le.{u1} (Subgroup.{u1} G _inst_1) (Preorder.toHasLe.{u1} (Subgroup.{u1} G _inst_1) (PartialOrder.toPreorder.{u1} (Subgroup.{u1} G _inst_1) (SetLike.partialOrder.{u1, u1} (Subgroup.{u1} G _inst_1) G (Subgroup.setLike.{u1} G _inst_1)))) (MonoidHom.ker.{u1, u2} G _inst_1 H (Monoid.toMulOneClass.{u2} H (DivInvMonoid.toMonoid.{u2} H (Group.toDivInvMonoid.{u2} H _inst_2))) f) (Subgroup.center.{u1} G _inst_1)) -> (CommGroup.{u1} G)
+but is expected to have type
+ forall {G : Type.{u1}} {H : Type.{u2}} [_inst_1 : Group.{u1} G] [_inst_2 : Group.{u2} H] [_inst_3 : IsCyclic.{u2} H _inst_2] (f : MonoidHom.{u1, u2} G H (Monoid.toMulOneClass.{u1} G (DivInvMonoid.toMonoid.{u1} G (Group.toDivInvMonoid.{u1} G _inst_1))) (Monoid.toMulOneClass.{u2} H (DivInvMonoid.toMonoid.{u2} H (Group.toDivInvMonoid.{u2} H _inst_2)))), (LE.le.{u1} (Subgroup.{u1} G _inst_1) (Preorder.toLE.{u1} (Subgroup.{u1} G _inst_1) (PartialOrder.toPreorder.{u1} (Subgroup.{u1} G _inst_1) (OmegaCompletePartialOrder.toPartialOrder.{u1} (Subgroup.{u1} G _inst_1) (CompleteLattice.instOmegaCompletePartialOrder.{u1} (Subgroup.{u1} G _inst_1) (Subgroup.instCompleteLatticeSubgroup.{u1} G _inst_1))))) (MonoidHom.ker.{u1, u2} G _inst_1 H (Monoid.toMulOneClass.{u2} H (DivInvMonoid.toMonoid.{u2} H (Group.toDivInvMonoid.{u2} H _inst_2))) f) (Subgroup.center.{u1} G _inst_1)) -> (CommGroup.{u1} G)
+Case conversion may be inaccurate. Consider using '#align comm_group_of_cycle_center_quotient commGroupOfCycleCenterQuotientₓ'. -/
/-- A group is commutative if the quotient by the center is cyclic. -/
@[to_additive commutativeOfAddCycleCenterQuotient
"A group is commutative if the quotient by\n the center is cyclic."]
@@ -532,6 +642,7 @@ instance (priority := 100) : IsCyclic α :=
· rw [ht]
apply Subgroup.mem_top
+#print IsSimpleGroup.prime_card /-
@[to_additive]
theorem prime_card [Fintype α] : (Fintype.card α).Prime :=
by
@@ -557,11 +668,13 @@ theorem prime_card [Fintype α] : (Fintype.card α).Prime :=
exact Subgroup.mem_zpowers _
#align is_simple_group.prime_card IsSimpleGroup.prime_card
#align is_simple_add_group.prime_card IsSimpleAddGroup.prime_card
+-/
end CommGroup
end IsSimpleGroup
+#print CommGroup.is_simple_iff_isCyclic_and_prime_card /-
@[to_additive AddCommGroup.is_simple_iff_is_add_cyclic_and_prime_card]
theorem CommGroup.is_simple_iff_isCyclic_and_prime_card [Fintype α] [CommGroup α] :
IsSimpleGroup α ↔ IsCyclic α ∧ (Fintype.card α).Prime :=
@@ -574,11 +687,13 @@ theorem CommGroup.is_simple_iff_isCyclic_and_prime_card [Fintype α] [CommGroup
exact isSimpleGroup_of_prime_card rfl
#align comm_group.is_simple_iff_is_cyclic_and_prime_card CommGroup.is_simple_iff_isCyclic_and_prime_card
#align add_comm_group.is_simple_iff_is_add_cyclic_and_prime_card AddCommGroup.is_simple_iff_is_add_cyclic_and_prime_card
+-/
section Exponent
open Monoid
+#print IsCyclic.exponent_eq_card /-
@[to_additive]
theorem IsCyclic.exponent_eq_card [Group α] [IsCyclic α] [Fintype α] :
exponent α = Fintype.card α :=
@@ -591,7 +706,9 @@ theorem IsCyclic.exponent_eq_card [Group α] [IsCyclic α] [Fintype α] :
exact order_dvd_exponent _
#align is_cyclic.exponent_eq_card IsCyclic.exponent_eq_card
#align is_add_cyclic.exponent_eq_card IsAddCyclic.exponent_eq_card
+-/
+#print IsCyclic.of_exponent_eq_card /-
@[to_additive]
theorem IsCyclic.of_exponent_eq_card [CommGroup α] [Fintype α] (h : exponent α = Fintype.card α) :
IsCyclic α :=
@@ -599,14 +716,18 @@ theorem IsCyclic.of_exponent_eq_card [CommGroup α] [Fintype α] (h : exponent
isCyclic_of_orderOf_eq_card g <| hg.trans <| exponent_eq_max'_orderOf.symm.trans h
#align is_cyclic.of_exponent_eq_card IsCyclic.of_exponent_eq_card
#align is_add_cyclic.of_exponent_eq_card IsAddCyclic.of_exponent_eq_card
+-/
+#print IsCyclic.iff_exponent_eq_card /-
@[to_additive]
theorem IsCyclic.iff_exponent_eq_card [CommGroup α] [Fintype α] :
IsCyclic α ↔ exponent α = Fintype.card α :=
⟨fun h => IsCyclic.exponent_eq_card, IsCyclic.of_exponent_eq_card⟩
#align is_cyclic.iff_exponent_eq_card IsCyclic.iff_exponent_eq_card
#align is_add_cyclic.iff_exponent_eq_card IsAddCyclic.iff_exponent_eq_card
+-/
+#print IsCyclic.exponent_eq_zero_of_infinite /-
@[to_additive]
theorem IsCyclic.exponent_eq_zero_of_infinite [Group α] [IsCyclic α] [Infinite α] :
exponent α = 0 :=
@@ -614,6 +735,7 @@ theorem IsCyclic.exponent_eq_zero_of_infinite [Group α] [IsCyclic α] [Infinite
exponent_eq_zero_of_order_zero <| Infinite.orderOf_eq_zero_of_forall_mem_zpowers hg
#align is_cyclic.exponent_eq_zero_of_infinite IsCyclic.exponent_eq_zero_of_infinite
#align is_add_cyclic.exponent_eq_zero_of_infinite IsAddCyclic.exponent_eq_zero_of_infinite
+-/
end Exponent
mathlib commit https://github.com/leanprover-community/mathlib/commit/09079525fd01b3dda35e96adaa08d2f943e1648c
@@ -55,13 +55,13 @@ attribute [local instance] setFintype
open Subgroup
-/- ./././Mathport/Syntax/Translate/Command.lean:388:30: infer kinds are unsupported in Lean 4: #[`exists_generator] [] -/
+/- ./././Mathport/Syntax/Translate/Command.lean:393:30: infer kinds are unsupported in Lean 4: #[`exists_generator] [] -/
/-- 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
#align is_add_cyclic IsAddCyclic
-/- ./././Mathport/Syntax/Translate/Command.lean:388:30: infer kinds are unsupported in Lean 4: #[`exists_generator] [] -/
+/- ./././Mathport/Syntax/Translate/Command.lean:393:30: infer kinds are unsupported in Lean 4: #[`exists_generator] [] -/
/-- A group is called *cyclic* if it is generated by a single element. -/
@[to_additive IsAddCyclic]
class IsCyclic (α : Type u) [Group α] : Prop where
mathlib commit https://github.com/leanprover-community/mathlib/commit/3180fab693e2cee3bff62675571264cb8778b212
@@ -270,7 +270,7 @@ theorem IsCyclic.card_pow_eq_one_le [DecidableEq α] [Fintype α] [IsCyclic α]
have hm0 : 0 < m :=
Nat.pos_of_ne_zero fun hm0 =>
by
- rw [hm0, mul_zero, Fintype.card_eq_zero_iff] at hm
+ rw [hm0, MulZeroClass.mul_zero, Fintype.card_eq_zero_iff] at hm
exact hm.elim' 1
simp only [Set.toFinset_card, SetLike.coe_sort_coe]
rw [← orderOf_eq_card_zpowers, orderOf_pow g, orderOf_eq_card_of_forall_mem_zpowers hg]
mathlib commit https://github.com/leanprover-community/mathlib/commit/4c586d291f189eecb9d00581aeb3dd998ac34442
@@ -330,7 +330,7 @@ private theorem card_pow_eq_one_eq_order_of_aux (a : α) :
_ ≤
@Fintype.card (↑(univ.filterₓ fun b : α => b ^ orderOf a = 1) : Set α)
(Fintype.ofFinset _ fun _ => Iff.rfl) :=
- @Fintype.card_le_of_injective (zpowers a)
+ (@Fintype.card_le_of_injective (zpowers a)
(↑(univ.filterₓ fun b : α => b ^ orderOf a = 1) : Set α) (id _) (id _)
(fun b =>
⟨b.1,
@@ -339,7 +339,7 @@ private theorem card_pow_eq_one_eq_order_of_aux (a : α) :
let ⟨i, hi⟩ := b.2
rw [← hi, ← zpow_ofNat, ← zpow_mul, mul_comm, zpow_mul, zpow_ofNat,
pow_orderOf_eq_one, one_zpow]⟩⟩)
- fun _ _ h => Subtype.eq (Subtype.mk.inj h)
+ fun _ _ h => Subtype.eq (Subtype.mk.inj h))
_ = (univ.filterₓ fun b : α => b ^ orderOf a = 1).card := Fintype.card_ofFinset _ _
)
#align card_pow_eq_one_eq_order_of_aux card_pow_eq_one_eq_order_of_aux
@@ -409,7 +409,7 @@ theorem card_orderOf_eq_totient_aux₂ {d : ℕ} (hd : d ∣ Fintype.card α) :
· simp [h1]
· simp [card_order_of_eq_totient_aux₁ hn hmc h1]
_ < ∑ m in c.divisors, φ m :=
- sum_erase_lt_of_pos (mem_divisors.2 ⟨hd, hc0.ne'⟩) (totient_pos (pos_of_dvd_of_pos hd hc0))
+ (sum_erase_lt_of_pos (mem_divisors.2 ⟨hd, hc0.ne'⟩) (totient_pos (pos_of_dvd_of_pos hd hc0)))
_ = c := sum_totient _
#align card_order_of_eq_totient_aux₂ card_orderOf_eq_totient_aux₂
mathlib commit https://github.com/leanprover-community/mathlib/commit/bd9851ca476957ea4549eb19b40e7b5ade9428cc
@@ -111,7 +111,7 @@ theorem isCyclic_of_orderOf_eq_card [Fintype α] (x : α) (hx : orderOf x = Fint
classical
use x
simp_rw [← SetLike.mem_coe, ← Set.eq_univ_iff_forall]
- rw [← Fintype.card_congr (Equiv.Set.univ α), order_eq_card_zpowers] at hx
+ rw [← Fintype.card_congr (Equiv.Set.univ α), orderOf_eq_card_zpowers] at hx
exact Set.eq_of_subset_of_card_le (Set.subset_univ _) (ge_of_eq hx)
#align is_cyclic_of_order_of_eq_card isCyclic_of_orderOf_eq_card
#align is_add_cyclic_of_order_of_eq_card is_add_cyclic_of_orderOf_eq_card
@@ -153,7 +153,7 @@ theorem isCyclic_of_prime_card {α : Type u} [Group α] [Fintype α] {p : ℕ} [
theorem orderOf_eq_card_of_forall_mem_zpowers [Fintype α] {g : α} (hx : ∀ x, x ∈ zpowers g) :
orderOf g = Fintype.card α := by
classical
- rw [order_eq_card_zpowers]
+ rw [orderOf_eq_card_zpowers]
apply Fintype.card_of_finset'
simpa using hx
#align order_of_eq_card_of_forall_mem_zpowers orderOf_eq_card_of_forall_mem_zpowers
@@ -273,7 +273,7 @@ theorem IsCyclic.card_pow_eq_one_le [DecidableEq α] [Fintype α] [IsCyclic α]
rw [hm0, mul_zero, Fintype.card_eq_zero_iff] at hm
exact hm.elim' 1
simp only [Set.toFinset_card, SetLike.coe_sort_coe]
- rw [← order_eq_card_zpowers, orderOf_pow g, orderOf_eq_card_of_forall_mem_zpowers hg]
+ rw [← orderOf_eq_card_zpowers, orderOf_pow g, orderOf_eq_card_of_forall_mem_zpowers hg]
rw [hm]
rw [Nat.mul_div_cancel_left _ (gcd_pos_of_pos_left _ hn0), gcd_mul_left_left, hm,
Nat.mul_div_cancel _ hm0]
@@ -326,7 +326,7 @@ private theorem card_pow_eq_one_eq_order_of_aux (a : α) :
(Finset.univ.filterₓ fun b : α => b ^ orderOf a = 1).card = orderOf a :=
le_antisymm (hn _ (orderOf_pos a))
(calc
- orderOf a = @Fintype.card (zpowers a) (id _) := order_eq_card_zpowers
+ orderOf a = @Fintype.card (zpowers a) (id _) := orderOf_eq_card_zpowers
_ ≤
@Fintype.card (↑(univ.filterₓ fun b : α => b ^ orderOf a = 1) : Set α)
(Fintype.ofFinset _ fun _ => Iff.rfl) :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/bd9851ca476957ea4549eb19b40e7b5ade9428cc
Try to have the date on the same line as the attribute: this makes it easier to rewrite these into machine-readable form. One date is was added: the deprecation was in the same PR as nearby lemmas.
@@ -118,7 +118,7 @@ theorem MonoidHom.map_cyclic {G : Type*} [Group G] [h : IsCyclic G] (σ : G →*
rw [MonoidHom.map_zpow, ← hm, ← zpow_mul, ← zpow_mul']
#align monoid_hom.map_cyclic MonoidHom.map_cyclic
#align monoid_add_hom.map_add_cyclic AddMonoidHom.map_addCyclic
-/- 2024-02-21 -/ @[deprecated] alias MonoidAddHom.map_add_cyclic := AddMonoidHom.map_addCyclic
+@[deprecated] alias MonoidAddHom.map_add_cyclic := AddMonoidHom.map_addCyclic -- 2024-02-21
@[to_additive]
theorem isCyclic_of_orderOf_eq_card [Fintype α] (x : α) (hx : orderOf x = Fintype.card α) :
@@ -130,8 +130,8 @@ theorem isCyclic_of_orderOf_eq_card [Fintype α] (x : α) (hx : orderOf x = Fint
exact Set.eq_of_subset_of_card_le (Set.subset_univ _) (ge_of_eq hx)
#align is_cyclic_of_order_of_eq_card isCyclic_of_orderOf_eq_card
#align is_add_cyclic_of_order_of_eq_card isAddCyclic_of_addOrderOf_eq_card
-/- 2024-02-21 -/ @[deprecated] alias isAddCyclic_of_orderOf_eq_card :=
- isAddCyclic_of_addOrderOf_eq_card
+@[deprecated] -- 2024-02-21
+alias isAddCyclic_of_orderOf_eq_card := isAddCyclic_of_addOrderOf_eq_card
/-- 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."]
@@ -319,8 +319,8 @@ theorem IsCyclic.card_pow_eq_one_le [DecidableEq α] [Fintype α] [IsCyclic α]
exact le_of_dvd hn0 (Nat.gcd_dvd_left _ _)
#align is_cyclic.card_pow_eq_one_le IsCyclic.card_pow_eq_one_le
#align is_add_cyclic.card_pow_eq_one_le IsAddCyclic.card_nsmul_eq_zero_le
-/- 2024-02-21 -/
-@[deprecated] alias IsAddCyclic.card_pow_eq_one_le := IsAddCyclic.card_nsmul_eq_zero_le
+@[deprecated] -- 2024-02-21
+alias IsAddCyclic.card_pow_eq_one_le := IsAddCyclic.card_nsmul_eq_zero_le
end Classical
@@ -496,8 +496,8 @@ theorem isCyclic_of_card_pow_eq_one_le : IsCyclic α :=
isCyclic_of_orderOf_eq_card x (Finset.mem_filter.1 hx).2
#align is_cyclic_of_card_pow_eq_one_le isCyclic_of_card_pow_eq_one_le
-/- 2024-02-21 -/
-@[deprecated] alias isAddCyclic_of_card_pow_eq_one_le := isAddCyclic_of_card_nsmul_eq_zero_le
+@[deprecated] -- 2024-02-21
+alias isAddCyclic_of_card_pow_eq_one_le := isAddCyclic_of_card_nsmul_eq_zero_le
end Totient
@@ -507,8 +507,8 @@ theorem IsCyclic.card_orderOf_eq_totient [IsCyclic α] [Fintype α] {d : ℕ}
classical apply card_orderOf_eq_totient_aux₂ (fun n => IsCyclic.card_pow_eq_one_le) hd
#align is_cyclic.card_order_of_eq_totient IsCyclic.card_orderOf_eq_totient
-/- 2024-02-21 -/
-@[deprecated] alias IsAddCyclic.card_orderOf_eq_totient := IsAddCyclic.card_addOrderOf_eq_totient
+@[deprecated] -- 2024-02-21
+alias IsAddCyclic.card_orderOf_eq_totient := IsAddCyclic.card_addOrderOf_eq_totient
/-- A finite group of prime order is simple. -/
@[to_additive "A finite group of prime order is simple."]
@@ -563,7 +563,7 @@ theorem commutative_of_cyclic_center_quotient [IsCyclic H] (f : G →* H) (hf :
#align commutative_of_cyclic_center_quotient commutative_of_cyclic_center_quotient
#align commutative_of_add_cyclic_center_quotient commutative_of_addCyclic_center_quotient
-/- 2024-02-21 -/ @[deprecated]
+@[deprecated] -- 2024-02-21
alias commutative_of_add_cyclic_center_quotient := commutative_of_addCyclic_center_quotient
/-- A group is commutative if the quotient by the center is cyclic. -/
@@ -340,13 +340,18 @@ lemma IsCyclic.exists_ofOrder_eq_natCard [h : IsCyclic α] : ∃ g : α, orderOf
exact Nat.card_congr (Equiv.Set.univ α)
@[to_additive]
-lemma IsCyclic.iff_exists_ofOrder_eq_natCard_of_Fintype [Fintype α] :
+lemma isCyclic_iff_exists_ofOrder_eq_natCard [Finite α] :
IsCyclic α ↔ ∃ g : α, orderOf g = Nat.card α := by
refine ⟨fun h ↦ h.exists_ofOrder_eq_natCard, fun h ↦ ?_⟩
obtain ⟨g, hg⟩ := h
+ cases nonempty_fintype α
refine isCyclic_of_orderOf_eq_card g ?_
simp [hg]
+@[to_additive (attr := deprecated)] -- 2024-04-20
+protected alias IsCyclic.iff_exists_ofOrder_eq_natCard_of_Fintype :=
+ isCyclic_iff_exists_ofOrder_eq_natCard
+
section
variable [DecidableEq α] [Fintype α]
nat_cast
/int_cast
/rat_cast
to natCast
/intCast
/ratCast
(#11486)
Now that I am defining NNRat.cast
, I want a definitive answer to this naming issue. Plenty of lemmas in mathlib already use natCast
/intCast
/ratCast
over nat_cast
/int_cast
/rat_cast
, and this matches with the general expectation that underscore-separated name parts correspond to a single declaration.
@@ -374,7 +374,7 @@ theorem IsCyclic.unique_zpow_zmod (ha : ∀ x : α, x ∈ zpowers a) (x : α) :
· rw [← zpow_natCast, zpow_eq_zpow_iff_modEq, orderOf_eq_card_of_forall_mem_zpowers ha,
Int.modEq_comm, Int.modEq_iff_add_fac, ← ZMod.int_coe_zmod_eq_iff]
· rw [← zpow_natCast, zpow_eq_zpow_iff_modEq, orderOf_eq_card_of_forall_mem_zpowers ha,
- ← ZMod.int_cast_eq_int_cast_iff] at hy
+ ← ZMod.intCast_eq_intCast_iff] at hy
simp [hy]
@[to_additive]
@@ -384,8 +384,8 @@ lemma IsCyclic.ext {G : Type*} [Group G] [Fintype G] [IsCyclic G] {d : ℕ} {a b
specialize h g
subst hGcard
rw [pow_eq_pow_iff_modEq, orderOf_eq_card_of_forall_mem_zpowers hg,
- ← ZMod.nat_cast_eq_nat_cast_iff] at h
- simpa [ZMod.nat_cast_val, ZMod.cast_id'] using h
+ ← ZMod.natCast_eq_natCast_iff] at h
+ simpa [ZMod.natCast_val, ZMod.cast_id'] using h
end
@@ -640,7 +640,7 @@ section SpecificInstances
instance : IsAddCyclic ℤ := ⟨1, fun n ↦ ⟨n, by simp only [smul_eq_mul, mul_one]⟩⟩
instance ZMod.instIsAddCyclic (n : ℕ) : IsAddCyclic (ZMod n) :=
- isAddCyclic_of_surjective (Int.castRingHom _) ZMod.int_cast_surjective
+ isAddCyclic_of_surjective (Int.castRingHom _) ZMod.intCast_surjective
instance ZMod.instIsSimpleAddGroup {p : ℕ} [Fact p.Prime] : IsSimpleAddGroup (ZMod p) :=
AddCommGroup.is_simple_iff_isAddCyclic_and_prime_card.2
@@ -337,7 +337,7 @@ lemma IsCyclic.exists_ofOrder_eq_natCard [h : IsCyclic α] : ∃ g : α, orderOf
obtain ⟨g, hg⟩ := h.exists_generator
use g
rw [← card_zpowers g, (eq_top_iff' (zpowers g)).mpr hg]
- exact (Nat.card_congr (Equiv.Set.univ α))
+ exact Nat.card_congr (Equiv.Set.univ α)
@[to_additive]
lemma IsCyclic.iff_exists_ofOrder_eq_natCard_of_Fintype [Fintype α] :
@@ -752,7 +752,7 @@ noncomputable def zmodAddCyclicAddEquiv [AddGroup G] (h : IsAddCyclic G) :
congr
rw [← Nat.card_zmultiples]
exact Nat.card_congr (Equiv.subtypeUnivEquiv surj)
- exact (Int.quotientZMultiplesNatEquivZMod n)
+ exact Int.quotientZMultiplesNatEquivZMod n
|>.symm.trans <| QuotientAddGroup.quotientAddEquivOfEq kereq
|>.symm.trans <| QuotientAddGroup.quotientKerEquivOfSurjective (zmultiplesHom G g) surj
@@ -261,7 +261,7 @@ instance Subgroup.isCyclic {α : Type u} [Group α] [IsCyclic α] (H : Subgroup
by_contradiction fun h =>
Nat.find_min hex
(Int.ofNat_lt.1 <| by
- rw [← hk₄]; exact Int.emod_lt_of_pos _ (Int.coe_nat_pos.2 (Nat.find_spec hex).1))
+ rw [← hk₄]; exact Int.emod_lt_of_pos _ (Int.natCast_pos.2 (Nat.find_spec hex).1))
⟨Nat.pos_of_ne_zero h, hk₅⟩
⟨k / (Nat.find hex : ℤ),
Subtype.ext_iff_val.2
Take the content of
Algebra.BigOperators.List.Basic
Algebra.BigOperators.List.Lemmas
Algebra.BigOperators.Multiset.Basic
Algebra.BigOperators.Multiset.Lemmas
Algebra.BigOperators.Multiset.Order
Algebra.BigOperators.Order
and sort it into six files:
Algebra.Order.BigOperators.Group.List
. I credit Yakov for https://github.com/leanprover-community/mathlib/pull/8543.Algebra.Order.BigOperators.Group.Multiset
. Copyright inherited from Algebra.BigOperators.Multiset.Order
.Algebra.Order.BigOperators.Group.Finset
. Copyright inherited from Algebra.BigOperators.Order
.Algebra.Order.BigOperators.Ring.List
. I credit Stuart for https://github.com/leanprover-community/mathlib/pull/10184.Algebra.Order.BigOperators.Ring.Multiset
. I credit Ruben for https://github.com/leanprover-community/mathlib/pull/8787.Algebra.Order.BigOperators.Ring.Finset
. I credit Floris for https://github.com/leanprover-community/mathlib/pull/1294.Here are the design decisions at play:
Data.Nat.Order.Basic
in a few List
files.Algebra.Order.BigOperators
instead of Algebra.BigOperators.Order
because algebraic order theory is more of a theory than big operators algebra. Another reason is that algebraic order theory is the only way to mix pure order and pure algebra, while there are more ways to mix pure finiteness and pure algebra than just big operators.Algebra.Order.BigOperators.Group
should be additivisable (except a few Nat
- or Int
-specific lemmas). In contrast, things under Algebra.Order.BigOperators.Ring
are more prone to having heavy imports.List
vs Multiset
vs Finset
. This is not strictly necessary, and can be relaxed in cases where there aren't that many lemmas to be had. As an example, I could split out the AbsoluteValue
lemmas from Algebra.Order.BigOperators.Ring.Finset
to a file Algebra.Order.BigOperators.Ring.AbsoluteValue
and it could stay this way until too many lemmas are in this file (or a split is needed for import reasons), in which case we would need files Algebra.Order.BigOperators.Ring.AbsoluteValue.Finset
, Algebra.Order.BigOperators.Ring.AbsoluteValue.Multiset
, etc...Finsupp
big operator and finprod
/finsum
order lemmas also belong in Algebra.Order.BigOperators
. I haven't done so in this PR because the diff is big enough like that.@@ -3,7 +3,7 @@ Copyright (c) 2018 Johannes Hölzl. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl
-/
-import Mathlib.Algebra.BigOperators.Order
+import Mathlib.Algebra.Order.BigOperators.Ring.Finset
import Mathlib.Data.Nat.Totient
import Mathlib.GroupTheory.OrderOfElement
import Mathlib.GroupTheory.Subgroup.Simple
coe_nat
to natCast
(#11637)
Reduce the diff of #11499
All in the Int
namespace:
ofNat_eq_cast
→ ofNat_eq_natCast
cast_eq_cast_iff_Nat
→ natCast_inj
natCast_eq_ofNat
→ ofNat_eq_natCast
coe_nat_sub
→ natCast_sub
coe_nat_nonneg
→ natCast_nonneg
sign_coe_add_one
→ sign_natCast_add_one
nat_succ_eq_int_succ
→ natCast_succ
succ_neg_nat_succ
→ succ_neg_natCast_succ
coe_pred_of_pos
→ natCast_pred_of_pos
coe_nat_div
→ natCast_div
coe_nat_ediv
→ natCast_ediv
sign_coe_nat_of_nonzero
→ sign_natCast_of_ne_zero
toNat_coe_nat
→ toNat_natCast
toNat_coe_nat_add_one
→ toNat_natCast_add_one
coe_nat_dvd
→ natCast_dvd_natCast
coe_nat_dvd_left
→ natCast_dvd
coe_nat_dvd_right
→ dvd_natCast
le_coe_nat_sub
→ le_natCast_sub
succ_coe_nat_pos
→ succ_natCast_pos
coe_nat_modEq_iff
→ natCast_modEq_iff
coe_natAbs
→ natCast_natAbs
coe_nat_eq_zero
→ natCast_eq_zero
coe_nat_ne_zero
→ natCast_ne_zero
coe_nat_ne_zero_iff_pos
→ natCast_ne_zero_iff_pos
abs_coe_nat
→ abs_natCast
coe_nat_nonpos_iff
→ natCast_nonpos_iff
Also rename Nat.coe_nat_dvd
to Nat.cast_dvd_cast
@@ -255,7 +255,7 @@ instance Subgroup.isCyclic {α : Type u} [Group α] [IsCyclic α] (H : Subgroup
rw [← zpow_add, Int.emod_add_ediv, hk]; exact hx
have hk₄ : k % Nat.find hex = (k % Nat.find hex).natAbs := by
rw [Int.natAbs_of_nonneg
- (Int.emod_nonneg _ (Int.coe_nat_ne_zero_iff_pos.2 (Nat.find_spec hex).1))]
+ (Int.emod_nonneg _ (Int.natCast_ne_zero_iff_pos.2 (Nat.find_spec hex).1))]
have hk₅ : g ^ (k % Nat.find hex).natAbs ∈ H := by rwa [← zpow_natCast, ← hk₄]
have hk₆ : (k % (Nat.find hex : ℤ)).natAbs = 0 :=
by_contradiction fun h =>
LinearOrderedCommGroupWithZero
(#11716)
Reconstitute the file Algebra.Order.Monoid.WithZero
from three files:
Algebra.Order.Monoid.WithZero.Defs
Algebra.Order.Monoid.WithZero.Basic
Algebra.Order.WithZero
Avoid importing it in many files. Most uses were just to get le_zero_iff
to work on Nat
.
Before
After
@@ -454,7 +454,7 @@ theorem card_orderOf_eq_totient_aux₂ {d : ℕ} (hd : d ∣ Fintype.card α) :
by_contra h0
-- Must qualify `Finset.card_eq_zero` because of leanprover/lean4#2849
-- Must specify the argument `α` to avoid mathlib4#10830
- simp_rw [not_lt, _root_.le_zero_iff (α := ℕ), Finset.card_eq_zero] at h0
+ simp_rw [not_lt, Nat.le_zero, Finset.card_eq_zero] at h0
apply lt_irrefl c
calc
c = ∑ m in c.divisors, (univ.filter fun a : α => orderOf a = m).card := by
We add IsPrimitiveRoot.exists_pow_or_neg_mul_pow_of_isOfFinOrder
: If x
is a root of unity (spelled as IsOfFinOrder x
) in an n
-th cyclotomic extension of ℚ
, where n
is odd, and ζ
is a primitive n
-th root of unity, then there exists r < n
such that x = ζ^r
or x = -ζ^r
.
From flt-regular
@@ -332,6 +332,21 @@ theorem IsCyclic.exists_monoid_generator [Finite α] [IsCyclic α] :
#align is_cyclic.exists_monoid_generator IsCyclic.exists_monoid_generator
#align is_add_cyclic.exists_add_monoid_generator IsAddCyclic.exists_addMonoid_generator
+@[to_additive]
+lemma IsCyclic.exists_ofOrder_eq_natCard [h : IsCyclic α] : ∃ g : α, orderOf g = Nat.card α := by
+ obtain ⟨g, hg⟩ := h.exists_generator
+ use g
+ rw [← card_zpowers g, (eq_top_iff' (zpowers g)).mpr hg]
+ exact (Nat.card_congr (Equiv.Set.univ α))
+
+@[to_additive]
+lemma IsCyclic.iff_exists_ofOrder_eq_natCard_of_Fintype [Fintype α] :
+ IsCyclic α ↔ ∃ g : α, orderOf g = Nat.card α := by
+ refine ⟨fun h ↦ h.exists_ofOrder_eq_natCard, fun h ↦ ?_⟩
+ obtain ⟨g, hg⟩ := h
+ refine isCyclic_of_orderOf_eq_card g ?_
+ simp [hg]
+
section
variable [DecidableEq α] [Fintype α]
zpow_coe_nat
to zpow_natCast
(#11528)
... and add a deprecated alias for the old name. This is mostly just me discovering the power of F2
@@ -217,7 +217,7 @@ theorem Infinite.orderOf_eq_zero_of_forall_mem_zpowers [Infinite α] {g : α}
rw [← zpow_mod_orderOf] at hk
have : 0 ≤ (-k % orderOf g : ℤ) := Int.emod_nonneg (-k) (mod_cast ho.orderOf_pos.ne')
refine' ⟨(-k % orderOf g : ℤ).toNat, _⟩
- rwa [← zpow_coe_nat, Int.toNat_of_nonneg this]
+ rwa [← zpow_natCast, Int.toNat_of_nonneg this]
#align infinite.order_of_eq_zero_of_forall_mem_zpowers Infinite.orderOf_eq_zero_of_forall_mem_zpowers
#align infinite.add_order_of_eq_zero_of_forall_mem_zmultiples Infinite.addOrderOf_eq_zero_of_forall_mem_zmultiples
@@ -240,7 +240,7 @@ instance Subgroup.isCyclic {α : Type u} [Group α] [IsCyclic α] (H : Subgroup
Nat.pos_of_ne_zero fun h => hx₂ <| by
rw [← hk, Int.natAbs_eq_zero.mp h, zpow_zero], by
cases' k with k k
- · rw [Int.ofNat_eq_coe, Int.natAbs_cast k, ← zpow_coe_nat, ← Int.ofNat_eq_coe, hk]
+ · rw [Int.ofNat_eq_coe, Int.natAbs_cast k, ← zpow_natCast, ← Int.ofNat_eq_coe, hk]
exact hx₁
· rw [Int.natAbs_negSucc, ← Subgroup.inv_mem_iff H]; simp_all⟩
⟨⟨⟨g ^ Nat.find hex, (Nat.find_spec hex).2⟩, fun ⟨x, hx⟩ =>
@@ -256,7 +256,7 @@ instance Subgroup.isCyclic {α : Type u} [Group α] [IsCyclic α] (H : Subgroup
have hk₄ : k % Nat.find hex = (k % Nat.find hex).natAbs := by
rw [Int.natAbs_of_nonneg
(Int.emod_nonneg _ (Int.coe_nat_ne_zero_iff_pos.2 (Nat.find_spec hex).1))]
- have hk₅ : g ^ (k % Nat.find hex).natAbs ∈ H := by rwa [← zpow_coe_nat, ← hk₄]
+ have hk₅ : g ^ (k % Nat.find hex).natAbs ∈ H := by rwa [← zpow_natCast, ← hk₄]
have hk₆ : (k % (Nat.find hex : ℤ)).natAbs = 0 :=
by_contradiction fun h =>
Nat.find_min hex
@@ -299,7 +299,7 @@ theorem IsCyclic.card_pow_eq_one_le [DecidableEq α] [Fintype α] [IsCyclic α]
have hgmn : g ^ (m * Nat.gcd n (Fintype.card α)) = 1 := by
rw [pow_mul, hm, ← pow_gcd_card_eq_one_iff]; exact (mem_filter.1 hx).2
dsimp only
- rw [zpow_coe_nat, ← pow_mul, Nat.mul_div_cancel_left', hm]
+ rw [zpow_natCast, ← pow_mul, Nat.mul_div_cancel_left', hm]
refine' Nat.dvd_of_mul_dvd_mul_right (gcd_pos_of_pos_left (Fintype.card α) hn0) _
conv_lhs =>
rw [Nat.div_mul_cancel (Nat.gcd_dvd_right _ _), ←
@@ -356,9 +356,9 @@ theorem IsCyclic.unique_zpow_zmod (ha : ∀ x : α, x ∈ zpowers a) (x : α) :
∃! n : ZMod (Fintype.card α), x = a ^ n.val := by
obtain ⟨n, rfl⟩ := ha x
refine ⟨n, (?_ : a ^ n = _), fun y (hy : a ^ n = _) ↦ ?_⟩
- · rw [← zpow_coe_nat, zpow_eq_zpow_iff_modEq, orderOf_eq_card_of_forall_mem_zpowers ha,
+ · rw [← zpow_natCast, zpow_eq_zpow_iff_modEq, orderOf_eq_card_of_forall_mem_zpowers ha,
Int.modEq_comm, Int.modEq_iff_add_fac, ← ZMod.int_coe_zmod_eq_iff]
- · rw [← zpow_coe_nat, zpow_eq_zpow_iff_modEq, orderOf_eq_card_of_forall_mem_zpowers ha,
+ · rw [← zpow_natCast, zpow_eq_zpow_iff_modEq, orderOf_eq_card_of_forall_mem_zpowers ha,
← ZMod.int_cast_eq_int_cast_iff] at hy
simp [hy]
@@ -395,7 +395,7 @@ private theorem card_pow_eq_one_eq_orderOf_aux (a : α) :
mem_filter.2
⟨mem_univ _, by
let ⟨i, hi⟩ := b.2
- rw [← hi, ← zpow_coe_nat, ← zpow_mul, mul_comm, zpow_mul, zpow_coe_nat,
+ rw [← hi, ← zpow_natCast, ← zpow_mul, mul_comm, zpow_mul, zpow_natCast,
pow_orderOf_eq_one, one_zpow]⟩⟩)
fun _ _ h => Subtype.eq (Subtype.mk.inj h))
_ = (univ.filter fun b : α => b ^ orderOf a = 1).card := Fintype.card_ofFinset _ _
open Classical
(#11199)
We remove all but one open Classical
s, instead preferring to use open scoped Classical
. The only real side-effect this led to is moving a couple declarations to use Exists.choose
instead of Classical.choose
.
The first few commits are explicitly labelled regex replaces for ease of review.
@@ -282,7 +282,7 @@ open Finset Nat
section Classical
-open Classical
+open scoped Classical
@[to_additive IsAddCyclic.card_nsmul_eq_zero_le]
theorem IsCyclic.card_pow_eq_one_le [DecidableEq α] [Fintype α] [IsCyclic α] {n : ℕ} (hn0 : 0 < n) :
@@ -351,6 +351,27 @@ theorem IsCyclic.image_range_card (ha : ∀ x : α, x ∈ zpowers a) :
#align is_cyclic.image_range_card IsCyclic.image_range_card
#align is_add_cyclic.image_range_card IsAddCyclic.image_range_card
+@[to_additive]
+theorem IsCyclic.unique_zpow_zmod (ha : ∀ x : α, x ∈ zpowers a) (x : α) :
+ ∃! n : ZMod (Fintype.card α), x = a ^ n.val := by
+ obtain ⟨n, rfl⟩ := ha x
+ refine ⟨n, (?_ : a ^ n = _), fun y (hy : a ^ n = _) ↦ ?_⟩
+ · rw [← zpow_coe_nat, zpow_eq_zpow_iff_modEq, orderOf_eq_card_of_forall_mem_zpowers ha,
+ Int.modEq_comm, Int.modEq_iff_add_fac, ← ZMod.int_coe_zmod_eq_iff]
+ · rw [← zpow_coe_nat, zpow_eq_zpow_iff_modEq, orderOf_eq_card_of_forall_mem_zpowers ha,
+ ← ZMod.int_cast_eq_int_cast_iff] at hy
+ simp [hy]
+
+@[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 := by
+ obtain ⟨g, hg⟩ := IsCyclic.exists_generator (α := G)
+ specialize h g
+ subst hGcard
+ rw [pow_eq_pow_iff_modEq, orderOf_eq_card_of_forall_mem_zpowers hg,
+ ← ZMod.nat_cast_eq_nat_cast_iff] at h
+ simpa [ZMod.nat_cast_val, ZMod.cast_id'] using h
+
end
section Totient
@@ -108,7 +108,7 @@ theorem Nontrivial.of_not_isCyclic (nc : ¬IsCyclic α) : Nontrivial α := by
contrapose! nc
exact @isCyclic_of_subsingleton _ _ (not_nontrivial_iff_subsingleton.mp nc)
-@[to_additive MonoidAddHom.map_add_cyclic]
+@[to_additive]
theorem MonoidHom.map_cyclic {G : Type*} [Group G] [h : IsCyclic G] (σ : G →* G) :
∃ m : ℤ, ∀ g : G, σ g = g ^ m := by
obtain ⟨h, hG⟩ := IsCyclic.exists_generator (α := G)
@@ -117,9 +117,10 @@ theorem MonoidHom.map_cyclic {G : Type*} [Group G] [h : IsCyclic G] (σ : G →*
obtain ⟨n, rfl⟩ := hG g
rw [MonoidHom.map_zpow, ← hm, ← zpow_mul, ← zpow_mul']
#align monoid_hom.map_cyclic MonoidHom.map_cyclic
-#align monoid_add_hom.map_add_cyclic MonoidAddHom.map_add_cyclic
+#align monoid_add_hom.map_add_cyclic AddMonoidHom.map_addCyclic
+/- 2024-02-21 -/ @[deprecated] alias MonoidAddHom.map_add_cyclic := AddMonoidHom.map_addCyclic
-@[to_additive isAddCyclic_of_orderOf_eq_card]
+@[to_additive]
theorem isCyclic_of_orderOf_eq_card [Fintype α] (x : α) (hx : orderOf x = Fintype.card α) :
IsCyclic α := by
classical
@@ -128,11 +129,12 @@ theorem isCyclic_of_orderOf_eq_card [Fintype α] (x : α) (hx : orderOf x = Fint
rw [← Fintype.card_congr (Equiv.Set.univ α), ← Fintype.card_zpowers] at hx
exact Set.eq_of_subset_of_card_le (Set.subset_univ _) (ge_of_eq hx)
#align is_cyclic_of_order_of_eq_card isCyclic_of_orderOf_eq_card
-#align is_add_cyclic_of_order_of_eq_card isAddCyclic_of_orderOf_eq_card
+#align is_add_cyclic_of_order_of_eq_card isAddCyclic_of_addOrderOf_eq_card
+/- 2024-02-21 -/ @[deprecated] alias isAddCyclic_of_orderOf_eq_card :=
+ isAddCyclic_of_addOrderOf_eq_card
/-- Any non-identity element of a finite group of prime order generates the group. -/
-@[to_additive zmultiples_eq_top_of_prime_card "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 = ⊤ := by
have := card_subgroup_dvd_card (zpowers g)
@@ -140,18 +142,18 @@ theorem zpowers_eq_top_of_prime_card {G : Type*} [Group G] {_ : Fintype G} {p :
card_eq_iff_eq_top] at this
exact this
-@[to_additive mem_zmultiples_of_prime_card]
+@[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 := by
simp_rw [zpowers_eq_top_of_prime_card h hg, Subgroup.mem_top]
-@[to_additive mem_multiples_of_prime_card]
+@[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 := by
rw [mem_powers_iff_mem_zpowers]
exact mem_zpowers_of_prime_card h hg
-@[to_additive multiples_eq_top_of_prime_card]
+@[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 = ⊤ := by
ext x
@@ -176,7 +178,7 @@ theorem isCyclic_of_surjective {H G F : Type*} [Group H] [Group G] [hH : IsCycli
obtain ⟨n, rfl⟩ := hx a
exact ⟨n, (map_zpow _ _ _).symm⟩
-@[to_additive addOrderOf_eq_card_of_forall_mem_zmultiples]
+@[to_additive]
theorem orderOf_eq_card_of_forall_mem_zpowers [Fintype α] {g : α} (hx : ∀ x, x ∈ zpowers g) :
orderOf g = Fintype.card α := by
classical
@@ -196,7 +198,7 @@ theorem exists_pow_ne_one_of_isCyclic {G : Type*} [Group G] [Fintype G] [G_cycli
rw [← Fintype.card_zpowers, eq_comm, Subgroup.card_eq_iff_eq_top, eq_top_iff]
exact fun x _ ↦ ha x
-@[to_additive Infinite.addOrderOf_eq_zero_of_forall_mem_zmultiples]
+@[to_additive]
theorem Infinite.orderOf_eq_zero_of_forall_mem_zpowers [Infinite α] {g : α}
(h : ∀ x, x ∈ zpowers g) : orderOf g = 0 := by
classical
@@ -282,7 +284,7 @@ section Classical
open Classical
-@[to_additive IsAddCyclic.card_pow_eq_one_le]
+@[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 :=
let ⟨g, hg⟩ := IsCyclic.exists_generator (α := α)
@@ -316,7 +318,9 @@ theorem IsCyclic.card_pow_eq_one_le [DecidableEq α] [Fintype α] [IsCyclic α]
Nat.mul_div_cancel _ hm0]
exact le_of_dvd hn0 (Nat.gcd_dvd_left _ _)
#align is_cyclic.card_pow_eq_one_le IsCyclic.card_pow_eq_one_le
-#align is_add_cyclic.card_pow_eq_one_le IsAddCyclic.card_pow_eq_one_le
+#align is_add_cyclic.card_pow_eq_one_le IsAddCyclic.card_nsmul_eq_zero_le
+/- 2024-02-21 -/
+@[deprecated] alias IsAddCyclic.card_pow_eq_one_le := IsAddCyclic.card_nsmul_eq_zero_le
end Classical
@@ -354,6 +358,7 @@ section Totient
variable [DecidableEq α] [Fintype α]
(hn : ∀ n : ℕ, 0 < n → (univ.filter fun a : α => a ^ n = 1).card ≤ n)
+@[to_additive]
private theorem card_pow_eq_one_eq_orderOf_aux (a : α) :
(Finset.univ.filter fun b : α => b ^ orderOf a = 1).card = orderOf a :=
le_antisymm (hn _ (orderOf_pos a))
@@ -377,6 +382,7 @@ private theorem card_pow_eq_one_eq_orderOf_aux (a : α) :
-- Use φ for `Nat.totient`
open Nat
+@[to_additive]
private theorem card_orderOf_eq_totient_aux₁ :
∀ {d : ℕ},
d ∣ Fintype.card α →
@@ -403,6 +409,7 @@ private theorem card_orderOf_eq_totient_aux₁ :
filter_dvd_eq_divisors hd0, sum_totient, ← ha, card_pow_eq_one_eq_orderOf_aux hn a]
simpa [← cons_self_properDivisors hd0, ← h1] using h2
+@[to_additive]
theorem card_orderOf_eq_totient_aux₂ {d : ℕ} (hd : d ∣ Fintype.card α) :
(univ.filter fun a : α => orderOf a = d).card = φ d := by
let c := Fintype.card α
@@ -410,7 +417,8 @@ theorem card_orderOf_eq_totient_aux₂ {d : ℕ} (hd : d ∣ Fintype.card α) :
apply card_orderOf_eq_totient_aux₁ hn hd
by_contra h0
-- Must qualify `Finset.card_eq_zero` because of leanprover/lean4#2849
- simp only [not_lt, _root_.le_zero_iff, Finset.card_eq_zero] at h0
+ -- Must specify the argument `α` to avoid mathlib4#10830
+ simp_rw [not_lt, _root_.le_zero_iff (α := ℕ), Finset.card_eq_zero] at h0
apply lt_irrefl c
calc
c = ∑ m in c.divisors, (univ.filter fun a : α => orderOf a = m).card := by
@@ -437,6 +445,7 @@ theorem card_orderOf_eq_totient_aux₂ {d : ℕ} (hd : d ∣ Fintype.card α) :
_ = c := sum_totient _
#align card_order_of_eq_totient_aux₂ card_orderOf_eq_totient_aux₂
+@[to_additive isAddCyclic_of_card_nsmul_eq_zero_le]
theorem isCyclic_of_card_pow_eq_one_le : IsCyclic α :=
have : (univ.filter fun a : α => orderOf a = Fintype.card α).Nonempty :=
card_pos.1 <| by
@@ -446,30 +455,19 @@ theorem isCyclic_of_card_pow_eq_one_le : IsCyclic α :=
isCyclic_of_orderOf_eq_card x (Finset.mem_filter.1 hx).2
#align is_cyclic_of_card_pow_eq_one_le isCyclic_of_card_pow_eq_one_le
-theorem isAddCyclic_of_card_pow_eq_one_le {α} [AddGroup α] [DecidableEq α] [Fintype α]
- (hn : ∀ n : ℕ, 0 < n → (univ.filter fun a : α => n • a = 0).card ≤ n) : IsAddCyclic α := by
- obtain ⟨g, hg⟩ := (@isCyclic_of_card_pow_eq_one_le (Multiplicative α) _ _ (_) hn)
- exact ⟨⟨g, hg⟩⟩
-#align is_add_cyclic_of_card_pow_eq_one_le isAddCyclic_of_card_pow_eq_one_le
-
-attribute [to_additive existing isCyclic_of_card_pow_eq_one_le] isAddCyclic_of_card_pow_eq_one_le
+/- 2024-02-21 -/
+@[deprecated] alias isAddCyclic_of_card_pow_eq_one_le := isAddCyclic_of_card_nsmul_eq_zero_le
end Totient
+@[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 := by
classical apply card_orderOf_eq_totient_aux₂ (fun n => IsCyclic.card_pow_eq_one_le) hd
#align is_cyclic.card_order_of_eq_totient IsCyclic.card_orderOf_eq_totient
-theorem IsAddCyclic.card_orderOf_eq_totient {α : Type*} [AddGroup α] [IsAddCyclic α]
- [Fintype α] {d : ℕ} (hd : d ∣ Fintype.card α) :
- (univ.filter fun a : α => addOrderOf a = d).card = totient d := by
- obtain ⟨g, hg⟩ := id ‹IsAddCyclic α›
- apply @IsCyclic.card_orderOf_eq_totient (Multiplicative α) _ ⟨⟨g, hg⟩⟩ (_) _ hd
-#align is_add_cyclic.card_order_of_eq_totient IsAddCyclic.card_orderOf_eq_totient
-
-attribute [to_additive existing IsCyclic.card_orderOf_eq_totient]
- IsAddCyclic.card_orderOf_eq_totient
+/- 2024-02-21 -/
+@[deprecated] alias IsAddCyclic.card_orderOf_eq_totient := IsAddCyclic.card_addOrderOf_eq_totient
/-- A finite group of prime order is simple. -/
@[to_additive "A finite group of prime order is simple."]
@@ -500,7 +498,7 @@ variable {G : Type*} {H : Type*} [Group G] [Group H]
/-- 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 commutative_of_add_cyclic_center_quotient
+@[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)
@@ -522,7 +520,10 @@ theorem commutative_of_cyclic_center_quotient [IsCyclic H] (f : G →* H) (hf :
_ = y ^ m * y ^ n * y ^ (-m) * (y ^ (-n) * b * a) := by rw [mem_center_iff.1 hb]
_ = b * a := by group
#align commutative_of_cyclic_center_quotient commutative_of_cyclic_center_quotient
-#align commutative_of_add_cyclic_center_quotient commutative_of_add_cyclic_center_quotient
+#align commutative_of_add_cyclic_center_quotient commutative_of_addCyclic_center_quotient
+
+/- 2024-02-21 -/ @[deprecated]
+alias commutative_of_add_cyclic_center_quotient := commutative_of_addCyclic_center_quotient
/-- A group is commutative if the quotient by the center is cyclic. -/
@[to_additive commutativeOfAddCycleCenterQuotient
zpow_ofNat
and ofNat_zsmul
(#10969)
Previously these were syntactically identical to the corresponding zpow_coe_nat
and coe_nat_zsmul
lemmas, now they are about OfNat.ofNat
.
Unfortunately, almost every call site uses the ofNat
name to refer to Nat.cast
, so the downstream proofs had to be adjusted too.
@@ -215,7 +215,7 @@ theorem Infinite.orderOf_eq_zero_of_forall_mem_zpowers [Infinite α] {g : α}
rw [← zpow_mod_orderOf] at hk
have : 0 ≤ (-k % orderOf g : ℤ) := Int.emod_nonneg (-k) (mod_cast ho.orderOf_pos.ne')
refine' ⟨(-k % orderOf g : ℤ).toNat, _⟩
- rwa [← zpow_ofNat, Int.toNat_of_nonneg this]
+ rwa [← zpow_coe_nat, Int.toNat_of_nonneg this]
#align infinite.order_of_eq_zero_of_forall_mem_zpowers Infinite.orderOf_eq_zero_of_forall_mem_zpowers
#align infinite.add_order_of_eq_zero_of_forall_mem_zmultiples Infinite.addOrderOf_eq_zero_of_forall_mem_zmultiples
@@ -238,7 +238,7 @@ instance Subgroup.isCyclic {α : Type u} [Group α] [IsCyclic α] (H : Subgroup
Nat.pos_of_ne_zero fun h => hx₂ <| by
rw [← hk, Int.natAbs_eq_zero.mp h, zpow_zero], by
cases' k with k k
- · rw [Int.ofNat_eq_coe, Int.natAbs_cast k, ← zpow_ofNat, ← Int.ofNat_eq_coe, hk]
+ · rw [Int.ofNat_eq_coe, Int.natAbs_cast k, ← zpow_coe_nat, ← Int.ofNat_eq_coe, hk]
exact hx₁
· rw [Int.natAbs_negSucc, ← Subgroup.inv_mem_iff H]; simp_all⟩
⟨⟨⟨g ^ Nat.find hex, (Nat.find_spec hex).2⟩, fun ⟨x, hx⟩ =>
@@ -254,7 +254,7 @@ instance Subgroup.isCyclic {α : Type u} [Group α] [IsCyclic α] (H : Subgroup
have hk₄ : k % Nat.find hex = (k % Nat.find hex).natAbs := by
rw [Int.natAbs_of_nonneg
(Int.emod_nonneg _ (Int.coe_nat_ne_zero_iff_pos.2 (Nat.find_spec hex).1))]
- have hk₅ : g ^ (k % Nat.find hex).natAbs ∈ H := by rwa [← zpow_ofNat, ← hk₄]
+ have hk₅ : g ^ (k % Nat.find hex).natAbs ∈ H := by rwa [← zpow_coe_nat, ← hk₄]
have hk₆ : (k % (Nat.find hex : ℤ)).natAbs = 0 :=
by_contradiction fun h =>
Nat.find_min hex
@@ -297,7 +297,7 @@ theorem IsCyclic.card_pow_eq_one_le [DecidableEq α] [Fintype α] [IsCyclic α]
have hgmn : g ^ (m * Nat.gcd n (Fintype.card α)) = 1 := by
rw [pow_mul, hm, ← pow_gcd_card_eq_one_iff]; exact (mem_filter.1 hx).2
dsimp only
- rw [zpow_ofNat, ← pow_mul, Nat.mul_div_cancel_left', hm]
+ rw [zpow_coe_nat, ← pow_mul, Nat.mul_div_cancel_left', hm]
refine' Nat.dvd_of_mul_dvd_mul_right (gcd_pos_of_pos_left (Fintype.card α) hn0) _
conv_lhs =>
rw [Nat.div_mul_cancel (Nat.gcd_dvd_right _ _), ←
@@ -369,7 +369,7 @@ private theorem card_pow_eq_one_eq_orderOf_aux (a : α) :
mem_filter.2
⟨mem_univ _, by
let ⟨i, hi⟩ := b.2
- rw [← hi, ← zpow_ofNat, ← zpow_mul, mul_comm, zpow_mul, zpow_ofNat,
+ rw [← hi, ← zpow_coe_nat, ← zpow_mul, mul_comm, zpow_mul, zpow_coe_nat,
pow_orderOf_eq_one, one_zpow]⟩⟩)
fun _ _ h => Subtype.eq (Subtype.mk.inj h))
_ = (univ.filter fun b : α => b ^ orderOf a = 1).card := Fintype.card_ofFinset _ _
@@ -416,7 +416,7 @@ theorem card_orderOf_eq_totient_aux₂ {d : ℕ} (hd : d ∣ Fintype.card α) :
c = ∑ m in c.divisors, (univ.filter fun a : α => orderOf a = m).card := by
simp only [← filter_dvd_eq_divisors hc0.ne', sum_card_orderOf_eq_card_pow_eq_one hc0.ne']
apply congr_arg card
- simp
+ simp [c]
_ = ∑ m in c.divisors.erase d, (univ.filter fun a : α => orderOf a = m).card := by
rw [eq_comm]
refine' sum_subset (erase_subset _ _) fun m hm₁ hm₂ => _
isCyclic_of_prime_card
isUnit_iff_exists_inv
for non-commutative monoids.@@ -130,35 +130,39 @@ theorem isCyclic_of_orderOf_eq_card [Fintype α] (x : α) (hx : orderOf x = Fint
#align is_cyclic_of_order_of_eq_card isCyclic_of_orderOf_eq_card
#align is_add_cyclic_of_order_of_eq_card isAddCyclic_of_orderOf_eq_card
+/-- Any non-identity element of a finite group of prime order generates the group. -/
+@[to_additive zmultiples_eq_top_of_prime_card "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 = ⊤ := by
+ have := card_subgroup_dvd_card (zpowers g)
+ simp_rw [h, Nat.dvd_prime hp.1, ← eq_bot_iff_card, zpowers_eq_bot, hg, false_or, ← h,
+ card_eq_iff_eq_top] at this
+ exact this
+
+@[to_additive mem_zmultiples_of_prime_card]
+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 := by
+ simp_rw [zpowers_eq_top_of_prime_card h hg, Subgroup.mem_top]
+
+@[to_additive mem_multiples_of_prime_card]
+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 := by
+ rw [mem_powers_iff_mem_zpowers]
+ exact mem_zpowers_of_prime_card h hg
+
+@[to_additive multiples_eq_top_of_prime_card]
+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 = ⊤ := by
+ ext x
+ simp [mem_powers_of_prime_card h hg]
+
/-- 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 α :=
- ⟨by
- obtain ⟨g, hg⟩ : ∃ g : α, g ≠ 1 := Fintype.exists_ne_of_one_lt_card (h.symm ▸ hp.1.one_lt) 1
- classical
- -- for Fintype (Subgroup.zpowers g)
- have : Fintype.card (Subgroup.zpowers g) ∣ p := by
- rw [← h]
- apply card_subgroup_dvd_card
- rw [Nat.dvd_prime hp.1] at this
- cases' this with that that
- · rw [Fintype.card_eq_one_iff] at that
- cases' that with t ht
- suffices g = 1 by contradiction
- have hgt :=
- ht
- ⟨g, by
- change g ∈ Subgroup.zpowers g
- exact Subgroup.mem_zpowers g⟩
- rw [← ht 1] at hgt
- change (⟨_, _⟩ : Subgroup.zpowers g) = ⟨_, _⟩ at hgt
- simpa using hgt
- · use g
- intro x
- rw [← h] at that
- rw [Subgroup.eq_top_of_card_eq _ that]
- exact Subgroup.mem_top _⟩
+ (h : Fintype.card α = p) : IsCyclic α := by
+ obtain ⟨g, hg⟩ : ∃ g, g ≠ 1 := Fintype.exists_ne_of_one_lt_card (h.symm ▸ hp.1.one_lt) 1
+ exact ⟨g, fun g' ↦ mem_zpowers_of_prime_card h hg⟩
#align is_cyclic_of_prime_card isCyclic_of_prime_card
#align is_add_cyclic_of_prime_card isAddCyclic_of_prime_card
@@ -616,7 +616,7 @@ theorem IsCyclic.exponent_eq_card [Group α] [IsCyclic α] [Fintype α] :
exponent α = Fintype.card α := by
obtain ⟨g, hg⟩ := IsCyclic.exists_generator (α := α)
apply Nat.dvd_antisymm
- · rw [← lcm_order_eq_exponent, Finset.lcm_dvd_iff]
+ · rw [← lcm_orderOf_eq_exponent, Finset.lcm_dvd_iff]
exact fun b _ => orderOf_dvd_card
rw [← orderOf_eq_card_of_forall_mem_zpowers hg]
exact order_dvd_exponent _
@@ -681,3 +681,65 @@ lemma not_isCyclic_iff_exponent_eq_prime [Group α] {p : ℕ} (hp : p.Prime)
· exact False.elim <| h_cyc <| isCyclic_of_orderOf_eq_card g <| by aesop
end Exponent
+
+section ZMod
+
+open Subgroup AddSubgroup
+
+variable {G H : Type*}
+
+/-- 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) := by
+ ext
+ simp_rw [AddMonoidHom.mem_ker, mem_zmultiples_iff, zmultiplesHom_apply,
+ ← addOrderOf_dvd_iff_zsmul_eq_zero, zsmul_eq_mul', Int.cast_id, dvd_def, eq_comm]
+
+/-- 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)) :=
+ congr_arg AddSubgroup.toSubgroup <| zmultiplesHom_ker_eq (Additive.ofMul g)
+
+/-- 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 := by
+ let n := Nat.card G
+ let ⟨g, surj⟩ := Classical.indefiniteDescription _ h.exists_generator
+ have kereq : ((zmultiplesHom G) g).ker = zmultiples ↑(Nat.card G) := by
+ rw [zmultiplesHom_ker_eq]
+ congr
+ rw [← Nat.card_zmultiples]
+ exact Nat.card_congr (Equiv.subtypeUnivEquiv surj)
+ exact (Int.quotientZMultiplesNatEquivZMod n)
+ |>.symm.trans <| QuotientAddGroup.quotientAddEquivOfEq kereq
+ |>.symm.trans <| QuotientAddGroup.quotientKerEquivOfSurjective (zmultiplesHom G g) surj
+
+/-- 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 :=
+ AddEquiv.toMultiplicative <| zmodAddCyclicAddEquiv <| isAddCyclic_additive_iff.2 h
+
+/-- 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 := hcard ▸
+ zmodAddCyclicAddEquiv hG |>.symm.trans (zmodAddCyclicAddEquiv hH)
+
+/-- 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 := hcard ▸
+ zmodCyclicMulEquiv hG |>.symm.trans (zmodCyclicMulEquiv hH)
+
+/-- 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 := by
+ have hGcyc := isCyclic_of_prime_card hG
+ have hHcyc := isCyclic_of_prime_card hH
+ apply mulEquivOfCyclicCardEq
+ rw [← Nat.card_eq_fintype_card] at hG hH
+ exact hG.trans hH.symm
+
+end ZMod
The FunLike hierarchy is very big and gets scanned through each time we need a coercion (via the CoeFun
instance). It looks like unbundled inheritance suits Lean 4 better here. The only class that still extends FunLike
is EquivLike
, since that has a custom coe_injective'
field that is easier to implement. All other classes should take FunLike
or EquivLike
as a parameter.
Previously, morphism classes would be Type
-valued and extend FunLike
:
/-- `MyHomClass F A B` states that `F` is a type of `MyClass.op`-preserving morphisms.
You should extend this class when you extend `MyHom`. -/
class MyHomClass (F : Type*) (A B : outParam <| Type*) [MyClass A] [MyClass B]
extends FunLike F A B :=
(map_op : ∀ (f : F) (x y : A), f (MyClass.op x y) = MyClass.op (f x) (f y))
After this PR, they should be Prop
-valued and take FunLike
as a parameter:
/-- `MyHomClass F A B` states that `F` is a type of `MyClass.op`-preserving morphisms.
You should extend this class when you extend `MyHom`. -/
class MyHomClass (F : Type*) (A B : outParam <| Type*) [MyClass A] [MyClass B]
[FunLike F A B] : Prop :=
(map_op : ∀ (f : F) (x y : A), f (MyClass.op x y) = MyClass.op (f x) (f y))
(Note that A B
stay marked as outParam
even though they are not purely required to be so due to the FunLike
parameter already filling them in. This is required to see through type synonyms, which is important in the category theory library. Also, I think keeping them as outParam
is slightly faster.)
Similarly, MyEquivClass
should take EquivLike
as a parameter.
As a result, every mention of [MyHomClass F A B]
should become [FunLike F A B] [MyHomClass F A B]
.
While overall this gives some great speedups, there are some cases that are noticeably slower. In particular, a failing application of a lemma such as map_mul
is more expensive. This is due to suboptimal processing of arguments. For example:
variable [FunLike F M N] [Mul M] [Mul N] (f : F) (x : M) (y : M)
theorem map_mul [MulHomClass F M N] : f (x * y) = f x * f y
example [AddHomClass F A B] : f (x * y) = f x * f y := map_mul f _ _
Before this PR, applying map_mul f
gives the goals [Mul ?M] [Mul ?N] [MulHomClass F ?M ?N]
. Since M
and N
are out_param
s, [MulHomClass F ?M ?N]
is synthesized first, supplies values for ?M
and ?N
and then the Mul M
and Mul N
instances can be found.
After this PR, the goals become [FunLike F ?M ?N] [Mul ?M] [Mul ?N] [MulHomClass F ?M ?N]
. Now [FunLike F ?M ?N]
is synthesized first, supplies values for ?M
and ?N
and then the Mul M
and Mul N
instances can be found, before trying MulHomClass F M N
which fails. Since the Mul
hierarchy is very big, this can be slow to fail, especially when there is no such Mul
instance.
A long-term but harder to achieve solution would be to specify the order in which instance goals get solved. For example, we'd like to change the arguments to map_mul
to look like [FunLike F M N] [Mul M] [Mul N] [highPriority <| MulHomClass F M N]
because MulHomClass
fails or succeeds much faster than the others.
As a consequence, the simpNF
linter is much slower since by design it tries and fails to apply many map_
lemmas. The same issue occurs a few times in existing calls to simp [map_mul]
, where map_mul
is tried "too soon" and fails. Thanks to the speedup of leanprover/lean4#2478 the impact is very limited, only in files that already were close to the timeout.
simp
not firing sometimesThis affects map_smulₛₗ
and related definitions. For simp
lemmas Lean apparently uses a slightly different mechanism to find instances, so that rw
can find every argument to map_smulₛₗ
successfully but simp
can't: leanprover/lean4#3701.
Especially in the category theory library, we might sometimes have a type A
which is also accessible as a synonym (Bundled A hA).1
. Instance synthesis doesn't always work if we have f : A →* B
but x * y : (Bundled A hA).1
or vice versa. This seems to be mostly fixed by keeping A B
as outParam
s in MulHomClass F A B
. (Presumably because Lean will do a definitional check A =?= (Bundled A hA).1
instead of using the syntax in the discrimination tree.)
The timeouts can be worked around for now by specifying which map_mul
we mean, either as map_mul f
for some explicit f
, or as e.g. MonoidHomClass.map_mul
.
map_smulₛₗ
not firing as simp
lemma can be worked around by going back to the pre-FunLike situation and making LinearMap.map_smulₛₗ
a simp
lemma instead of the generic map_smulₛₗ
. Writing simp [map_smulₛₗ _]
also works.
Co-authored-by: Matthew Ballard <matt@mrb.email> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Scott Morrison <scott@tqft.net> Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com>
@@ -164,7 +164,8 @@ theorem isCyclic_of_prime_card {α : Type u} [Group α] [Fintype α] {p : ℕ} [
@[to_additive]
theorem isCyclic_of_surjective {H G F : Type*} [Group H] [Group G] [hH : IsCyclic H]
- [MonoidHomClass F H G] (f : F) (hf : Function.Surjective f) : IsCyclic G := by
+ [FunLike F H G] [MonoidHomClass F H G] (f : F) (hf : Function.Surjective f) :
+ IsCyclic G := by
obtain ⟨x, hx⟩ := hH
refine ⟨f x, fun a ↦ ?_⟩
obtain ⟨a, rfl⟩ := hf a
Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Joachim Breitner <mail@joachim-breitner.de>
@@ -670,8 +670,8 @@ lemma not_isCyclic_iff_exponent_eq_prime [Group α] {p : ℕ} (hp : p.Prime)
orders of `g` are `1`, `p`, or `p ^ 2`. It can't be the former because `g ≠ 1`, and it can't
the latter because the group isn't cyclic. -/
have := (Nat.mem_divisors (m := p ^ 2)).mpr ⟨hα' ▸ orderOf_dvd_card (x := g), by aesop⟩
- simp? [Nat.divisors_prime_pow hp 2] at this says
- simp only [Nat.divisors_prime_pow hp 2, Finset.mem_map, Finset.mem_range,
+ simp? [Nat.divisors_prime_pow hp 2] at this says
+ simp only [Nat.divisors_prime_pow hp 2, Nat.reduceAdd, Finset.mem_map, Finset.mem_range,
Function.Embedding.coeFn_mk] at this
obtain ⟨a, ha, ha'⟩ := this
interval_cases a
Finset
lemma names (#8894)
Change a few lemma names that have historically bothered me.
Finset.card_le_of_subset
→ Finset.card_le_card
Multiset.card_le_of_le
→ Multiset.card_le_card
Multiset.card_lt_of_lt
→ Multiset.card_lt_card
Set.ncard_le_of_subset
→ Set.ncard_le_ncard
Finset.image_filter
→ Finset.filter_image
CompleteLattice.finset_sup_compact_of_compact
→ CompleteLattice.isCompactElement_finset_sup
@@ -284,7 +284,7 @@ theorem IsCyclic.card_pow_eq_one_le [DecidableEq α] [Fintype α] [IsCyclic α]
calc
(univ.filter fun a : α => a ^ n = 1).card ≤
(zpowers (g ^ (Fintype.card α / Nat.gcd n (Fintype.card α))) : Set α).toFinset.card :=
- card_le_of_subset fun x hx =>
+ card_le_card fun x hx =>
let ⟨m, hm⟩ := show x ∈ Submonoid.powers g from mem_powers_iff_mem_zpowers.2 <| hg x
Set.mem_toFinset.2
⟨(m / (Fintype.card α / Nat.gcd n (Fintype.card α)) : ℕ), by
Monoid.exponent
(#8723)
This PR shows a few facts related to Monoid.exponent
, especially when it is prime:
p
if and only if every non-identity element has order p
.p ^ 2
with p
prime is not cyclic if and only if it has exponent p
.@@ -651,4 +651,32 @@ protected theorem ZMod.exponent (n : ℕ) : AddMonoid.exponent (ZMod n) = n := b
· rw [IsAddCyclic.exponent_eq_zero_of_infinite]
· rw [IsAddCyclic.exponent_eq_card, card]
+/-- 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 := by
+ -- G is a nontrivial fintype of cardinality `p ^ 2`
+ let _inst : Fintype α := @Fintype.ofFinite α <| Nat.finite_of_card_ne_zero <| by aesop
+ have hα' : Fintype.card α = p ^ 2 := by simpa using hα
+ have := (Fintype.one_lt_card_iff_nontrivial (α := α)).mp <|
+ hα' ▸ one_lt_pow hp.one_lt two_ne_zero
+ /- in the forward direction, we apply `exponent_eq_prime_iff`, and the reverse direction follows
+ immediately because if `α` has exponent `p`, it has no element of order `p ^ 2`. -/
+ refine ⟨fun h_cyc ↦ (Monoid.exponent_eq_prime_iff hp).mpr fun g hg ↦ ?_, fun h_exp h_cyc ↦ by
+ obtain (rfl|rfl) := eq_zero_or_one_of_sq_eq_self <| hα' ▸ h_exp ▸ (h_cyc.exponent_eq_card).symm
+ · exact Nat.not_prime_zero hp
+ · exact Nat.not_prime_one hp⟩
+ /- we must show every non-identity element has order `p`. By Lagrange's theorem, the only possible
+ orders of `g` are `1`, `p`, or `p ^ 2`. It can't be the former because `g ≠ 1`, and it can't
+ the latter because the group isn't cyclic. -/
+ have := (Nat.mem_divisors (m := p ^ 2)).mpr ⟨hα' ▸ orderOf_dvd_card (x := g), by aesop⟩
+ simp? [Nat.divisors_prime_pow hp 2] at this says
+ simp only [Nat.divisors_prime_pow hp 2, Finset.mem_map, Finset.mem_range,
+ Function.Embedding.coeFn_mk] at this
+ obtain ⟨a, ha, ha'⟩ := this
+ interval_cases a
+ · exact False.elim <| hg <| orderOf_eq_one_iff.mp <| by aesop
+ · aesop
+ · exact False.elim <| h_cyc <| isCyclic_of_orderOf_eq_card g <| by aesop
+
end Exponent
@@ -125,7 +125,7 @@ theorem isCyclic_of_orderOf_eq_card [Fintype α] (x : α) (hx : orderOf x = Fint
classical
use x
simp_rw [← SetLike.mem_coe, ← Set.eq_univ_iff_forall]
- rw [← Fintype.card_congr (Equiv.Set.univ α), ←Fintype.card_zpowers] at hx
+ rw [← Fintype.card_congr (Equiv.Set.univ α), ← Fintype.card_zpowers] at hx
exact Set.eq_of_subset_of_card_le (Set.subset_univ _) (ge_of_eq hx)
#align is_cyclic_of_order_of_eq_card isCyclic_of_orderOf_eq_card
#align is_add_cyclic_of_order_of_eq_card isAddCyclic_of_orderOf_eq_card
@@ -175,7 +175,7 @@ theorem isCyclic_of_surjective {H G F : Type*} [Group H] [Group G] [hH : IsCycli
theorem orderOf_eq_card_of_forall_mem_zpowers [Fintype α] {g : α} (hx : ∀ x, x ∈ zpowers g) :
orderOf g = Fintype.card α := by
classical
- rw [←Fintype.card_zpowers]
+ rw [← Fintype.card_zpowers]
apply Fintype.card_of_finset'
simpa using hx
#align order_of_eq_card_of_forall_mem_zpowers orderOf_eq_card_of_forall_mem_zpowers
@@ -188,7 +188,7 @@ theorem exists_pow_ne_one_of_isCyclic {G : Type*} [Group G] [Fintype G] [G_cycli
use a
contrapose! k_lt_card_G
convert orderOf_le_of_pow_eq_one k_pos.bot_lt k_lt_card_G
- rw [←Fintype.card_zpowers, eq_comm, Subgroup.card_eq_iff_eq_top, eq_top_iff]
+ rw [← Fintype.card_zpowers, eq_comm, Subgroup.card_eq_iff_eq_top, eq_top_iff]
exact fun x _ ↦ ha x
@[to_additive Infinite.addOrderOf_eq_zero_of_forall_mem_zmultiples]
@@ -202,12 +202,12 @@ theorem Infinite.orderOf_eq_zero_of_forall_mem_zpowers [Infinite α] {g : α}
Infinite.exists_not_mem_finset
(Finset.image (fun x => g ^ x) <| Finset.range <| orderOf g)
apply hx
- rw [←ho.mem_powers_iff_mem_range_orderOf, Submonoid.mem_powers_iff]
+ rw [← ho.mem_powers_iff_mem_range_orderOf, Submonoid.mem_powers_iff]
obtain ⟨k, hk⟩ := h x
dsimp at hk
obtain ⟨k, rfl | rfl⟩ := k.eq_nat_or_neg
· exact ⟨k, mod_cast hk⟩
- rw [←zpow_mod_orderOf] at hk
+ rw [← zpow_mod_orderOf] at hk
have : 0 ≤ (-k % orderOf g : ℤ) := Int.emod_nonneg (-k) (mod_cast ho.orderOf_pos.ne')
refine' ⟨(-k % orderOf g : ℤ).toNat, _⟩
rwa [← zpow_ofNat, Int.toNat_of_nonneg this]
@@ -233,7 +233,7 @@ instance Subgroup.isCyclic {α : Type u} [Group α] [IsCyclic α] (H : Subgroup
Nat.pos_of_ne_zero fun h => hx₂ <| by
rw [← hk, Int.natAbs_eq_zero.mp h, zpow_zero], by
cases' k with k k
- · rw [Int.ofNat_eq_coe, Int.natAbs_cast k, ← zpow_ofNat, ←Int.ofNat_eq_coe, hk]
+ · rw [Int.ofNat_eq_coe, Int.natAbs_cast k, ← zpow_ofNat, ← Int.ofNat_eq_coe, hk]
exact hx₁
· rw [Int.natAbs_negSucc, ← Subgroup.inv_mem_iff H]; simp_all⟩
⟨⟨⟨g ^ Nat.find hex, (Nat.find_spec hex).2⟩, fun ⟨x, hx⟩ =>
Cyclic --> addCyclic
(#8722)
Teach the conversion Cyclic ↦ addCyclic
to to_additive
.
Affected files:
GroupTheory/SpecificGroups/Cyclic
Tactic/ToAdditive
@@ -58,12 +58,12 @@ class IsAddCyclic (α : Type u) [AddGroup α] : Prop where
#align is_add_cyclic IsAddCyclic
/-- A group is called *cyclic* if it is generated by a single element. -/
-@[to_additive IsAddCyclic]
+@[to_additive]
class IsCyclic (α : Type u) [Group α] : Prop where
exists_generator : ∃ g : α, ∀ x, x ∈ zpowers g
#align is_cyclic IsCyclic
-@[to_additive isAddCyclic_of_subsingleton]
+@[to_additive]
instance (priority := 100) isCyclic_of_subsingleton [Group α] [Subsingleton α] : IsCyclic α :=
⟨⟨1, fun x => by
rw [Subsingleton.elim x 1]
@@ -102,10 +102,8 @@ def IsCyclic.commGroup [hg : Group α] [IsCyclic α] : CommGroup α :=
variable [Group α]
-/-- A non-cyclic multiplicative group is non-trivial.
-The additive version is `Nontrivial.of_not_isAddCyclic`. -/
-@[to_additive Nontrivial.of_not_isAddCyclic "A non-cyclic additive group is non-trivial.
-The multiplicative version is `Nontrivial.of_not_isCyclic`."]
+/-- 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 α := by
contrapose! nc
exact @isCyclic_of_subsingleton _ _ (not_nontrivial_iff_subsingleton.mp nc)
@@ -133,7 +131,7 @@ theorem isCyclic_of_orderOf_eq_card [Fintype α] (x : α) (hx : orderOf x = Fint
#align is_add_cyclic_of_order_of_eq_card isAddCyclic_of_orderOf_eq_card
/-- A finite group of prime order is cyclic. -/
-@[to_additive isAddCyclic_of_prime_card "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 α :=
⟨by
@@ -164,7 +162,7 @@ theorem isCyclic_of_prime_card {α : Type u} [Group α] [Fintype α] {p : ℕ} [
#align is_cyclic_of_prime_card isCyclic_of_prime_card
#align is_add_cyclic_of_prime_card isAddCyclic_of_prime_card
-@[to_additive isAddCyclic_of_surjective]
+@[to_additive]
theorem isCyclic_of_surjective {H G F : Type*} [Group H] [Group G] [hH : IsCyclic H]
[MonoidHomClass F H G] (f : F) (hf : Function.Surjective f) : IsCyclic G := by
obtain ⟨x, hx⟩ := hH
@@ -183,7 +181,7 @@ theorem orderOf_eq_card_of_forall_mem_zpowers [Fintype α] {g : α} (hx : ∀ x,
#align order_of_eq_card_of_forall_mem_zpowers orderOf_eq_card_of_forall_mem_zpowers
#align add_order_of_eq_card_of_forall_mem_zmultiples addOrderOf_eq_card_of_forall_mem_zmultiples
-@[to_additive exists_nsmul_ne_zero_of_isAddCyclic]
+@[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 := by
rcases G_cyclic with ⟨a, ha⟩
@@ -216,13 +214,13 @@ theorem Infinite.orderOf_eq_zero_of_forall_mem_zpowers [Infinite α] {g : α}
#align infinite.order_of_eq_zero_of_forall_mem_zpowers Infinite.orderOf_eq_zero_of_forall_mem_zpowers
#align infinite.add_order_of_eq_zero_of_forall_mem_zmultiples Infinite.addOrderOf_eq_zero_of_forall_mem_zmultiples
-@[to_additive Bot.isAddCyclic]
+@[to_additive]
instance Bot.isCyclic {α : Type u} [Group α] : IsCyclic (⊥ : Subgroup α) :=
⟨⟨1, fun x => ⟨0, Subtype.eq <| (zpow_zero (1 : α)).trans <| Eq.symm (Subgroup.mem_bot.1 x.2)⟩⟩⟩
#align bot.is_cyclic Bot.isCyclic
#align bot.is_add_cyclic Bot.isAddCyclic
-@[to_additive AddSubgroup.isAddCyclic]
+@[to_additive]
instance Subgroup.isCyclic {α : Type u} [Group α] [IsCyclic α] (H : Subgroup α) : IsCyclic H :=
haveI := Classical.propDecidable
let ⟨g, hg⟩ := IsCyclic.exists_generator (α := α)
@@ -538,7 +536,7 @@ section CommGroup
variable [CommGroup α] [IsSimpleGroup α]
-@[to_additive IsSimpleAddGroup.isAddCyclic]
+@[to_additive]
instance (priority := 100) isCyclic : IsCyclic α := by
cases' subsingleton_or_nontrivial α with hi hi <;> haveI := hi
· apply isCyclic_of_subsingleton
@@ -583,7 +581,7 @@ end CommGroup
end IsSimpleGroup
-@[to_additive AddCommGroup.is_simple_iff_isAddCyclic_and_prime_card]
+@[to_additive]
theorem CommGroup.is_simple_iff_isCyclic_and_prime_card [Fintype α] [CommGroup α] :
IsSimpleGroup α ↔ IsCyclic α ∧ (Fintype.card α).Prime := by
constructor
A non-cyclic group is also non-trivial, whether it is multiplicative or additive.
@@ -102,6 +102,14 @@ def IsCyclic.commGroup [hg : Group α] [IsCyclic α] : CommGroup α :=
variable [Group α]
+/-- A non-cyclic multiplicative group is non-trivial.
+The additive version is `Nontrivial.of_not_isAddCyclic`. -/
+@[to_additive Nontrivial.of_not_isAddCyclic "A non-cyclic additive group is non-trivial.
+The multiplicative version is `Nontrivial.of_not_isCyclic`."]
+theorem Nontrivial.of_not_isCyclic (nc : ¬IsCyclic α) : Nontrivial α := by
+ contrapose! nc
+ exact @isCyclic_of_subsingleton _ _ (not_nontrivial_iff_subsingleton.mp nc)
+
@[to_additive MonoidAddHom.map_add_cyclic]
theorem MonoidHom.map_cyclic {G : Type*} [Group G] [h : IsCyclic G] (σ : G →* G) :
∃ m : ℤ, ∀ g : G, σ g = g ^ m := by
@@ -71,6 +71,20 @@ instance (priority := 100) isCyclic_of_subsingleton [Group α] [Subsingleton α]
#align is_cyclic_of_subsingleton isCyclic_of_subsingleton
#align is_add_cyclic_of_subsingleton isAddCyclic_of_subsingleton
+@[simp]
+theorem isCyclic_multiplicative_iff [AddGroup α] : IsCyclic (Multiplicative α) ↔ IsAddCyclic α :=
+ ⟨fun H ↦ ⟨H.1⟩, fun H ↦ ⟨H.1⟩⟩
+
+instance isCyclic_multiplicative [AddGroup α] [IsAddCyclic α] : IsCyclic (Multiplicative α) :=
+ isCyclic_multiplicative_iff.mpr inferInstance
+
+@[simp]
+theorem isAddCyclic_additive_iff [Group α] : IsAddCyclic (Additive α) ↔ IsCyclic α :=
+ ⟨fun H ↦ ⟨H.1⟩, fun H ↦ ⟨H.1⟩⟩
+
+instance isAddCyclic_additive [Group α] [IsCyclic α] : IsAddCyclic (Additive α) :=
+ isAddCyclic_additive_iff.mpr inferInstance
+
/-- A cyclic group is always commutative. This is not an `instance` because often we have a better
proof of `CommGroup`. -/
@[to_additive
@@ -142,6 +156,15 @@ theorem isCyclic_of_prime_card {α : Type u} [Group α] [Fintype α] {p : ℕ} [
#align is_cyclic_of_prime_card isCyclic_of_prime_card
#align is_add_cyclic_of_prime_card isAddCyclic_of_prime_card
+@[to_additive isAddCyclic_of_surjective]
+theorem isCyclic_of_surjective {H G F : Type*} [Group H] [Group G] [hH : IsCyclic H]
+ [MonoidHomClass F H G] (f : F) (hf : Function.Surjective f) : IsCyclic G := by
+ obtain ⟨x, hx⟩ := hH
+ refine ⟨f x, fun a ↦ ?_⟩
+ obtain ⟨a, rfl⟩ := hf a
+ obtain ⟨n, rfl⟩ := hx a
+ exact ⟨n, (map_zpow _ _ _).symm⟩
+
@[to_additive addOrderOf_eq_card_of_forall_mem_zmultiples]
theorem orderOf_eq_card_of_forall_mem_zpowers [Fintype α] {g : α} (hx : ∀ x, x ∈ zpowers g) :
orderOf g = Fintype.card α := by
@@ -564,6 +587,19 @@ theorem CommGroup.is_simple_iff_isCyclic_and_prime_card [Fintype α] [CommGroup
#align comm_group.is_simple_iff_is_cyclic_and_prime_card CommGroup.is_simple_iff_isCyclic_and_prime_card
#align add_comm_group.is_simple_iff_is_add_cyclic_and_prime_card AddCommGroup.is_simple_iff_isAddCyclic_and_prime_card
+section SpecificInstances
+
+instance : IsAddCyclic ℤ := ⟨1, fun n ↦ ⟨n, by simp only [smul_eq_mul, mul_one]⟩⟩
+
+instance ZMod.instIsAddCyclic (n : ℕ) : IsAddCyclic (ZMod n) :=
+ isAddCyclic_of_surjective (Int.castRingHom _) ZMod.int_cast_surjective
+
+instance ZMod.instIsSimpleAddGroup {p : ℕ} [Fact p.Prime] : IsSimpleAddGroup (ZMod p) :=
+ AddCommGroup.is_simple_iff_isAddCyclic_and_prime_card.2
+ ⟨inferInstance, by simpa using (Fact.out : p.Prime)⟩
+
+end SpecificInstances
+
section Exponent
open Monoid
@@ -603,13 +639,6 @@ theorem IsCyclic.exponent_eq_zero_of_infinite [Group α] [IsCyclic α] [Infinite
#align is_cyclic.exponent_eq_zero_of_infinite IsCyclic.exponent_eq_zero_of_infinite
#align is_add_cyclic.exponent_eq_zero_of_infinite IsAddCyclic.exponent_eq_zero_of_infinite
-instance ZMod.instIsAddCyclic (n : ℕ) : IsAddCyclic (ZMod n) where
- exists_generator := ⟨1, fun n ↦ ⟨n, by simp⟩⟩
-
-instance ZMod.instIsSimpleAddGroup {p : ℕ} [Fact p.Prime] : IsSimpleAddGroup (ZMod p) :=
- AddCommGroup.is_simple_iff_isAddCyclic_and_prime_card.2
- ⟨by infer_instance, by simpa using (Fact.out : p.Prime)⟩
-
@[simp]
protected theorem ZMod.exponent (n : ℕ) : AddMonoid.exponent (ZMod n) = n := by
cases n
exact_mod_cast
tactic with mod_cast
elaborator where possible (#8404)
We still have the exact_mod_cast
tactic, used in a few places, which somehow (?) works a little bit harder to prevent the expected type influencing the elaboration of the term. I would like to get to the bottom of this, and it will be easier once the only usages of exact_mod_cast
are the ones that don't work using the term elaborator by itself.
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
@@ -177,9 +177,9 @@ theorem Infinite.orderOf_eq_zero_of_forall_mem_zpowers [Infinite α] {g : α}
obtain ⟨k, hk⟩ := h x
dsimp at hk
obtain ⟨k, rfl | rfl⟩ := k.eq_nat_or_neg
- · exact ⟨k, by exact_mod_cast hk⟩
+ · exact ⟨k, mod_cast hk⟩
rw [←zpow_mod_orderOf] at hk
- have : 0 ≤ (-k % orderOf g : ℤ) := Int.emod_nonneg (-k) (by exact_mod_cast ho.orderOf_pos.ne')
+ have : 0 ≤ (-k % orderOf g : ℤ) := Int.emod_nonneg (-k) (mod_cast ho.orderOf_pos.ne')
refine' ⟨(-k % orderOf g : ℤ).toNat, _⟩
rwa [← zpow_ofNat, Int.toNat_of_nonneg this]
#align infinite.order_of_eq_zero_of_forall_mem_zpowers Infinite.orderOf_eq_zero_of_forall_mem_zpowers
@@ -213,7 +213,7 @@ instance Subgroup.isCyclic {α : Type u} [Group α] [IsCyclic α] (H : Subgroup
have hk₂ : g ^ ((Nat.find hex : ℤ) * (k / Nat.find hex : ℤ)) ∈ H := by
rw [zpow_mul]
apply H.zpow_mem
- exact_mod_cast (Nat.find_spec hex).2
+ exact mod_cast (Nat.find_spec hex).2
have hk₃ : g ^ (k % Nat.find hex : ℤ) ∈ H :=
(Subgroup.mul_mem_cancel_right H hk₂).1 <| by
rw [← zpow_add, Int.emod_add_ediv, hk]; exact hx
The cardinality of a subgroup is greater than the order of any of its elements.
Rename
order_eq_card_zpowers
→ Fintype.card_zpowers
order_eq_card_zpowers'
→ Nat.card_zpowers
(and turn it around to match Nat.card_subgroupPowers
)Submonoid.powers_subset
→ Submonoid.powers_le
orderOf_dvd_card_univ
→ orderOf_dvd_card
orderOf_subgroup
→ Subgroup.orderOf
Subgroup.nonempty
→ Subgroup.coe_nonempty
@@ -105,7 +105,7 @@ theorem isCyclic_of_orderOf_eq_card [Fintype α] (x : α) (hx : orderOf x = Fint
classical
use x
simp_rw [← SetLike.mem_coe, ← Set.eq_univ_iff_forall]
- rw [← Fintype.card_congr (Equiv.Set.univ α), orderOf_eq_card_zpowers] at hx
+ rw [← Fintype.card_congr (Equiv.Set.univ α), ←Fintype.card_zpowers] at hx
exact Set.eq_of_subset_of_card_le (Set.subset_univ _) (ge_of_eq hx)
#align is_cyclic_of_order_of_eq_card isCyclic_of_orderOf_eq_card
#align is_add_cyclic_of_order_of_eq_card isAddCyclic_of_orderOf_eq_card
@@ -146,7 +146,7 @@ theorem isCyclic_of_prime_card {α : Type u} [Group α] [Fintype α] {p : ℕ} [
theorem orderOf_eq_card_of_forall_mem_zpowers [Fintype α] {g : α} (hx : ∀ x, x ∈ zpowers g) :
orderOf g = Fintype.card α := by
classical
- rw [orderOf_eq_card_zpowers]
+ rw [←Fintype.card_zpowers]
apply Fintype.card_of_finset'
simpa using hx
#align order_of_eq_card_of_forall_mem_zpowers orderOf_eq_card_of_forall_mem_zpowers
@@ -159,7 +159,7 @@ theorem exists_pow_ne_one_of_isCyclic {G : Type*} [Group G] [Fintype G] [G_cycli
use a
contrapose! k_lt_card_G
convert orderOf_le_of_pow_eq_one k_pos.bot_lt k_lt_card_G
- rw [orderOf_eq_card_zpowers, eq_comm, Subgroup.card_eq_iff_eq_top, eq_top_iff]
+ rw [←Fintype.card_zpowers, eq_comm, Subgroup.card_eq_iff_eq_top, eq_top_iff]
exact fun x _ ↦ ha x
@[to_additive Infinite.addOrderOf_eq_zero_of_forall_mem_zmultiples]
@@ -276,7 +276,7 @@ theorem IsCyclic.card_pow_eq_one_le [DecidableEq α] [Fintype α] [IsCyclic α]
rw [hm0, mul_zero, Fintype.card_eq_zero_iff] at hm
exact hm.elim' 1
simp only [Set.toFinset_card, SetLike.coe_sort_coe]
- rw [← orderOf_eq_card_zpowers, orderOf_pow g, orderOf_eq_card_of_forall_mem_zpowers hg]
+ rw [Fintype.card_zpowers, orderOf_pow g, orderOf_eq_card_of_forall_mem_zpowers hg]
nth_rw 2 [hm]; nth_rw 3 [hm]
rw [Nat.mul_div_cancel_left _ (gcd_pos_of_pos_left _ hn0), gcd_mul_left_left, hm,
Nat.mul_div_cancel _ hm0]
@@ -324,7 +324,7 @@ private theorem card_pow_eq_one_eq_orderOf_aux (a : α) :
(Finset.univ.filter fun b : α => b ^ orderOf a = 1).card = orderOf a :=
le_antisymm (hn _ (orderOf_pos a))
(calc
- orderOf a = @Fintype.card (zpowers a) (id _) := orderOf_eq_card_zpowers
+ orderOf a = @Fintype.card (zpowers a) (id _) := Fintype.card_zpowers.symm
_ ≤
@Fintype.card (↑(univ.filter fun b : α => b ^ orderOf a = 1) : Set α)
(Fintype.ofFinset _ fun _ => Iff.rfl) :=
@@ -574,7 +574,7 @@ theorem IsCyclic.exponent_eq_card [Group α] [IsCyclic α] [Fintype α] :
obtain ⟨g, hg⟩ := IsCyclic.exists_generator (α := α)
apply Nat.dvd_antisymm
· rw [← lcm_order_eq_exponent, Finset.lcm_dvd_iff]
- exact fun b _ => orderOf_dvd_card_univ
+ exact fun b _ => orderOf_dvd_card
rw [← orderOf_eq_card_of_forall_mem_zpowers hg]
exact order_dvd_exponent _
#align is_cyclic.exponent_eq_card IsCyclic.exponent_eq_card
Many lemmas in GroupTheory.OrderOfElement
were stated for elements of finite groups even though they work more generally for torsion elements of possibly infinite groups. This PR generalises those lemmas (and leaves convenience lemmas stated for finite groups), and fixes a bunch of names to use dot notation.
Function.eq_of_lt_minimalPeriod_of_iterate_eq
→ Function.iterate_injOn_Iio_minimalPeriod
Function.eq_iff_lt_minimalPeriod_of_iterate_eq
→ Function.iterate_eq_iterate_iff_of_lt_minimalPeriod
isOfFinOrder_iff_coe
→ Submonoid.isOfFinOrder_coe
orderOf_pos'
→ IsOfFinOrder.orderOf_pos
pow_eq_mod_orderOf
→ pow_mod_orderOf
(and turned around)pow_injective_of_lt_orderOf
→ pow_injOn_Iio_orderOf
mem_powers_iff_mem_range_order_of'
→ IsOfFinOrder.mem_powers_iff_mem_range_orderOf
orderOf_pow''
→ IsOfFinOrder.orderOf_pow
orderOf_pow_coprime
→ Nat.Coprime.orderOf_pow
zpow_eq_mod_orderOf
→ zpow_mod_orderOf
(and turned around)exists_pow_eq_one
→ isOfFinOrder_of_finite
pow_apply_eq_pow_mod_orderOf_cycleOf_apply
→ pow_mod_orderOf_cycleOf_apply
IsOfFinOrder.powers_eq_image_range_orderOf
IsOfFinOrder.natCard_powers_le_orderOf
IsOfFinOrder.finite_powers
finite_powers
infinite_powers
Nat.card_submonoidPowers
IsOfFinOrder.mem_powers_iff_mem_zpowers
IsOfFinOrder.powers_eq_zpowers
IsOfFinOrder.mem_zpowers_iff_mem_range_orderOf
IsOfFinOrder.exists_pow_eq_one
decidableMemPowers
/fintypePowers
to GroupTheory.Submonoid.Membership
and decidableMemZpowers
/fintypeZpowers
to GroupTheory.Subgroup.ZPowers
.finEquivPowers
, finEquivZpowers
, powersEquivPowers
and zpowersEquivZpowers
now assume IsOfFinTorsion x
instead of Finite G
.isOfFinOrder_iff_pow_eq_one
now takes one less explicit argument.Equiv.Perm.IsCycle.exists_pow_eq_one
since it was saying that a permutation over a finite type is torsion, but this is trivial since the group of permutation is itself finite, so we can use isOfFinOrder_of_finite
instead.@@ -168,18 +168,18 @@ theorem Infinite.orderOf_eq_zero_of_forall_mem_zpowers [Infinite α] {g : α}
classical
rw [orderOf_eq_zero_iff']
refine' fun n hn hgn => _
- have ho := orderOf_pos' ((isOfFinOrder_iff_pow_eq_one g).mpr ⟨n, hn, hgn⟩)
+ have ho := isOfFinOrder_iff_pow_eq_one.mpr ⟨n, hn, hgn⟩
obtain ⟨x, hx⟩ :=
Infinite.exists_not_mem_finset
(Finset.image (fun x => g ^ x) <| Finset.range <| orderOf g)
apply hx
- rw [← mem_powers_iff_mem_range_order_of' (x := g) (y := x) ho, Submonoid.mem_powers_iff]
+ rw [←ho.mem_powers_iff_mem_range_orderOf, Submonoid.mem_powers_iff]
obtain ⟨k, hk⟩ := h x
dsimp at hk
obtain ⟨k, rfl | rfl⟩ := k.eq_nat_or_neg
· exact ⟨k, by exact_mod_cast hk⟩
- rw [zpow_eq_mod_orderOf] at hk
- have : 0 ≤ (-k % orderOf g : ℤ) := Int.emod_nonneg (-k) (by exact_mod_cast ho.ne')
+ rw [←zpow_mod_orderOf] at hk
+ have : 0 ≤ (-k % orderOf g : ℤ) := Int.emod_nonneg (-k) (by exact_mod_cast ho.orderOf_pos.ne')
refine' ⟨(-k % orderOf g : ℤ).toNat, _⟩
rwa [← zpow_ofNat, Int.toNat_of_nonneg this]
#align infinite.order_of_eq_zero_of_forall_mem_zpowers Infinite.orderOf_eq_zero_of_forall_mem_zpowers
Nat.card
is zero (#8202)
and lemmas about injectivity/surjectivity of PLift.map
/ULift.map
.
@@ -375,7 +375,8 @@ theorem card_orderOf_eq_totient_aux₂ {d : ℕ} (hd : d ∣ Fintype.card α) :
have hc0 : 0 < c := Fintype.card_pos_iff.2 ⟨1⟩
apply card_orderOf_eq_totient_aux₁ hn hd
by_contra h0
- simp only [not_lt, _root_.le_zero_iff, card_eq_zero] at h0
+ -- Must qualify `Finset.card_eq_zero` because of leanprover/lean4#2849
+ simp only [not_lt, _root_.le_zero_iff, Finset.card_eq_zero] at h0
apply lt_irrefl c
calc
c = ∑ m in c.divisors, (univ.filter fun a : α => orderOf a = m).card := by
@@ -605,6 +605,10 @@ theorem IsCyclic.exponent_eq_zero_of_infinite [Group α] [IsCyclic α] [Infinite
instance ZMod.instIsAddCyclic (n : ℕ) : IsAddCyclic (ZMod n) where
exists_generator := ⟨1, fun n ↦ ⟨n, by simp⟩⟩
+instance ZMod.instIsSimpleAddGroup {p : ℕ} [Fact p.Prime] : IsSimpleAddGroup (ZMod p) :=
+ AddCommGroup.is_simple_iff_isAddCyclic_and_prime_card.2
+ ⟨by infer_instance, by simpa using (Fact.out : p.Prime)⟩
+
@[simp]
protected theorem ZMod.exponent (n : ℕ) : AddMonoid.exponent (ZMod n) = n := by
cases n
@@ -602,4 +602,13 @@ theorem IsCyclic.exponent_eq_zero_of_infinite [Group α] [IsCyclic α] [Infinite
#align is_cyclic.exponent_eq_zero_of_infinite IsCyclic.exponent_eq_zero_of_infinite
#align is_add_cyclic.exponent_eq_zero_of_infinite IsAddCyclic.exponent_eq_zero_of_infinite
+instance ZMod.instIsAddCyclic (n : ℕ) : IsAddCyclic (ZMod n) where
+ exists_generator := ⟨1, fun n ↦ ⟨n, by simp⟩⟩
+
+@[simp]
+protected theorem ZMod.exponent (n : ℕ) : AddMonoid.exponent (ZMod n) = n := by
+ cases n
+ · rw [IsAddCyclic.exponent_eq_zero_of_infinite]
+ · rw [IsAddCyclic.exponent_eq_card, card]
+
end Exponent
@@ -154,7 +154,7 @@ theorem orderOf_eq_card_of_forall_mem_zpowers [Fintype α] {g : α} (hx : ∀ x,
@[to_additive exists_nsmul_ne_zero_of_isAddCyclic]
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 := by
+ {k : ℕ} (k_pos : k ≠ 0) (k_lt_card_G : k < Fintype.card G) : ∃ a : G, a ^ k ≠ 1 := by
rcases G_cyclic with ⟨a, ha⟩
use a
contrapose! k_lt_card_G
Adds a theorem saying the cardinality of a multiplicative subgroup of a field, cast to the field, is nonzero. As well as sum_subgroup_units_zero_of_ne_bot
and other theorems about summing over multiplicative subgroups.
Co-authored-by: Pratyush Mishra <prat@upenn.edu> Co-authored-by: Buster <rcopley@gmail.com>
@@ -152,6 +152,16 @@ theorem orderOf_eq_card_of_forall_mem_zpowers [Fintype α] {g : α} (hx : ∀ x,
#align order_of_eq_card_of_forall_mem_zpowers orderOf_eq_card_of_forall_mem_zpowers
#align add_order_of_eq_card_of_forall_mem_zmultiples addOrderOf_eq_card_of_forall_mem_zmultiples
+@[to_additive exists_nsmul_ne_zero_of_isAddCyclic]
+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 := by
+ rcases G_cyclic with ⟨a, ha⟩
+ use a
+ contrapose! k_lt_card_G
+ convert orderOf_le_of_pow_eq_one k_pos.bot_lt k_lt_card_G
+ rw [orderOf_eq_card_zpowers, eq_comm, Subgroup.card_eq_iff_eq_top, eq_top_iff]
+ exact fun x _ ↦ ha x
+
@[to_additive Infinite.addOrderOf_eq_zero_of_forall_mem_zmultiples]
theorem Infinite.orderOf_eq_zero_of_forall_mem_zpowers [Infinite α] {g : α}
(h : ∀ x, x ∈ zpowers g) : orderOf g = 0 := by
MulZeroClass.
in mul_zero
/zero_mul
(#6682)
Search&replace MulZeroClass.mul_zero
-> mul_zero
, MulZeroClass.zero_mul
-> zero_mul
.
These were introduced by Mathport, as the full name of mul_zero
is actually MulZeroClass.mul_zero
(it's exported with the short name).
@@ -263,7 +263,7 @@ theorem IsCyclic.card_pow_eq_one_le [DecidableEq α] [Fintype α] [IsCyclic α]
let ⟨m, hm⟩ := Nat.gcd_dvd_right n (Fintype.card α)
have hm0 : 0 < m :=
Nat.pos_of_ne_zero fun hm0 => by
- rw [hm0, MulZeroClass.mul_zero, Fintype.card_eq_zero_iff] at hm
+ rw [hm0, mul_zero, Fintype.card_eq_zero_iff] at hm
exact hm.elim' 1
simp only [Set.toFinset_card, SetLike.coe_sort_coe]
rw [← orderOf_eq_card_zpowers, orderOf_pow g, orderOf_eq_card_of_forall_mem_zpowers hg]
Type _
and Sort _
(#6499)
We remove all possible occurences of Type _
and Sort _
in favor of Type*
and Sort*
.
This has nice performance benefits.
@@ -89,7 +89,7 @@ def IsCyclic.commGroup [hg : Group α] [IsCyclic α] : CommGroup α :=
variable [Group α]
@[to_additive MonoidAddHom.map_add_cyclic]
-theorem MonoidHom.map_cyclic {G : Type _} [Group G] [h : IsCyclic G] (σ : G →* G) :
+theorem MonoidHom.map_cyclic {G : Type*} [Group G] [h : IsCyclic G] (σ : G →* G) :
∃ m : ℤ, ∀ g : G, σ g = g ^ m := by
obtain ⟨h, hG⟩ := IsCyclic.exists_generator (α := G)
obtain ⟨m, hm⟩ := hG (σ h)
@@ -416,7 +416,7 @@ theorem IsCyclic.card_orderOf_eq_totient [IsCyclic α] [Fintype α] {d : ℕ}
classical apply card_orderOf_eq_totient_aux₂ (fun n => IsCyclic.card_pow_eq_one_le) hd
#align is_cyclic.card_order_of_eq_totient IsCyclic.card_orderOf_eq_totient
-theorem IsAddCyclic.card_orderOf_eq_totient {α : Type _} [AddGroup α] [IsAddCyclic α]
+theorem IsAddCyclic.card_orderOf_eq_totient {α : Type*} [AddGroup α] [IsAddCyclic α]
[Fintype α] {d : ℕ} (hd : d ∣ Fintype.card α) :
(univ.filter fun a : α => addOrderOf a = d).card = totient d := by
obtain ⟨g, hg⟩ := id ‹IsAddCyclic α›
@@ -451,7 +451,7 @@ section QuotientCenter
open Subgroup
-variable {G : Type _} {H : Type _} [Group G] [Group H]
+variable {G : Type*} {H : Type*} [Group G] [Group H]
/-- A group is commutative if the quotient by the center is cyclic.
Also see `commGroup_of_cycle_center_quotient` for the `CommGroup` instance. -/
@@ -2,11 +2,6 @@
Copyright (c) 2018 Johannes Hölzl. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl
-
-! This file was ported from Lean 3 source module group_theory.specific_groups.cyclic
-! leanprover-community/mathlib commit 0f6670b8af2dff699de1c0b4b49039b31bc13c46
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathlib.Algebra.BigOperators.Order
import Mathlib.Data.Nat.Totient
@@ -15,6 +10,8 @@ import Mathlib.GroupTheory.Subgroup.Simple
import Mathlib.Tactic.Group
import Mathlib.GroupTheory.Exponent
+#align_import group_theory.specific_groups.cyclic from "leanprover-community/mathlib"@"0f6670b8af2dff699de1c0b4b49039b31bc13c46"
+
/-!
# Cyclic groups
This PR is the result of running
find . -type f -name "*.lean" -exec sed -i -E 's/^( +)\. /\1· /' {} \;
find . -type f -name "*.lean" -exec sed -i -E 'N;s/^( +·)\n +(.*)$/\1 \2/;P;D' {} \;
which firstly replaces .
focusing dots with ·
and secondly removes isolated instances of such dots, unifying them with the following line. A new rule is placed in the style linter to verify this.
@@ -199,7 +199,7 @@ instance Subgroup.isCyclic {α : Type u} [Group α] [IsCyclic α] (H : Subgroup
cases' k with k k
· rw [Int.ofNat_eq_coe, Int.natAbs_cast k, ← zpow_ofNat, ←Int.ofNat_eq_coe, hk]
exact hx₁
- . rw [Int.natAbs_negSucc, ← Subgroup.inv_mem_iff H]; simp_all⟩
+ · rw [Int.natAbs_negSucc, ← Subgroup.inv_mem_iff H]; simp_all⟩
⟨⟨⟨g ^ Nat.find hex, (Nat.find_spec hex).2⟩, fun ⟨x, hx⟩ =>
let ⟨k, hk⟩ := hg x
have hk : g ^ k = x := hk
@@ -166,7 +166,7 @@ theorem Infinite.orderOf_eq_zero_of_forall_mem_zpowers [Infinite α] {g : α}
Infinite.exists_not_mem_finset
(Finset.image (fun x => g ^ x) <| Finset.range <| orderOf g)
apply hx
- rw [← mem_powers_iff_mem_range_order_of' (x:=g) (y:=x) ho, Submonoid.mem_powers_iff]
+ rw [← mem_powers_iff_mem_range_order_of' (x := g) (y := x) ho, Submonoid.mem_powers_iff]
obtain ⟨k, hk⟩ := h x
dsimp at hk
obtain ⟨k, rfl | rfl⟩ := k.eq_nat_or_neg
@@ -29,7 +29,7 @@ For the concrete cyclic group of order `n`, see `Data.ZMod.Basic`.
## Main statements
* `isCyclic_of_prime_card` proves that a finite group of prime order is cyclic.
-* `isSimpleGroup_of_prime_card`, `is_simple_group.is_cyclic`,
+* `isSimpleGroup_of_prime_card`, `IsSimpleGroup.isCyclic`,
and `IsSimpleGroup.prime_card` classify finite simple abelian groups.
* `IsCyclic.exponent_eq_card`: For a finite cyclic group `G`, the exponent is equal to
the group's cardinality.
@@ -66,18 +66,18 @@ class IsCyclic (α : Type u) [Group α] : Prop where
exists_generator : ∃ g : α, ∀ x, x ∈ zpowers g
#align is_cyclic IsCyclic
-@[to_additive is_add_cyclic_of_subsingleton]
+@[to_additive isAddCyclic_of_subsingleton]
instance (priority := 100) isCyclic_of_subsingleton [Group α] [Subsingleton α] : IsCyclic α :=
⟨⟨1, fun x => by
rw [Subsingleton.elim x 1]
exact mem_zpowers 1⟩⟩
#align is_cyclic_of_subsingleton isCyclic_of_subsingleton
-#align is_add_cyclic_of_subsingleton is_add_cyclic_of_subsingleton
+#align is_add_cyclic_of_subsingleton isAddCyclic_of_subsingleton
/-- 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\n
+ "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 α :=
{ hg with
@@ -102,7 +102,7 @@ theorem MonoidHom.map_cyclic {G : Type _} [Group G] [h : IsCyclic G] (σ : G →
#align monoid_hom.map_cyclic MonoidHom.map_cyclic
#align monoid_add_hom.map_add_cyclic MonoidAddHom.map_add_cyclic
-@[to_additive is_add_cyclic_of_orderOf_eq_card]
+@[to_additive isAddCyclic_of_orderOf_eq_card]
theorem isCyclic_of_orderOf_eq_card [Fintype α] (x : α) (hx : orderOf x = Fintype.card α) :
IsCyclic α := by
classical
@@ -111,16 +111,16 @@ theorem isCyclic_of_orderOf_eq_card [Fintype α] (x : α) (hx : orderOf x = Fint
rw [← Fintype.card_congr (Equiv.Set.univ α), orderOf_eq_card_zpowers] at hx
exact Set.eq_of_subset_of_card_le (Set.subset_univ _) (ge_of_eq hx)
#align is_cyclic_of_order_of_eq_card isCyclic_of_orderOf_eq_card
-#align is_add_cyclic_of_order_of_eq_card is_add_cyclic_of_orderOf_eq_card
+#align is_add_cyclic_of_order_of_eq_card isAddCyclic_of_orderOf_eq_card
/-- A finite group of prime order is cyclic. -/
-@[to_additive is_add_cyclic_of_prime_card "A finite group of prime order is cyclic."]
+@[to_additive isAddCyclic_of_prime_card "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 α :=
⟨by
obtain ⟨g, hg⟩ : ∃ g : α, g ≠ 1 := Fintype.exists_ne_of_one_lt_card (h.symm ▸ hp.1.one_lt) 1
classical
- -- for fintype (subgroup.zpowers g)
+ -- for Fintype (Subgroup.zpowers g)
have : Fintype.card (Subgroup.zpowers g) ∣ p := by
rw [← h]
apply card_subgroup_dvd_card
@@ -143,7 +143,7 @@ theorem isCyclic_of_prime_card {α : Type u} [Group α] [Fintype α] {p : ℕ} [
rw [Subgroup.eq_top_of_card_eq _ that]
exact Subgroup.mem_top _⟩
#align is_cyclic_of_prime_card isCyclic_of_prime_card
-#align is_add_cyclic_of_prime_card is_add_cyclic_of_prime_card
+#align is_add_cyclic_of_prime_card isAddCyclic_of_prime_card
@[to_additive addOrderOf_eq_card_of_forall_mem_zmultiples]
theorem orderOf_eq_card_of_forall_mem_zpowers [Fintype α] {g : α} (hx : ∀ x, x ∈ zpowers g) :
@@ -178,13 +178,13 @@ theorem Infinite.orderOf_eq_zero_of_forall_mem_zpowers [Infinite α] {g : α}
#align infinite.order_of_eq_zero_of_forall_mem_zpowers Infinite.orderOf_eq_zero_of_forall_mem_zpowers
#align infinite.add_order_of_eq_zero_of_forall_mem_zmultiples Infinite.addOrderOf_eq_zero_of_forall_mem_zmultiples
-@[to_additive Bot.is_add_cyclic]
+@[to_additive Bot.isAddCyclic]
instance Bot.isCyclic {α : Type u} [Group α] : IsCyclic (⊥ : Subgroup α) :=
⟨⟨1, fun x => ⟨0, Subtype.eq <| (zpow_zero (1 : α)).trans <| Eq.symm (Subgroup.mem_bot.1 x.2)⟩⟩⟩
#align bot.is_cyclic Bot.isCyclic
-#align bot.is_add_cyclic Bot.is_add_cyclic
+#align bot.is_add_cyclic Bot.isAddCyclic
-@[to_additive AddSubgroup.is_add_cyclic]
+@[to_additive AddSubgroup.isAddCyclic]
instance Subgroup.isCyclic {α : Type u} [Group α] [IsCyclic α] (H : Subgroup α) : IsCyclic H :=
haveI := Classical.propDecidable
let ⟨g, hg⟩ := IsCyclic.exists_generator (α := α)
@@ -233,7 +233,7 @@ instance Subgroup.isCyclic {α : Type u} [Group α] [IsCyclic α] (H : Subgroup
⟨fun h => by simp at *; tauto, fun h => by rw [Subgroup.mem_bot.1 h]; exact H.one_mem⟩
subst this; infer_instance
#align subgroup.is_cyclic Subgroup.isCyclic
-#align add_subgroup.is_add_cyclic AddSubgroup.is_add_cyclic
+#align add_subgroup.is_add_cyclic AddSubgroup.isAddCyclic
open Finset Nat
@@ -333,12 +333,9 @@ private theorem card_pow_eq_one_eq_orderOf_aux (a : α) :
fun _ _ h => Subtype.eq (Subtype.mk.inj h))
_ = (univ.filter fun b : α => b ^ orderOf a = 1).card := Fintype.card_ofFinset _ _
)
--- Porting note: private so presumably is not used
--- #align card_pow_eq_one_eq_order_of_aux card_pow_eq_one_eq_order_of_aux
+-- Use φ for `Nat.totient`
open Nat
-
--- use φ for nat.totient
private theorem card_orderOf_eq_totient_aux₁ :
∀ {d : ℕ},
d ∣ Fintype.card α →
@@ -364,8 +361,6 @@ private theorem card_orderOf_eq_totient_aux₁ :
rw [← filter_dvd_eq_divisors hd0, sum_card_orderOf_eq_card_pow_eq_one hd0,
filter_dvd_eq_divisors hd0, sum_totient, ← ha, card_pow_eq_one_eq_orderOf_aux hn a]
simpa [← cons_self_properDivisors hd0, ← h1] using h2
--- Porting note: private so presumably is not used
--- #align card_order_of_eq_totient_aux₁ card_order_of_eq_totient_aux₁
theorem card_orderOf_eq_totient_aux₂ {d : ℕ} (hd : d ∣ Fintype.card α) :
(univ.filter fun a : α => orderOf a = d).card = φ d := by
@@ -438,18 +433,18 @@ attribute [to_additive existing IsCyclic.card_orderOf_eq_totient]
@[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 α :=
- have : Nontrivial α := by
- have h' := Nat.Prime.one_lt (Fact.out (p := p.Prime))
- rw [← h] at h'
- exact Fintype.one_lt_card_iff_nontrivial.1 h'
- ⟨ fun H _ => by
- classical
- have hcard := card_subgroup_dvd_card H
- rw [h, dvd_prime (Fact.out (p := p.Prime))] at hcard
- refine' hcard.imp (fun h1 => _) fun hp => _
- · haveI := Fintype.card_le_one_iff_subsingleton.1 (le_of_eq h1)
- apply eq_bot_of_subsingleton
- · exact eq_top_of_card_eq _ (hp.trans h.symm)⟩
+ have : Nontrivial α := by
+ have h' := Nat.Prime.one_lt (Fact.out (p := p.Prime))
+ rw [← h] at h'
+ exact Fintype.one_lt_card_iff_nontrivial.1 h'
+ ⟨fun H _ => by
+ classical
+ have hcard := card_subgroup_dvd_card H
+ rw [h, dvd_prime (Fact.out (p := p.Prime))] at hcard
+ refine' hcard.imp (fun h1 => _) fun hp => _
+ · haveI := Fintype.card_le_one_iff_subsingleton.1 (le_of_eq h1)
+ apply eq_bot_of_subsingleton
+ · exact eq_top_of_card_eq _ (hp.trans h.symm)⟩
#align is_simple_group_of_prime_card isSimpleGroup_of_prime_card
#align is_simple_add_group_of_prime_card isSimpleAddGroup_of_prime_card
@@ -462,11 +457,10 @@ open Subgroup
variable {G : Type _} {H : Type _} [Group G] [Group H]
/-- A group is commutative if the quotient by the center is cyclic.
- Also see `commGroup_of_cycle_center_quotient` for the `comm_group` instance. -/
+ Also see `commGroup_of_cycle_center_quotient` for the `CommGroup` instance. -/
@[to_additive commutative_of_add_cyclic_center_quotient
- "A group is commutative if the quotient by\n
- the center is cyclic. Also see `addCommGroup_of_cycle_center_quotient`\n
- for the `add_comm_group` instance."]
+ "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 :=
let ⟨⟨x, y, (hxy : f y = x)⟩, (hx : ∀ a : f.range, a ∈ zpowers _)⟩ :=
@@ -476,8 +470,7 @@ theorem commutative_of_cyclic_center_quotient [IsCyclic H] (f : G →* H) (hf :
have hm : x ^ m = f a := by simpa [Subtype.ext_iff] using hm
have hn : x ^ n = f b := by simpa [Subtype.ext_iff] using hn
have ha : y ^ (-m) * a ∈ center G :=
- hf (by
- rw [f.mem_ker, f.map_mul, f.map_zpow, hxy, zpow_neg x m, hm, inv_mul_self])
+ hf (by rw [f.mem_ker, f.map_mul, f.map_zpow, hxy, zpow_neg x m, hm, inv_mul_self])
have hb : y ^ (-n) * b ∈ center G :=
hf (by rw [f.mem_ker, f.map_mul, f.map_zpow, hxy, zpow_neg x n, hn, inv_mul_self])
calc
@@ -491,7 +484,7 @@ theorem commutative_of_cyclic_center_quotient [IsCyclic H] (f : G →* H) (hf :
/-- A group is commutative if the quotient by the center is cyclic. -/
@[to_additive commutativeOfAddCycleCenterQuotient
- "A group is commutative if the quotient by\n the center is cyclic."]
+ "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 :=
{ show Group G by infer_instance with mul_comm := commutative_of_cyclic_center_quotient f hf }
@@ -519,6 +512,8 @@ instance (priority := 100) isCyclic : IsCyclic α := by
apply Subgroup.mem_zpowers
· rw [ht]
apply Subgroup.mem_top
+#align is_simple_group.is_cyclic IsSimpleGroup.isCyclic
+#align is_simple_add_group.is_add_cyclic IsSimpleAddGroup.isAddCyclic
@[to_additive]
theorem prime_card [Fintype α] : (Fintype.card α).Prime := by
@@ -549,7 +544,7 @@ end CommGroup
end IsSimpleGroup
-@[to_additive AddCommGroup.is_simple_iff_is_add_cyclic_and_prime_card]
+@[to_additive AddCommGroup.is_simple_iff_isAddCyclic_and_prime_card]
theorem CommGroup.is_simple_iff_isCyclic_and_prime_card [Fintype α] [CommGroup α] :
IsSimpleGroup α ↔ IsCyclic α ∧ (Fintype.card α).Prime := by
constructor
@@ -559,7 +554,7 @@ theorem CommGroup.is_simple_iff_isCyclic_and_prime_card [Fintype α] [CommGroup
haveI : Fact (Fintype.card α).Prime := ⟨hp⟩
exact isSimpleGroup_of_prime_card rfl
#align comm_group.is_simple_iff_is_cyclic_and_prime_card CommGroup.is_simple_iff_isCyclic_and_prime_card
-#align add_comm_group.is_simple_iff_is_add_cyclic_and_prime_card AddCommGroup.is_simple_iff_is_add_cyclic_and_prime_card
+#align add_comm_group.is_simple_iff_is_add_cyclic_and_prime_card AddCommGroup.is_simple_iff_isAddCyclic_and_prime_card
section Exponent
@@ -601,4 +596,3 @@ theorem IsCyclic.exponent_eq_zero_of_infinite [Group α] [IsCyclic α] [Infinite
#align is_add_cyclic.exponent_eq_zero_of_infinite IsAddCyclic.exponent_eq_zero_of_infinite
end Exponent
-
The unported dependencies are