fact
stringlengths
6
3.84k
type
stringclasses
11 values
library
stringclasses
32 values
imports
listlengths
1
14
filename
stringlengths
20
95
symbolic_name
stringlengths
1
90
docstring
stringlengths
7
20k
LinearOrderedAddCommGroup.wellFoundedOn_setOf_le_lt_iff_nonempty_discrete {G : Type*} [AddCommGroup G] [LinearOrder G] [IsOrderedAddMonoid G] [Nontrivial G] {g : G} : Set.WellFoundedOn {x : G | g ≤ x} (· < ·) ↔ Nonempty (G ≃+o ℤ) := by suffices Set.WellFoundedOn {x : G | 0 ≤ x} (· < ·) ↔ Nonempty (G ≃+o ℤ) by rw [← this] refine ⟨fun h ↦ (h.mapsTo (· + g) ?_).mono' ?_, fun h ↦ (h.mapsTo (· - g) ?_).mono' ?_⟩ <;> · try intro simp [Function.onFun] constructor · intro h replace h : WellFounded (α := {x : G | 0 ≤ x}) (· < ·) := h rw [WellFounded.wellFounded_iff_has_min] at h by_cases H : ∀ (x : G) {y}, 0 < y → ∃ n : ℕ, x ≤ n • y -- Archimedean · replace H : Archimedean G := ⟨H⟩ rw [LinearOrderedAddCommGroup.discrete_iff_not_denselyOrdered] intro hd obtain ⟨y, hy⟩ := exists_ne (0 : G) wlog hy' : 0 < y generalizing y · refine this (-y) ?_ ?_ · simp [hy] · simp only [not_lt] at hy' simp [lt_of_le_of_ne hy' hy] obtain ⟨⟨z, hz⟩, hz', hz''⟩ := h ({x | ⟨0, le_rfl⟩ < x}) ⟨⟨y, hy'.le⟩, hy'⟩ obtain ⟨w, hw, hw'⟩ := exists_between hz' exact hz'' ⟨w, hw.le⟩ hw hw' · push_neg at H exfalso obtain ⟨x, y, hy0, H⟩ := H obtain ⟨_, ⟨n, rfl⟩, hz⟩ := h (Set.range (fun n : ℕ ↦ ⟨x - n • y, sub_nonneg.mpr (H _).le⟩)) (range_nonempty _) refine hz ⟨x - (n + 1) • y, sub_nonneg.mpr (H _).le⟩ ⟨_, rfl⟩ ?_ simp [add_smul, hy0] · rintro ⟨f⟩ have : LocallyFiniteOrder G := LocallyFiniteOrder.ofOrderIsoClass f exact BddBelow.wellFoundedOn_lt ⟨0, by simp [mem_lowerBounds]⟩
lemma
GroupTheory
[ "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.LocallyFiniteOrder", "Mathlib.Data.Int.Interval", "Mathlib.GroupTheory.Archimedean", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Order.Interval.Finset.DenselyOrdered" ]
Mathlib/GroupTheory/ArchimedeanDensely.lean
LinearOrderedAddCommGroup.wellFoundedOn_setOf_le_lt_iff_nonempty_discrete
null
LinearOrderedAddCommGroup.wellFoundedOn_setOf_ge_gt_iff_nonempty_discrete {G : Type*} [AddCommGroup G] [LinearOrder G] [IsOrderedAddMonoid G] [Nontrivial G] (g : G) : Set.WellFoundedOn {x : G | x ≤ g} (· > ·) ↔ Nonempty (G ≃+o ℤ) := by rw [← wellFoundedOn_setOf_le_lt_iff_nonempty_discrete (g := -g)] refine ⟨fun h ↦ (h.mapsTo (- ·) ?_).mono' ?_, fun h ↦ (h.mapsTo (- ·) ?_).mono' ?_⟩ <;> · intro simp [Function.onFun, neg_le]
lemma
GroupTheory
[ "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.LocallyFiniteOrder", "Mathlib.Data.Int.Interval", "Mathlib.GroupTheory.Archimedean", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Order.Interval.Finset.DenselyOrdered" ]
Mathlib/GroupTheory/ArchimedeanDensely.lean
LinearOrderedAddCommGroup.wellFoundedOn_setOf_ge_gt_iff_nonempty_discrete
null
LinearOrderedCommGroup.wellFoundedOn_setOf_le_lt_iff_nonempty_discrete {G : Type*} [CommGroup G] [LinearOrder G] [IsOrderedMonoid G] [Nontrivial G] {g : G} : Set.WellFoundedOn {x : G | g ≤ x} (· < ·) ↔ Nonempty (G ≃*o Multiplicative ℤ) := by let e : G ≃o Additive G := OrderIso.refl G suffices Set.WellFoundedOn {x : G | g ≤ x} (· < ·) ↔ Set.WellFoundedOn {x | e g ≤ x} (· < ·) by rw [this, LinearOrderedAddCommGroup.wellFoundedOn_setOf_le_lt_iff_nonempty_discrete] refine Nonempty.congr (fun f ↦ ?_) (fun f ↦ ?_) · exact ⟨AddEquiv.toMultiplicative' f, by simp⟩ · exact ⟨MulEquiv.toAdditive' f, by simp⟩ refine ⟨fun h ↦ (h.mapsTo e.symm fun _ ↦ e.le_symm_apply.mpr).mono' ?_, fun h ↦ (h.mapsTo e fun _ ↦ ?_).mono' ?_⟩ <;> simp [Function.onFun]
lemma
GroupTheory
[ "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.LocallyFiniteOrder", "Mathlib.Data.Int.Interval", "Mathlib.GroupTheory.Archimedean", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Order.Interval.Finset.DenselyOrdered" ]
Mathlib/GroupTheory/ArchimedeanDensely.lean
LinearOrderedCommGroup.wellFoundedOn_setOf_le_lt_iff_nonempty_discrete
null
LinearOrderedCommGroup.wellFoundedOn_setOf_ge_gt_iff_nonempty_discrete {G : Type*} [CommGroup G] [LinearOrder G] [IsOrderedMonoid G] [Nontrivial G] (g : G) : Set.WellFoundedOn {x : G | x ≤ g} (· > ·) ↔ Nonempty (G ≃*o Multiplicative ℤ) := by rw [← wellFoundedOn_setOf_le_lt_iff_nonempty_discrete (g := g⁻¹)] refine ⟨fun h ↦ (h.mapsTo (·⁻¹) ?_).mono' ?_, fun h ↦ (h.mapsTo (·⁻¹) ?_).mono' ?_⟩ <;> · intro simp [Function.onFun, inv_le']
lemma
GroupTheory
[ "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.LocallyFiniteOrder", "Mathlib.Data.Int.Interval", "Mathlib.GroupTheory.Archimedean", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Order.Interval.Finset.DenselyOrdered" ]
Mathlib/GroupTheory/ArchimedeanDensely.lean
LinearOrderedCommGroup.wellFoundedOn_setOf_ge_gt_iff_nonempty_discrete
null
LinearOrderedCommGroupWithZero.wellFoundedOn_setOf_le_lt_iff_nonempty_discrete_of_ne_zero {G₀ : Type*} [LinearOrderedCommGroupWithZero G₀] [Nontrivial G₀ˣ] {g : G₀} (hg : g ≠ 0) : Set.WellFoundedOn {x : G₀ | g ≤ x} (· < ·) ↔ Nonempty (G₀ ≃*o ℤᵐ⁰) := by suffices Set.WellFoundedOn {x : G₀ | g ≤ x} (· < ·) ↔ Set.WellFoundedOn {x : G₀ˣ | Units.mk0 g hg ≤ x} (· < ·) by rw [this, LinearOrderedCommGroup.wellFoundedOn_setOf_le_lt_iff_nonempty_discrete] refine Nonempty.congr (fun f ↦ ⟨?_, ?_⟩) (fun f ↦ ⟨?_, ?_⟩) · exact WithZero.withZeroUnitsEquiv.symm.trans f.withZero · intro a b rcases eq_or_ne a 0 with rfl | ha · simp [WithZero.withZeroUnitsEquiv] rcases eq_or_ne b 0 with rfl | hb · simp [WithZero.withZeroUnitsEquiv] simp [WithZero.withZeroUnitsEquiv, ha, hb, ← Units.val_le_val] · exact MulEquiv.withZero.symm (WithZero.withZeroUnitsEquiv.trans f) · intros rw [← WithZero.coe_le_coe] simp rw [← Set.wellFoundedOn_sdiff_singleton (a := 0)] refine ⟨fun h ↦ (h.mapsTo Units.val ?_).mono' ?_, fun h ↦ (h.mapsTo ?_ ?_).mono' ?_⟩ · intro simp [← Units.val_le_val] · simp [Function.onFun] · exact fun x ↦ if h : x = 0 then 1 else Units.mk0 x h · simp +contextual [← Units.val_le_val, MapsTo] · simp only [mem_diff, mem_setOf_eq, mem_singleton_iff, Function.onFun, and_imp] intro _ _ ha0 _ _ hb0 h simp [ha0, hb0, ← Units.val_lt_val, h]
lemma
GroupTheory
[ "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.LocallyFiniteOrder", "Mathlib.Data.Int.Interval", "Mathlib.GroupTheory.Archimedean", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Order.Interval.Finset.DenselyOrdered" ]
Mathlib/GroupTheory/ArchimedeanDensely.lean
LinearOrderedCommGroupWithZero.wellFoundedOn_setOf_le_lt_iff_nonempty_discrete_of_ne_zero
null
LinearOrderedCommGroupWithZero.wellFoundedOn_setOf_ge_gt_iff_nonempty_discrete_of_ne_zero {G₀ : Type*} [LinearOrderedCommGroupWithZero G₀] [Nontrivial G₀ˣ] {g : G₀} (hg : g ≠ 0) : Set.WellFoundedOn {x : G₀ | x ≤ g} (· > ·) ↔ Nonempty (G₀ ≃*o ℤᵐ⁰) := by have hg' : g⁻¹ ≠ 0 := by simp [hg] rw [← wellFoundedOn_setOf_le_lt_iff_nonempty_discrete_of_ne_zero hg', ← Set.wellFoundedOn_sdiff_singleton (a := 0)] refine ⟨fun h ↦ (h.mapsTo (·⁻¹) ?_).mono' ?_, fun h ↦ (h.mapsTo (·⁻¹) ?_).mono' ?_⟩ · intro x rcases eq_or_ne x 0 with rfl | hx · simp [hg] simp only [mem_setOf_eq, mem_diff, mem_singleton_iff, inv_eq_zero, hx, not_false_eq_true, and_true] refine (inv_le_comm₀ ?_ ?_).mp <;> simp [zero_lt_iff, hg, hx] · simp only [mem_setOf_eq, Function.onFun, gt_iff_lt] intro a ha b _ refine inv_strictAnti₀ ?_ contrapose! ha simp only [le_zero_iff] at ha simp [zero_lt_iff, ha, hg] · intro x simp only [mem_diff, mem_setOf_eq, mem_singleton_iff, and_imp] intro hxg hx refine inv_anti₀ ?_ hxg simp [zero_lt_iff, hx] · simp only [mem_diff, mem_setOf_eq, mem_singleton_iff, gt_iff_lt, Function.onFun, and_imp] intro a _ _ b _ hb0 refine inv_strictAnti₀ ?_ simp [zero_lt_iff, hb0]
lemma
GroupTheory
[ "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.LocallyFiniteOrder", "Mathlib.Data.Int.Interval", "Mathlib.GroupTheory.Archimedean", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Order.Interval.Finset.DenselyOrdered" ]
Mathlib/GroupTheory/ArchimedeanDensely.lean
LinearOrderedCommGroupWithZero.wellFoundedOn_setOf_ge_gt_iff_nonempty_discrete_of_ne_zero
null
instWellFoundedGTWithZeroMultiplicativeIntLeOne : WellFoundedGT { v : ℤᵐ⁰ // v ≤ 1 } := { wf := (LinearOrderedCommGroupWithZero.wellFoundedOn_setOf_ge_gt_iff_nonempty_discrete_of_ne_zero one_ne_zero).mpr instNonemptyOfInhabited }
instance
GroupTheory
[ "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.LocallyFiniteOrder", "Mathlib.Data.Int.Interval", "Mathlib.GroupTheory.Archimedean", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Order.Interval.Finset.DenselyOrdered" ]
Mathlib/GroupTheory/ArchimedeanDensely.lean
instWellFoundedGTWithZeroMultiplicativeIntLeOne
null
@[to_additive] OrderMonoidIso.mulArchimedean {α β} [CommMonoid α] [PartialOrder α] [CommMonoid β] [PartialOrder β] (e : α ≃*o β) [MulArchimedean α] : MulArchimedean β := by constructor intro x y hxy replace hxy : 1 < e.symm y := by simp [← map_lt_map_iff e, hxy] refine (MulArchimedean.arch (e.symm x) hxy).imp ?_ simp [← map_pow, ← map_le_map_iff e]
lemma
GroupTheory
[ "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.LocallyFiniteOrder", "Mathlib.Data.Int.Interval", "Mathlib.GroupTheory.Archimedean", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Order.Interval.Finset.DenselyOrdered" ]
Mathlib/GroupTheory/ArchimedeanDensely.lean
OrderMonoidIso.mulArchimedean
null
WithZero.mulArchimedean_iff {α} [CommGroup α] [PartialOrder α] : MulArchimedean (WithZero α) ↔ MulArchimedean α := by constructor <;> intro _ · exact OrderMonoidIso.unitsWithZero.mulArchimedean · infer_instance
lemma
GroupTheory
[ "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.LocallyFiniteOrder", "Mathlib.Data.Int.Interval", "Mathlib.GroupTheory.Archimedean", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Order.Interval.Finset.DenselyOrdered" ]
Mathlib/GroupTheory/ArchimedeanDensely.lean
WithZero.mulArchimedean_iff
null
Units.mulArchimedean_iff {G₀} [LinearOrderedCommGroupWithZero G₀] : MulArchimedean G₀ˣ ↔ MulArchimedean G₀ := by constructor <;> intro _ · exact OrderMonoidIso.withZeroUnits.mulArchimedean · infer_instance
lemma
GroupTheory
[ "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.LocallyFiniteOrder", "Mathlib.Data.Int.Interval", "Mathlib.GroupTheory.Archimedean", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Order.Interval.Finset.DenselyOrdered" ]
Mathlib/GroupTheory/ArchimedeanDensely.lean
Units.mulArchimedean_iff
null
denselyOrdered_additive_iff : DenselyOrdered (Additive X) ↔ DenselyOrdered X := Iff.rfl
lemma
GroupTheory
[ "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.LocallyFiniteOrder", "Mathlib.Data.Int.Interval", "Mathlib.GroupTheory.Archimedean", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Order.Interval.Finset.DenselyOrdered" ]
Mathlib/GroupTheory/ArchimedeanDensely.lean
denselyOrdered_additive_iff
null
denselyOrdered_multiplicative_iff : DenselyOrdered (Multiplicative X) ↔ DenselyOrdered X := Iff.rfl
lemma
GroupTheory
[ "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.LocallyFiniteOrder", "Mathlib.Data.Int.Interval", "Mathlib.GroupTheory.Archimedean", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Order.Interval.Finset.DenselyOrdered" ]
Mathlib/GroupTheory/ArchimedeanDensely.lean
denselyOrdered_multiplicative_iff
null
WithZero.denselyOrdered_iff {M : Type*} [Preorder M] [NoMinOrder M] : DenselyOrdered (WithZero M) ↔ DenselyOrdered M := WithBot.denselyOrdered_iff
lemma
GroupTheory
[ "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.LocallyFiniteOrder", "Mathlib.Data.Int.Interval", "Mathlib.GroupTheory.Archimedean", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Order.Interval.Finset.DenselyOrdered" ]
Mathlib/GroupTheory/ArchimedeanDensely.lean
WithZero.denselyOrdered_iff
null
Int.not_denselyOrdered : ¬ DenselyOrdered ℤ := (LinearOrderedAddCommGroup.discrete_iff_not_denselyOrdered ℤ).mp ⟨.refl _⟩
lemma
GroupTheory
[ "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.LocallyFiniteOrder", "Mathlib.Data.Int.Interval", "Mathlib.GroupTheory.Archimedean", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Order.Interval.Finset.DenselyOrdered" ]
Mathlib/GroupTheory/ArchimedeanDensely.lean
Int.not_denselyOrdered
null
not_denselyOrdered_withZero_int : ¬ DenselyOrdered ℤᵐ⁰ := (LinearOrderedCommGroupWithZero.discrete_iff_not_denselyOrdered _).mp ⟨.refl _⟩
lemma
GroupTheory
[ "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.LocallyFiniteOrder", "Mathlib.Data.Int.Interval", "Mathlib.GroupTheory.Archimedean", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Order.Interval.Finset.DenselyOrdered" ]
Mathlib/GroupTheory/ArchimedeanDensely.lean
not_denselyOrdered_withZero_int
null
WithZero.denselyOrdered_set_iff_subsingleton {X : Type*} [LinearOrder X] [LocallyFiniteOrder X] {s : Set (WithZero X)} : DenselyOrdered s ↔ s.Subsingleton := WithBot.denselyOrdered_set_iff_subsingleton
lemma
GroupTheory
[ "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.LocallyFiniteOrder", "Mathlib.Data.Int.Interval", "Mathlib.GroupTheory.Archimedean", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Order.Interval.Finset.DenselyOrdered" ]
Mathlib/GroupTheory/ArchimedeanDensely.lean
WithZero.denselyOrdered_set_iff_subsingleton
null
sum_conjClasses_card_eq_card [Fintype <| ConjClasses G] [Fintype G] [∀ x : ConjClasses G, Fintype x.carrier] : ∑ x : ConjClasses G, x.carrier.toFinset.card = Fintype.card G := by suffices (Σ x : ConjClasses G, x.carrier) ≃ G by simpa using (Fintype.card_congr this) simpa [carrier_eq_preimage_mk] using Equiv.sigmaFiberEquiv ConjClasses.mk
theorem
GroupTheory
[ "Mathlib.Algebra.BigOperators.Finprod", "Mathlib.Algebra.Group.ConjFinite", "Mathlib.Algebra.Group.Subgroup.Finite", "Mathlib.Data.Set.Card", "Mathlib.GroupTheory.Subgroup.Center" ]
Mathlib/GroupTheory/ClassEquation.lean
sum_conjClasses_card_eq_card
Conjugacy classes form a partition of G, stated in terms of cardinality.
Group.sum_card_conj_classes_eq_card [Finite G] : ∑ᶠ x : ConjClasses G, x.carrier.ncard = Nat.card G := by classical cases nonempty_fintype G rw [Nat.card_eq_fintype_card, ← sum_conjClasses_card_eq_card, finsum_eq_sum_of_fintype] simp [Set.ncard_eq_toFinset_card']
theorem
GroupTheory
[ "Mathlib.Algebra.BigOperators.Finprod", "Mathlib.Algebra.Group.ConjFinite", "Mathlib.Algebra.Group.Subgroup.Finite", "Mathlib.Data.Set.Card", "Mathlib.GroupTheory.Subgroup.Center" ]
Mathlib/GroupTheory/ClassEquation.lean
Group.sum_card_conj_classes_eq_card
Conjugacy classes form a partition of G, stated in terms of cardinality.
Group.nat_card_center_add_sum_card_noncenter_eq_card [Finite G] : Nat.card (Subgroup.center G) + ∑ᶠ x ∈ noncenter G, Nat.card x.carrier = Nat.card G := by classical cases nonempty_fintype G rw [@Nat.card_eq_fintype_card G, ← sum_conjClasses_card_eq_card, ← Finset.sum_sdiff (ConjClasses.noncenter G).toFinset.subset_univ] simp only [Nat.card_eq_fintype_card, Set.toFinset_card] congr 1 swap · convert finsum_cond_eq_sum_of_cond_iff _ _ simp [Set.mem_toFinset] calc Fintype.card (Subgroup.center G) = Fintype.card ((noncenter G)ᶜ : Set _) := Fintype.card_congr ((mk_bijOn G).equiv _) _ = Finset.card (Finset.univ \ (noncenter G).toFinset) := by rw [← Set.toFinset_card, Set.toFinset_compl, Finset.compl_eq_univ_sdiff] _ = _ := ?_ rw [Finset.card_eq_sum_ones] refine Finset.sum_congr rfl ?_ rintro ⟨g⟩ hg simp only [noncenter, Set.toFinset_setOf, Finset.mem_univ, true_and, Finset.mem_sdiff, Finset.mem_filter, Set.not_nontrivial_iff] at hg rw [eq_comm, ← Set.toFinset_card, Finset.card_eq_one] exact ⟨g, Finset.coe_injective <| by simpa using hg.eq_singleton_of_mem mem_carrier_mk⟩
theorem
GroupTheory
[ "Mathlib.Algebra.BigOperators.Finprod", "Mathlib.Algebra.Group.ConjFinite", "Mathlib.Algebra.Group.Subgroup.Finite", "Mathlib.Data.Set.Card", "Mathlib.GroupTheory.Subgroup.Center" ]
Mathlib/GroupTheory/ClassEquation.lean
Group.nat_card_center_add_sum_card_noncenter_eq_card
The **class equation** for finite groups. The cardinality of a group is equal to the size of its center plus the sum of the size of all its nontrivial conjugacy classes.
Group.card_center_add_sum_card_noncenter_eq_card (G) [Group G] [∀ x : ConjClasses G, Fintype x.carrier] [Fintype G] [Fintype <| Subgroup.center G] [Fintype <| noncenter G] : Fintype.card (Subgroup.center G) + ∑ x ∈ (noncenter G).toFinset, x.carrier.toFinset.card = Fintype.card G := by convert Group.nat_card_center_add_sum_card_noncenter_eq_card G using 2 · simp · rw [← finsum_set_coe_eq_finsum_mem (noncenter G), finsum_eq_sum_of_fintype, ← Finset.sum_set_coe] simp · simp
theorem
GroupTheory
[ "Mathlib.Algebra.BigOperators.Finprod", "Mathlib.Algebra.Group.ConjFinite", "Mathlib.Algebra.Group.Subgroup.Finite", "Mathlib.Data.Set.Card", "Mathlib.GroupTheory.Subgroup.Center" ]
Mathlib/GroupTheory/ClassEquation.lean
Group.card_center_add_sum_card_noncenter_eq_card
null
Subgroup.quotConjEquiv (H K : Subgroup G) (g : ConjAct G) : K ⧸ H.subgroupOf K ≃ (g • K : Subgroup G) ⧸ (g • H).subgroupOf (g • K) := Quotient.congr (K.equivSMul g).toEquiv fun a b ↦ by dsimp rw [← Quotient.eq'', ← Quotient.eq'', QuotientGroup.eq, QuotientGroup.eq, mem_subgroupOf, mem_subgroupOf, ← map_inv, ← map_mul, equivSMul_apply_coe] exact smul_mem_pointwise_smul_iff.symm @[deprecated (since := "2025-09-17")] alias Commensurable.quotConjEquiv := Subgroup.quotConjEquiv
def
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Commensurable.lean
Subgroup.quotConjEquiv
Equivalence of `K / (H ⊓ K)` with `gKg⁻¹/ (gHg⁻¹ ⊓ gKg⁻¹)`
@[to_additive /-- Two subgroups `H K` of `G` are commensurable if `H ⊓ K` has finite index in both `H` and `K`. -/] Subgroup.Commensurable (H K : Subgroup G) : Prop := H.relIndex K ≠ 0 ∧ K.relIndex H ≠ 0 @[deprecated (since := "2025-09-17")] alias Commensurable := Subgroup.Commensurable
def
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Commensurable.lean
Subgroup.Commensurable
Two subgroups `H K` of `G` are commensurable if `H ⊓ K` has finite index in both `H` and `K`.
@[to_additive (attr := refl)] protected refl (H : Subgroup G) : Commensurable H H := by simp [Commensurable] @[to_additive]
theorem
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Commensurable.lean
refl
null
comm {H K : Subgroup G} : Commensurable H K ↔ Commensurable K H := and_comm @[to_additive (attr := symm)]
theorem
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Commensurable.lean
comm
null
symm {H K : Subgroup G} : Commensurable H K → Commensurable K H := And.symm @[to_additive (attr := trans)]
theorem
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Commensurable.lean
symm
null
trans {H K L : Subgroup G} (hhk : Commensurable H K) (hkl : Commensurable K L) : Commensurable H L := ⟨Subgroup.relIndex_ne_zero_trans hhk.1 hkl.1, Subgroup.relIndex_ne_zero_trans hkl.2 hhk.2⟩ @[to_additive]
theorem
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Commensurable.lean
trans
null
equivalence : Equivalence (@Commensurable G _) := ⟨Commensurable.refl, fun h => Commensurable.symm h, fun h₁ h₂ => Commensurable.trans h₁ h₂⟩
theorem
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Commensurable.lean
equivalence
null
commensurable_conj {H K : Subgroup G} (g : ConjAct G) : Commensurable H K ↔ Commensurable (g • H) (g • K) := and_congr (not_iff_not.mpr (Eq.congr_left (Cardinal.toNat_congr (quotConjEquiv H K g)))) (not_iff_not.mpr (Eq.congr_left (Cardinal.toNat_congr (quotConjEquiv K H g))))
theorem
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Commensurable.lean
commensurable_conj
null
conj {H K : Subgroup G} (h : Commensurable H K) (g : ConjAct G) : Commensurable (g • H) (g • K) := (commensurable_conj g).mp h
theorem
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Commensurable.lean
conj
Alias for the forward direction of `commensurable_conj` to allow dot-notation
commensurable_inv (H : Subgroup G) (g : ConjAct G) : Commensurable (g • H) H ↔ Commensurable H (g⁻¹ • H) := by rw [commensurable_conj, inv_smul_smul]
theorem
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Commensurable.lean
commensurable_inv
null
commensurator' (H : Subgroup G) : Subgroup (ConjAct G) where carrier := { g : ConjAct G | Commensurable (g • H) H } one_mem' := by rw [Set.mem_setOf_eq, one_smul] mul_mem' ha hb := by rw [Set.mem_setOf_eq, mul_smul] exact trans ((commensurable_conj _).mp hb) ha inv_mem' _ := by rwa [Set.mem_setOf_eq, comm, ← commensurable_inv]
def
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Commensurable.lean
commensurator'
For `H` a subgroup of `G`, this is the subgroup of all elements `g : conjAut G` such that `Commensurable (g • H) H`
commensurator (H : Subgroup G) : Subgroup G := (commensurator' H).comap ConjAct.toConjAct.toMonoidHom @[simp]
def
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Commensurable.lean
commensurator
For `H` a subgroup of `G`, this is the subgroup of all elements `g : G` such that `Commensurable (g H g⁻¹) H`
commensurator'_mem_iff (H : Subgroup G) (g : ConjAct G) : g ∈ commensurator' H ↔ Commensurable (g • H) H := Iff.rfl @[simp]
theorem
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Commensurable.lean
commensurator'_mem_iff
null
commensurator_mem_iff (H : Subgroup G) (g : G) : g ∈ commensurator H ↔ Commensurable (ConjAct.toConjAct g • H) H := Iff.rfl
theorem
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Commensurable.lean
commensurator_mem_iff
null
eq {H K : Subgroup G} (hk : Commensurable H K) : commensurator H = commensurator K := Subgroup.ext fun x => let hx := (commensurable_conj x).1 hk ⟨fun h => hx.symm.trans (h.trans hk), fun h => hx.trans (h.trans hk.symm)⟩
theorem
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Commensurable.lean
eq
null
commProb : ℚ := Nat.card { p : M × M // Commute p.1 p.2 } / (Nat.card M : ℚ) ^ 2
def
GroupTheory
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.GroupTheory.Abelianization.Finite", "Mathlib.GroupTheory.SpecificGroups.Dihedral", "Mathlib.Tactic.FieldSimp", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Qify" ]
Mathlib/GroupTheory/CommutingProbability.lean
commProb
The commuting probability of a finite type with a multiplication operation.
commProb_def : commProb M = Nat.card { p : M × M // Commute p.1 p.2 } / (Nat.card M : ℚ) ^ 2 := rfl
theorem
GroupTheory
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.GroupTheory.Abelianization.Finite", "Mathlib.GroupTheory.SpecificGroups.Dihedral", "Mathlib.Tactic.FieldSimp", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Qify" ]
Mathlib/GroupTheory/CommutingProbability.lean
commProb_def
null
commProb_prod (M' : Type*) [Mul M'] : commProb (M × M') = commProb M * commProb M' := by simp_rw [commProb_def, div_mul_div_comm, Nat.card_prod, Nat.cast_mul, mul_pow, ← Nat.cast_mul, ← Nat.card_prod, Commute, SemiconjBy, Prod.ext_iff] congr 2 exact Nat.card_congr ⟨fun x => ⟨⟨⟨x.1.1.1, x.1.2.1⟩, x.2.1⟩, ⟨⟨x.1.1.2, x.1.2.2⟩, x.2.2⟩⟩, fun x => ⟨⟨⟨x.1.1.1, x.2.1.1⟩, ⟨x.1.1.2, x.2.1.2⟩⟩, ⟨x.1.2, x.2.2⟩⟩, fun x => rfl, fun x => rfl⟩
theorem
GroupTheory
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.GroupTheory.Abelianization.Finite", "Mathlib.GroupTheory.SpecificGroups.Dihedral", "Mathlib.Tactic.FieldSimp", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Qify" ]
Mathlib/GroupTheory/CommutingProbability.lean
commProb_prod
null
commProb_pi {α : Type*} (i : α → Type*) [Fintype α] [∀ a, Mul (i a)] : commProb (∀ a, i a) = ∏ a, commProb (i a) := by simp_rw [commProb_def, Finset.prod_div_distrib, Finset.prod_pow, ← Nat.cast_prod, ← Nat.card_pi, Commute, SemiconjBy, funext_iff] congr 2 exact Nat.card_congr ⟨fun x a => ⟨⟨x.1.1 a, x.1.2 a⟩, x.2 a⟩, fun x => ⟨⟨fun a => (x a).1.1, fun a => (x a).1.2⟩, fun a => (x a).2⟩, fun x => rfl, fun x => rfl⟩
theorem
GroupTheory
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.GroupTheory.Abelianization.Finite", "Mathlib.GroupTheory.SpecificGroups.Dihedral", "Mathlib.Tactic.FieldSimp", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Qify" ]
Mathlib/GroupTheory/CommutingProbability.lean
commProb_pi
null
commProb_function {α β : Type*} [Fintype α] [Mul β] : commProb (α → β) = (commProb β) ^ Fintype.card α := by rw [commProb_pi, Finset.prod_const, Finset.card_univ] @[simp]
theorem
GroupTheory
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.GroupTheory.Abelianization.Finite", "Mathlib.GroupTheory.SpecificGroups.Dihedral", "Mathlib.Tactic.FieldSimp", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Qify" ]
Mathlib/GroupTheory/CommutingProbability.lean
commProb_function
null
commProb_eq_zero_of_infinite [Infinite M] : commProb M = 0 := div_eq_zero_iff.2 (Or.inl (Nat.cast_eq_zero.2 Nat.card_eq_zero_of_infinite)) variable [Finite M]
theorem
GroupTheory
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.GroupTheory.Abelianization.Finite", "Mathlib.GroupTheory.SpecificGroups.Dihedral", "Mathlib.Tactic.FieldSimp", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Qify" ]
Mathlib/GroupTheory/CommutingProbability.lean
commProb_eq_zero_of_infinite
null
commProb_pos [h : Nonempty M] : 0 < commProb M := h.elim fun x ↦ div_pos (Nat.cast_pos.mpr (Finite.card_pos_iff.mpr ⟨⟨(x, x), rfl⟩⟩)) (pow_pos (Nat.cast_pos.mpr Finite.card_pos) 2)
theorem
GroupTheory
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.GroupTheory.Abelianization.Finite", "Mathlib.GroupTheory.SpecificGroups.Dihedral", "Mathlib.Tactic.FieldSimp", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Qify" ]
Mathlib/GroupTheory/CommutingProbability.lean
commProb_pos
null
commProb_le_one : commProb M ≤ 1 := by refine div_le_one_of_le₀ ?_ (sq_nonneg (Nat.card M : ℚ)) rw [← Nat.cast_pow, Nat.cast_le, sq, ← Nat.card_prod] apply Finite.card_subtype_le variable {M}
theorem
GroupTheory
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.GroupTheory.Abelianization.Finite", "Mathlib.GroupTheory.SpecificGroups.Dihedral", "Mathlib.Tactic.FieldSimp", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Qify" ]
Mathlib/GroupTheory/CommutingProbability.lean
commProb_le_one
null
commProb_eq_one_iff [h : Nonempty M] : commProb M = 1 ↔ Std.Commutative ((· * ·) : M → M → M) := by classical haveI := Fintype.ofFinite M rw [commProb, ← Set.coe_setOf, Nat.card_eq_fintype_card, Nat.card_eq_fintype_card] rw [div_eq_one_iff_eq, ← Nat.cast_pow, Nat.cast_inj, sq, ← card_prod, set_fintype_card_eq_univ_iff, Set.eq_univ_iff_forall] · exact ⟨fun h ↦ ⟨fun x y ↦ h (x, y)⟩, fun h x ↦ h.comm x.1 x.2⟩ · exact pow_ne_zero 2 (Nat.cast_ne_zero.mpr card_ne_zero) variable (G : Type*) [Group G]
theorem
GroupTheory
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.GroupTheory.Abelianization.Finite", "Mathlib.GroupTheory.SpecificGroups.Dihedral", "Mathlib.Tactic.FieldSimp", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Qify" ]
Mathlib/GroupTheory/CommutingProbability.lean
commProb_eq_one_iff
null
commProb_def' : commProb G = Nat.card (ConjClasses G) / Nat.card G := by rw [commProb, card_comm_eq_card_conjClasses_mul_card, Nat.cast_mul, sq] by_cases h : (Nat.card G : ℚ) = 0 · rw [h, zero_mul, div_zero, div_zero] · exact mul_div_mul_right _ _ h variable {G} variable [Finite G] (H : Subgroup G)
theorem
GroupTheory
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.GroupTheory.Abelianization.Finite", "Mathlib.GroupTheory.SpecificGroups.Dihedral", "Mathlib.Tactic.FieldSimp", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Qify" ]
Mathlib/GroupTheory/CommutingProbability.lean
commProb_def'
null
Subgroup.commProb_subgroup_le : commProb H ≤ commProb G * (H.index : ℚ) ^ 2 := by /- After rewriting with `commProb_def`, we reduce to showing that `G` has at least as many commuting pairs as `H`. -/ rw [commProb_def, commProb_def, div_le_iff₀, mul_assoc, ← mul_pow, ← Nat.cast_mul, mul_comm H.index, H.card_mul_index, div_mul_cancel₀, Nat.cast_le] · refine Nat.card_le_card_of_injective (fun p ↦ ⟨⟨p.1.1, p.1.2⟩, Subtype.ext_iff.mp p.2⟩) ?_ exact fun p q h ↦ by simpa only [Subtype.ext_iff, Prod.ext_iff] using h · exact pow_ne_zero 2 (Nat.cast_ne_zero.mpr Finite.card_pos.ne') · exact pow_pos (Nat.cast_pos.mpr Finite.card_pos) 2
theorem
GroupTheory
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.GroupTheory.Abelianization.Finite", "Mathlib.GroupTheory.SpecificGroups.Dihedral", "Mathlib.Tactic.FieldSimp", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Qify" ]
Mathlib/GroupTheory/CommutingProbability.lean
Subgroup.commProb_subgroup_le
null
Subgroup.commProb_quotient_le [H.Normal] : commProb (G ⧸ H) ≤ commProb G * Nat.card H := by /- After rewriting with `commProb_def'`, we reduce to showing that `G` has at least as many conjugacy classes as `G ⧸ H`. -/ rw [commProb_def', commProb_def', div_le_iff₀, mul_assoc, ← Nat.cast_mul, ← Subgroup.index, H.card_mul_index, div_mul_cancel₀, Nat.cast_le] · apply Nat.card_le_card_of_surjective show Function.Surjective (ConjClasses.map (QuotientGroup.mk' H)) exact ConjClasses.map_surjective Quotient.mk''_surjective · exact Nat.cast_ne_zero.mpr Finite.card_pos.ne' · exact Nat.cast_pos.mpr Finite.card_pos variable (G)
theorem
GroupTheory
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.GroupTheory.Abelianization.Finite", "Mathlib.GroupTheory.SpecificGroups.Dihedral", "Mathlib.Tactic.FieldSimp", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Qify" ]
Mathlib/GroupTheory/CommutingProbability.lean
Subgroup.commProb_quotient_le
null
inv_card_commutator_le_commProb : (↑(Nat.card (commutator G)))⁻¹ ≤ commProb G := (inv_le_iff_one_le_mul₀ (Nat.cast_pos.mpr Finite.card_pos)).mpr (le_trans (ge_of_eq (commProb_eq_one_iff.mpr ⟨(Abelianization.commGroup G).mul_comm⟩)) (commutator G).commProb_quotient_le)
theorem
GroupTheory
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.GroupTheory.Abelianization.Finite", "Mathlib.GroupTheory.SpecificGroups.Dihedral", "Mathlib.Tactic.FieldSimp", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Qify" ]
Mathlib/GroupTheory/CommutingProbability.lean
inv_card_commutator_le_commProb
null
commProb_odd {n : ℕ} (hn : Odd n) : commProb (DihedralGroup n) = (n + 3) / (4 * n) := by rw [commProb_def', DihedralGroup.card_conjClasses_odd hn, nat_card] qify [show 2 ∣ n + 3 by rw [Nat.dvd_iff_mod_eq_zero, Nat.add_mod, Nat.odd_iff.mp hn]] rw [div_div, ← mul_assoc] congr norm_num
lemma
GroupTheory
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.GroupTheory.Abelianization.Finite", "Mathlib.GroupTheory.SpecificGroups.Dihedral", "Mathlib.Tactic.FieldSimp", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Qify" ]
Mathlib/GroupTheory/CommutingProbability.lean
commProb_odd
null
private div_two_lt {n : ℕ} (h0 : n ≠ 0) : n / 2 < n := Nat.div_lt_self (Nat.pos_of_ne_zero h0) (lt_add_one 1)
lemma
GroupTheory
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.GroupTheory.Abelianization.Finite", "Mathlib.GroupTheory.SpecificGroups.Dihedral", "Mathlib.Tactic.FieldSimp", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Qify" ]
Mathlib/GroupTheory/CommutingProbability.lean
div_two_lt
null
private div_four_lt : {n : ℕ} → (h0 : n ≠ 0) → (h1 : n ≠ 1) → n / 4 + 1 < n | 0 | 1 | 2 | 3 => by decide | n + 4 => by cutsat
lemma
GroupTheory
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.GroupTheory.Abelianization.Finite", "Mathlib.GroupTheory.SpecificGroups.Dihedral", "Mathlib.Tactic.FieldSimp", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Qify" ]
Mathlib/GroupTheory/CommutingProbability.lean
div_four_lt
null
reciprocalFactors (n : ℕ) : List ℕ := if _ : n = 0 then [0] else if _ : n = 1 then [] else if Even n then 3 :: reciprocalFactors (n / 2) else n % 4 * n :: reciprocalFactors (n / 4 + 1) @[simp] lemma reciprocalFactors_zero : reciprocalFactors 0 = [0] := by unfold reciprocalFactors; rfl @[simp] lemma reciprocalFactors_one : reciprocalFactors 1 = [] := by unfold reciprocalFactors; rfl
def
GroupTheory
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.GroupTheory.Abelianization.Finite", "Mathlib.GroupTheory.SpecificGroups.Dihedral", "Mathlib.Tactic.FieldSimp", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Qify" ]
Mathlib/GroupTheory/CommutingProbability.lean
reciprocalFactors
A list of Dihedral groups whose product will have commuting probability `1 / n`.
reciprocalFactors_even {n : ℕ} (h0 : n ≠ 0) (h2 : Even n) : reciprocalFactors n = 3 :: reciprocalFactors (n / 2) := by have h1 : n ≠ 1 := by rintro rfl norm_num at h2 rw [reciprocalFactors, dif_neg h0, dif_neg h1, if_pos h2]
lemma
GroupTheory
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.GroupTheory.Abelianization.Finite", "Mathlib.GroupTheory.SpecificGroups.Dihedral", "Mathlib.Tactic.FieldSimp", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Qify" ]
Mathlib/GroupTheory/CommutingProbability.lean
reciprocalFactors_even
null
reciprocalFactors_odd {n : ℕ} (h1 : n ≠ 1) (h2 : Odd n) : reciprocalFactors n = n % 4 * n :: reciprocalFactors (n / 4 + 1) := by have h0 : n ≠ 0 := by rintro rfl norm_num [← Nat.not_even_iff_odd] at h2 rw [reciprocalFactors, dif_neg h0, dif_neg h1, if_neg (Nat.not_even_iff_odd.2 h2)]
lemma
GroupTheory
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.GroupTheory.Abelianization.Finite", "Mathlib.GroupTheory.SpecificGroups.Dihedral", "Mathlib.Tactic.FieldSimp", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Qify" ]
Mathlib/GroupTheory/CommutingProbability.lean
reciprocalFactors_odd
null
Product (l : List ℕ) : Type := ∀ i : Fin l.length, DihedralGroup l[i]
abbrev
GroupTheory
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.GroupTheory.Abelianization.Finite", "Mathlib.GroupTheory.SpecificGroups.Dihedral", "Mathlib.Tactic.FieldSimp", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Qify" ]
Mathlib/GroupTheory/CommutingProbability.lean
Product
A finite product of Dihedral groups.
commProb_nil : commProb (Product []) = 1 := by simp [Product, commProb_pi]
lemma
GroupTheory
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.GroupTheory.Abelianization.Finite", "Mathlib.GroupTheory.SpecificGroups.Dihedral", "Mathlib.Tactic.FieldSimp", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Qify" ]
Mathlib/GroupTheory/CommutingProbability.lean
commProb_nil
null
commProb_cons (n : ℕ) (l : List ℕ) : commProb (Product (n :: l)) = commProb (DihedralGroup n) * commProb (Product l) := by simp only [commProb_pi, Fin.prod_univ_succ, Fin.getElem_fin, Fin.val_succ, Fin.val_zero, List.getElem_cons_zero, List.length_cons, List.getElem_cons_succ]
lemma
GroupTheory
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.GroupTheory.Abelianization.Finite", "Mathlib.GroupTheory.SpecificGroups.Dihedral", "Mathlib.Tactic.FieldSimp", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Qify" ]
Mathlib/GroupTheory/CommutingProbability.lean
commProb_cons
null
commProb_reciprocal (n : ℕ) : commProb (Product (reciprocalFactors n)) = 1 / n := by by_cases h0 : n = 0 · rw [h0, reciprocalFactors_zero, commProb_cons, commProb_nil, mul_one, Nat.cast_zero, div_zero] apply commProb_eq_zero_of_infinite by_cases h1 : n = 1 · rw [h1, reciprocalFactors_one, commProb_nil, Nat.cast_one, div_one] rcases Nat.even_or_odd n with h2 | h2 · have := div_two_lt h0 rw [reciprocalFactors_even h0 h2, commProb_cons, commProb_reciprocal (n / 2), commProb_odd (by decide)] simp [field, h2.two_dvd] norm_num · have := div_four_lt h0 h1 rw [reciprocalFactors_odd h1 h2, commProb_cons, commProb_reciprocal (n / 4 + 1)] have key : n % 4 = 1 ∨ n % 4 = 3 := Nat.odd_mod_four_iff.mp (Nat.odd_iff.mp h2) have hn : Odd (n % 4) := by rcases key with h | h <;> rw [h] <;> decide rw [commProb_odd (hn.mul h2), div_mul_div_comm, mul_one, div_eq_div_iff, one_mul] <;> norm_cast · have h0 : (n % 4) ^ 2 + 3 = n % 4 * 4 := by rcases key with h | h <;> rw [h] <;> norm_num have h1 := (Nat.div_add_mod n 4).symm zify at h0 h1 ⊢ linear_combination (h0 + h1 * (n % 4)) * n · have := hn.pos.ne' positivity
theorem
GroupTheory
[ "Mathlib.Algebra.BigOperators.Fin", "Mathlib.GroupTheory.Abelianization.Finite", "Mathlib.GroupTheory.SpecificGroups.Dihedral", "Mathlib.Tactic.FieldSimp", "Mathlib.Tactic.LinearCombination", "Mathlib.Tactic.Qify" ]
Mathlib/GroupTheory/CommutingProbability.lean
commProb_reciprocal
Construction of a group with commuting probability `1 / n`.
@[to_additive /-- `S` and `T` are complements if `(+) : S × T → G` is a bijection If `S` and `T` are `SetLike`s such as `AddSubgroup`s, see `isComplement_iff_bijective` for a more ergonomic way to unfold. -/] IsComplement : Prop := Function.Bijective fun x : S × T => x.1.1 * x.2.1
def
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Complement.lean
IsComplement
`S` and `T` are complements if `(*) : S × T → G` is a bijection. This notion generalizes left transversals, right transversals, and complementary subgroups. If `S` and `T` are `SetLike`s such as `Subgroup`s, see `isComplement_iff_bijective` for a more ergonomic way to unfold.
@[to_additive /-- `H` and `K` are complements if `(+) : H × K → G` is a bijection -/] IsComplement' := IsComplement (H : Set G) (K : Set G) variable {H K S T}
abbrev
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Complement.lean
IsComplement'
`H` and `K` are complements if `(*) : H × K → G` is a bijection
@[to_additive /-- The correct way to unfold `IsComplement` for `SetLike`s such as `AddSubgroup`s -/] isComplement_iff_bijective {S : Type*} [SetLike S G] (s t : S) : IsComplement (G := G) s t ↔ Function.Bijective fun x : s × t => (x.1 : G) * (x.2 : G) := Iff.rfl @[to_additive]
theorem
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Complement.lean
isComplement_iff_bijective
The correct way to unfold `IsComplement` for `SetLike`s such as `Subgroup`s
isComplement'_def : IsComplement' H K ↔ IsComplement (H : Set G) (K : Set G) := Iff.rfl @[to_additive]
theorem
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Complement.lean
isComplement'_def
null
isComplement_iff_existsUnique : IsComplement S T ↔ ∀ g : G, ∃! x : S × T, x.1.1 * x.2.1 = g := Function.bijective_iff_existsUnique _ @[to_additive]
theorem
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Complement.lean
isComplement_iff_existsUnique
null
IsComplement.existsUnique (h : IsComplement S T) (g : G) : ∃! x : S × T, x.1.1 * x.2.1 = g := isComplement_iff_existsUnique.mp h g @[to_additive]
theorem
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Complement.lean
IsComplement.existsUnique
null
IsComplement'.symm (h : IsComplement' H K) : IsComplement' K H := by let ϕ : H × K ≃ K × H := Equiv.mk (fun x => ⟨x.2⁻¹, x.1⁻¹⟩) (fun x => ⟨x.2⁻¹, x.1⁻¹⟩) (fun x => Prod.ext (inv_inv _) (inv_inv _)) fun x => Prod.ext (inv_inv _) (inv_inv _) let ψ : G ≃ G := Equiv.mk (fun g : G => g⁻¹) (fun g : G => g⁻¹) inv_inv inv_inv suffices hf : (ψ ∘ fun x : H × K => x.1.1 * x.2.1) = (fun x : K × H => x.1.1 * x.2.1) ∘ ϕ by rwa [isComplement'_def, isComplement_iff_bijective, ← Equiv.bijective_comp ϕ, ← hf, ψ.comp_bijective] exact funext fun x => mul_inv_rev _ _ @[to_additive]
theorem
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Complement.lean
IsComplement'.symm
null
isComplement'_comm : IsComplement' H K ↔ IsComplement' K H := ⟨IsComplement'.symm, IsComplement'.symm⟩ @[to_additive]
theorem
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Complement.lean
isComplement'_comm
null
isComplement_univ_singleton {g : G} : IsComplement (univ : Set G) {g} := ⟨fun ⟨_, _, rfl⟩ ⟨_, _, rfl⟩ h => Prod.ext (Subtype.ext (mul_right_cancel h)) rfl, fun x => ⟨⟨⟨x * g⁻¹, ⟨⟩⟩, g, rfl⟩, inv_mul_cancel_right x g⟩⟩ @[to_additive]
theorem
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Complement.lean
isComplement_univ_singleton
null
isComplement_singleton_univ {g : G} : IsComplement ({g} : Set G) univ := ⟨fun ⟨⟨_, rfl⟩, _⟩ ⟨⟨_, rfl⟩, _⟩ h => Prod.ext rfl (Subtype.ext (mul_left_cancel h)), fun x => ⟨⟨⟨g, rfl⟩, g⁻¹ * x, ⟨⟩⟩, mul_inv_cancel_left g x⟩⟩ @[to_additive]
theorem
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Complement.lean
isComplement_singleton_univ
null
isComplement_singleton_left {g : G} : IsComplement {g} S ↔ S = univ := by refine ⟨fun h => top_le_iff.mp fun x _ => ?_, fun h => (congr_arg _ h).mpr isComplement_singleton_univ⟩ obtain ⟨⟨⟨z, rfl : z = g⟩, y, _⟩, hy⟩ := h.2 (g * x) rwa [← mul_left_cancel hy] @[to_additive]
theorem
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Complement.lean
isComplement_singleton_left
null
isComplement_singleton_right {g : G} : IsComplement S {g} ↔ S = univ := by refine ⟨fun h => top_le_iff.mp fun x _ => ?_, fun h => h ▸ isComplement_univ_singleton⟩ obtain ⟨y, hy⟩ := h.2 (x * g) conv_rhs at hy => rw [← show y.2.1 = g from y.2.2] rw [← mul_right_cancel hy] exact y.1.2 @[to_additive]
theorem
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Complement.lean
isComplement_singleton_right
null
isComplement_univ_left : IsComplement univ S ↔ ∃ g : G, S = {g} := by refine ⟨fun h => Set.exists_eq_singleton_iff_nonempty_subsingleton.mpr ⟨?_, fun a ha b hb => ?_⟩, ?_⟩ · obtain ⟨a, _⟩ := h.2 1 exact ⟨a.2.1, a.2.2⟩ · have : (⟨⟨_, mem_top a⁻¹⟩, ⟨a, ha⟩⟩ : (⊤ : Set G) × S) = ⟨⟨_, mem_top b⁻¹⟩, ⟨b, hb⟩⟩ := h.1 ((inv_mul_cancel a).trans (inv_mul_cancel b).symm) exact Subtype.ext_iff.mp (Prod.ext_iff.mp this).2 · rintro ⟨g, rfl⟩ exact isComplement_univ_singleton @[to_additive]
theorem
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Complement.lean
isComplement_univ_left
null
isComplement_univ_right : IsComplement S univ ↔ ∃ g : G, S = {g} := by refine ⟨fun h => Set.exists_eq_singleton_iff_nonempty_subsingleton.mpr ⟨?_, fun a ha b hb => ?_⟩, ?_⟩ · obtain ⟨a, _⟩ := h.2 1 exact ⟨a.1.1, a.1.2⟩ · have : (⟨⟨a, ha⟩, ⟨_, mem_top a⁻¹⟩⟩ : S × (⊤ : Set G)) = ⟨⟨b, hb⟩, ⟨_, mem_top b⁻¹⟩⟩ := h.1 ((mul_inv_cancel a).trans (mul_inv_cancel b).symm) exact Subtype.ext_iff.mp (Prod.ext_iff.mp this).1 · rintro ⟨g, rfl⟩ exact isComplement_singleton_univ @[to_additive]
theorem
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Complement.lean
isComplement_univ_right
null
IsComplement.mul_eq (h : IsComplement S T) : S * T = univ := eq_univ_of_forall fun x ↦ by simpa [mem_mul] using (h.existsUnique x).exists @[to_additive (attr := simp)]
lemma
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Complement.lean
IsComplement.mul_eq
null
not_isComplement_empty_left : ¬ IsComplement ∅ T := fun h ↦ by simpa [eq_comm (a := ∅)] using h.mul_eq @[to_additive (attr := simp)]
lemma
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Complement.lean
not_isComplement_empty_left
null
not_isComplement_empty_right : ¬ IsComplement S ∅ := fun h ↦ by simpa [eq_comm (a := ∅)] using h.mul_eq @[to_additive]
lemma
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Complement.lean
not_isComplement_empty_right
null
IsComplement.nonempty_left (hst : IsComplement S T) : S.Nonempty := by contrapose! hst; simp [hst] @[to_additive]
lemma
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Complement.lean
IsComplement.nonempty_left
null
IsComplement.nonempty_right (hst : IsComplement S T) : T.Nonempty := by contrapose! hst; simp [hst] @[to_additive] lemma IsComplement.pairwiseDisjoint_smul (hst : IsComplement S T) : S.PairwiseDisjoint (· • T) := fun a ha b hb hab ↦ disjoint_iff_forall_ne.2 <| by rintro _ ⟨c, hc, rfl⟩ _ ⟨d, hd, rfl⟩ exact hst.1.ne (a₁ := (⟨a, ha⟩, ⟨c, hc⟩)) (a₂:= (⟨b, hb⟩, ⟨d, hd⟩)) (by simp [hab]) @[to_additive AddSubgroup.IsComplement.card_mul_card]
lemma
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Complement.lean
IsComplement.nonempty_right
null
IsComplement.card_mul_card (h : IsComplement S T) : Nat.card S * Nat.card T = Nat.card G := (Nat.card_prod _ _).symm.trans <| Nat.card_congr <| Equiv.ofBijective _ h @[to_additive]
lemma
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Complement.lean
IsComplement.card_mul_card
null
isComplement'_top_bot : IsComplement' (⊤ : Subgroup G) ⊥ := isComplement_univ_singleton @[to_additive]
theorem
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Complement.lean
isComplement'_top_bot
null
isComplement'_bot_top : IsComplement' (⊥ : Subgroup G) ⊤ := isComplement_singleton_univ @[to_additive (attr := simp)]
theorem
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Complement.lean
isComplement'_bot_top
null
isComplement'_bot_left : IsComplement' ⊥ H ↔ H = ⊤ := isComplement_singleton_left.trans coe_eq_univ @[to_additive (attr := simp)]
theorem
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Complement.lean
isComplement'_bot_left
null
isComplement'_bot_right : IsComplement' H ⊥ ↔ H = ⊤ := isComplement_singleton_right.trans coe_eq_univ @[to_additive (attr := simp)]
theorem
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Complement.lean
isComplement'_bot_right
null
isComplement'_top_left : IsComplement' ⊤ H ↔ H = ⊥ := isComplement_univ_left.trans coe_eq_singleton @[to_additive (attr := simp)]
theorem
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Complement.lean
isComplement'_top_left
null
isComplement'_top_right : IsComplement' H ⊤ ↔ H = ⊥ := isComplement_univ_right.trans coe_eq_singleton @[to_additive]
theorem
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Complement.lean
isComplement'_top_right
null
isComplement_iff_existsUnique_inv_mul_mem : IsComplement S T ↔ ∀ g, ∃! s : S, (s : G)⁻¹ * g ∈ T := by convert isComplement_iff_existsUnique with g constructor <;> rintro ⟨x, hx, hx'⟩ · exact ⟨(x, ⟨_, hx⟩), by simp, by aesop⟩ · exact ⟨x.1, by simp [← hx], fun y hy ↦ (Prod.ext_iff.1 <| by simpa using hx' (y, ⟨_, hy⟩)).1⟩ @[to_additive]
lemma
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Complement.lean
isComplement_iff_existsUnique_inv_mul_mem
null
isComplement_iff_existsUnique_mul_inv_mem : IsComplement S T ↔ ∀ g, ∃! t : T, g * (t : G)⁻¹ ∈ S := by convert isComplement_iff_existsUnique with g constructor <;> rintro ⟨x, hx, hx'⟩ · exact ⟨(⟨_, hx⟩, x), by simp, by aesop⟩ · exact ⟨x.2, by simp [← hx], fun y hy ↦ (Prod.ext_iff.1 <| by simpa using hx' (⟨_, hy⟩, y)).2⟩ @[to_additive]
lemma
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Complement.lean
isComplement_iff_existsUnique_mul_inv_mem
null
isComplement_subgroup_right_iff_existsUnique_quotientGroupMk : IsComplement S H ↔ ∀ q : G ⧸ H, ∃! s : S, QuotientGroup.mk s.1 = q := by simp_rw [isComplement_iff_existsUnique_inv_mul_mem, SetLike.mem_coe, ← QuotientGroup.eq, QuotientGroup.forall_mk] set_option linter.docPrime false in @[to_additive]
lemma
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Complement.lean
isComplement_subgroup_right_iff_existsUnique_quotientGroupMk
null
isComplement_subgroup_left_iff_existsUnique_quotientMk'' : IsComplement H T ↔ ∀ q : Quotient (QuotientGroup.rightRel H), ∃! t : T, Quotient.mk'' t.1 = q := by simp_rw [isComplement_iff_existsUnique_mul_inv_mem, SetLike.mem_coe, ← QuotientGroup.rightRel_apply, ← Quotient.eq'', Quotient.forall] @[to_additive]
lemma
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Complement.lean
isComplement_subgroup_left_iff_existsUnique_quotientMk''
null
isComplement_subgroup_right_iff_bijective : IsComplement S H ↔ Bijective (S.restrict (QuotientGroup.mk : G → G ⧸ H)) := isComplement_subgroup_right_iff_existsUnique_quotientGroupMk.trans (bijective_iff_existsUnique (S.restrict QuotientGroup.mk)).symm @[to_additive]
lemma
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Complement.lean
isComplement_subgroup_right_iff_bijective
null
isComplement_subgroup_left_iff_bijective : IsComplement H T ↔ Bijective (T.restrict (Quotient.mk'' : G → Quotient (QuotientGroup.rightRel H))) := isComplement_subgroup_left_iff_existsUnique_quotientMk''.trans (bijective_iff_existsUnique (T.restrict Quotient.mk'')).symm @[to_additive]
lemma
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Complement.lean
isComplement_subgroup_left_iff_bijective
null
IsComplement.card_left (h : IsComplement S H) : Nat.card S = H.index := Nat.card_congr <| .ofBijective _ <| isComplement_subgroup_right_iff_bijective.mp h @[to_additive]
lemma
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Complement.lean
IsComplement.card_left
null
IsComplement.ncard_left (h : IsComplement S H) : S.ncard = H.index := by rw [← Nat.card_coe_set_eq, h.card_left] @[to_additive]
theorem
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Complement.lean
IsComplement.ncard_left
null
IsComplement.card_right (h : IsComplement H T) : Nat.card T = H.index := Nat.card_congr <| (Equiv.ofBijective _ <| isComplement_subgroup_left_iff_bijective.mp h).trans <| QuotientGroup.quotientRightRelEquivQuotientLeftRel H @[to_additive]
lemma
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Complement.lean
IsComplement.card_right
null
IsComplement.ncard_right (h : IsComplement H T) : T.ncard = H.index := by rw [← Nat.card_coe_set_eq, h.card_right] @[to_additive]
theorem
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Complement.lean
IsComplement.ncard_right
null
isComplement_range_left {f : G ⧸ H → G} (hf : ∀ q, ↑(f q) = q) : IsComplement (range f) H := by rw [isComplement_subgroup_right_iff_bijective] refine ⟨?_, fun q ↦ ⟨⟨f q, q, rfl⟩, hf q⟩⟩ rintro ⟨-, q₁, rfl⟩ ⟨-, q₂, rfl⟩ h exact Subtype.ext <| congr_arg f <| ((hf q₁).symm.trans h).trans (hf q₂) @[to_additive]
lemma
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Complement.lean
isComplement_range_left
null
isComplement_range_right {f : Quotient (QuotientGroup.rightRel H) → G} (hf : ∀ q, Quotient.mk'' (f q) = q) : IsComplement H (range f) := by rw [isComplement_subgroup_left_iff_bijective] refine ⟨?_, fun q ↦ ⟨⟨f q, q, rfl⟩, hf q⟩⟩ rintro ⟨-, q₁, rfl⟩ ⟨-, q₂, rfl⟩ h exact Subtype.ext <| congr_arg f <| ((hf q₁).symm.trans h).trans (hf q₂) @[to_additive]
lemma
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Complement.lean
isComplement_range_right
null
exists_isComplement_left (H : Subgroup G) (g : G) : ∃ S, IsComplement S H ∧ g ∈ S := by classical refine ⟨Set.range (Function.update Quotient.out _ g), isComplement_range_left fun q ↦ ?_, QuotientGroup.mk g, Function.update_self (Quotient.mk'' g) g Quotient.out⟩ by_cases hq : q = Quotient.mk'' g · exact hq.symm ▸ congr_arg _ (Function.update_self (Quotient.mk'' g) g Quotient.out) · refine Function.update_of_ne ?_ g Quotient.out ▸ q.out_eq' exact hq @[to_additive]
lemma
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Complement.lean
exists_isComplement_left
null
exists_isComplement_right (H : Subgroup G) (g : G) : ∃ T, IsComplement H T ∧ g ∈ T := by classical refine ⟨Set.range (Function.update Quotient.out _ g), isComplement_range_right fun q ↦ ?_, Quotient.mk'' g, Function.update_self (Quotient.mk'' g) g Quotient.out⟩ by_cases hq : q = Quotient.mk'' g · exact hq.symm ▸ congr_arg _ (Function.update_self (Quotient.mk'' g) g Quotient.out) · refine Function.update_of_ne ?_ g Quotient.out ▸ q.out_eq' exact hq
lemma
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Complement.lean
exists_isComplement_right
null
@[to_additive /-- Given two subgroups `H' ⊆ H`, there exists a transversal to `H'` inside `H` -/] exists_left_transversal_of_le {H' H : Subgroup G} (h : H' ≤ H) : ∃ S : Set G, S * H' = H ∧ Nat.card S * Nat.card H' = Nat.card H := by let H'' : Subgroup H := H'.comap H.subtype have : H' = H''.map H.subtype := by simp [H'', h] rw [this] obtain ⟨S, cmem, -⟩ := H''.exists_isComplement_left 1 refine ⟨H.subtype '' S, ?_, ?_⟩ · have : H.subtype '' (S * H'') = H.subtype '' S * H''.map H.subtype := image_mul H.subtype rw [← this, cmem.mul_eq] simp · rw [← cmem.card_mul_card] refine congr_arg₂ (· * ·) ?_ ?_ <;> exact Nat.card_congr (Equiv.Set.image _ _ <| subtype_injective H).symm
lemma
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Complement.lean
exists_left_transversal_of_le
Given two subgroups `H' ⊆ H`, there exists a left transversal to `H'` inside `H`.
@[to_additive /-- Given two subgroups `H' ⊆ H`, there exists a transversal to `H'` inside `H` -/] exists_right_transversal_of_le {H' H : Subgroup G} (h : H' ≤ H) : ∃ S : Set G, H' * S = H ∧ Nat.card H' * Nat.card S = Nat.card H := by let H'' : Subgroup H := H'.comap H.subtype have : H' = H''.map H.subtype := by simp [H'', h] rw [this] obtain ⟨S, cmem, -⟩ := H''.exists_isComplement_right 1 refine ⟨H.subtype '' S, ?_, ?_⟩ · have : H.subtype '' (H'' * S) = H''.map H.subtype * H.subtype '' S := image_mul H.subtype rw [← this, cmem.mul_eq] simp · have : Nat.card H'' * Nat.card S = Nat.card H := cmem.card_mul_card rw [← this] refine congr_arg₂ (· * ·) ?_ ?_ <;> exact Nat.card_congr (Equiv.Set.image _ _ <| subtype_injective H).symm
lemma
GroupTheory
[ "Mathlib.GroupTheory.Index" ]
Mathlib/GroupTheory/Complement.lean
exists_right_transversal_of_le
Given two subgroups `H' ⊆ H`, there exists a right transversal to `H'` inside `H`.