File: Mathlib/GroupTheory/CommutingProbability.lean

full_name: commProb
code: /-- The commuting probability of a finite type with a multiplication operation. -/
def commProb : ℚ 
goal: ℚ

full_name: commProb_def
code: theorem commProb_def :
    commProb M = Nat.card { p : M × M // Commute p.1 p.2 } / (Nat.card M : ℚ) ^ 2 
goal: commProb M = ↑(Nat.card { p // Commute p.1 p.2 }) / ↑(Nat.card M) ^ 2

full_name: commProb_prod
code: theorem commProb_prod (M' : Type*) [Mul M'] : commProb (M × M') = commProb M * commProb M' 
goal: commProb (M × M') = commProb M * commProb M'

full_name: commProb_pi
code: theorem commProb_pi {α : Type*} (i : α → Type*) [Fintype α] [∀ a, Mul (i a)] :
    commProb (∀ a, i a) = ∏ a, commProb (i a) 
goal: commProb ((a : α) → i a) = ∏ a : α, commProb (i a)

full_name: commProb_function
code: theorem commProb_function {α β : Type*} [Fintype α] [Mul β] :
    commProb (α → β) = (commProb β) ^ Fintype.card α 
goal: commProb (α → β) = commProb β ^ Fintype.card α

full_name: commProb_eq_zero_of_infinite
code: @[simp]
theorem commProb_eq_zero_of_infinite [Infinite M] : commProb M = 0 
goal: commProb M = 0

full_name: commProb_pos
code: theorem commProb_pos [h : Nonempty M] : 0 < commProb M 
goal: 0 < commProb M

full_name: commProb_le_one
code: theorem commProb_le_one : commProb M ≤ 1 
goal: commProb M ≤ 1

full_name: commProb_eq_one_iff
code: theorem commProb_eq_one_iff [h : Nonempty M] :
    commProb M = 1 ↔ Commutative ((· * ·) : M → M → M) 
goal: commProb M = 1 ↔ Commutative fun x x_1 => x * x_1

full_name: commProb_def'
code: theorem commProb_def' : commProb G = Nat.card (ConjClasses G) / Nat.card G 
goal: commProb G = ↑(Nat.card (ConjClasses G)) / ↑(Nat.card G)

full_name: Subgroup.commProb_subgroup_le
code: theorem Subgroup.commProb_subgroup_le : commProb H ≤ commProb G * (H.index : ℚ) ^ 2 
goal: commProb ↥H ≤ commProb G * ↑H.index ^ 2

full_name: Subgroup.commProb_quotient_le
code: theorem Subgroup.commProb_quotient_le [H.Normal] : commProb (G ⧸ H) ≤ commProb G * Nat.card H 
goal: commProb (G ⧸ H) ≤ commProb G * ↑(Nat.card ↥H)

full_name: inv_card_commutator_le_commProb
code: theorem inv_card_commutator_le_commProb : (↑(Nat.card (commutator G)))⁻¹ ≤ commProb G 
goal: (↑(Nat.card ↥(commutator G)))⁻¹ ≤ commProb G

full_name: DihedralGroup.commProb_odd
code: lemma commProb_odd {n : ℕ} (hn : Odd n) :
    commProb (DihedralGroup n) = (n + 3) / (4 * n) 
goal: commProb (DihedralGroup n) = (↑n + 3) / (4 * ↑n)

full_name: _private.Mathlib.GroupTheory.CommutingProbability.0.DihedralGroup.div_two_lt
code: private lemma div_two_lt {n : ℕ} (h0 : n ≠ 0) : n / 2 < n 
goal: n / 2 < n

full_name: _private.Mathlib.GroupTheory.CommutingProbability.0.DihedralGroup.div_four_lt
code: private lemma div_four_lt : {n : ℕ} → (h0 : n ≠ 0) → (h1 : n ≠ 1) → n / 4 + 1 < n
  
goal: n / 4 + 1 < n

full_name: DihedralGroup.reciprocalFactors
code: /-- A list of Dihedral groups whose product will have commuting probability `1 / n`. -/
def reciprocalFactors (n : ℕ) : List ℕ 
goal: List ℕ

full_name: DihedralGroup.reciprocalFactors_zero
code: @[simp] lemma reciprocalFactors_zero : reciprocalFactors 0 = [0] 
goal: DihedralGroup.reciprocalFactors 0 = [0]

full_name: DihedralGroup.reciprocalFactors_one
code: @[simp] lemma reciprocalFactors_one : reciprocalFactors 1 = [] 
goal: DihedralGroup.reciprocalFactors 1 = []

full_name: DihedralGroup.reciprocalFactors_even
code: lemma reciprocalFactors_even {n : ℕ} (h0 : n ≠ 0) (h2 : Even n) :
    reciprocalFactors n = 3 :: reciprocalFactors (n / 2) 
goal: DihedralGroup.reciprocalFactors n = 3 :: DihedralGroup.reciprocalFactors (n / 2)

full_name: DihedralGroup.reciprocalFactors_odd
code: lemma reciprocalFactors_odd {n : ℕ} (h1 : n ≠ 1) (h2 : Odd n) :
    reciprocalFactors n = n % 4 * n :: reciprocalFactors (n / 4 + 1) 
goal: DihedralGroup.reciprocalFactors n = n % 4 * n :: DihedralGroup.reciprocalFactors (n / 4 + 1)

full_name: DihedralGroup.Product
code: /-- A finite product of Dihedral groups. -/
abbrev Product (l : List ℕ) : Type 
goal: Type

full_name: DihedralGroup.commProb_nil
code: lemma commProb_nil : commProb (Product []) = 1 
goal: commProb (DihedralGroup.Product []) = 1

full_name: DihedralGroup.commProb_cons
code: lemma commProb_cons (n : ℕ) (l : List ℕ) :
    commProb (Product (n :: l)) = commProb (DihedralGroup n) * commProb (Product l) 
goal: commProb (DihedralGroup.Product (n :: l)) = commProb (DihedralGroup n) * commProb (DihedralGroup.Product l)

full_name: DihedralGroup.commProb_reciprocal
code: /-- Construction of a group with commuting probability `1 / n`. -/
theorem commProb_reciprocal (n : ℕ) :
    commProb (Product (reciprocalFactors n)) = 1 / n 
goal: commProb (DihedralGroup.Product (DihedralGroup.reciprocalFactors n)) = 1 / ↑n