permutation_order_renyi_entropy_two
For every real q ≠ 1, the order-q Rényi entropy permutation_order_renyi_entropy q 2 of the permutation order distribution on S_2 equals Real.log 2.
Statement
theorem permutation_order_renyi_entropy_two (q : ℝ) (hq : q ≠ 1) : permutation_order_renyi_entropy q 2 = Real.log 2- Source
- arXiv:2605.15063
- Verified
- 29 Nov 2026
- Axioms
Classical.choiceQuot.soundpropext- Built on 3
- permutation_order_renyi_entropyFor a real parameter q and natural number n, permutation_order_renyi_entropy q n is the order-q Rényi entropy of the permutation order…
- permutation_order_probFor natural numbers n and m, permutation_order_prob n m is the real probability that a uniformly random permutation in S_n has order m,…
- permutation_ordersFor any natural number n, permutation_orders n is the finite set of distinct orders of permutations in the symmetric group S_n.
Read back from the Lean
For every real number $q$ such that $q \neq 1$, the permutation order Rényi entropy permutation_order_renyi_entropy q 2 is equal to $\ln 2$.
Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.
The proof, explained
The symmetric group S_2 contains only two permutations: the identity (order 1) and the transposition (0 1) (order 2), each occurring with probability 1/2. Thus the distribution of permutation orders is uniform on {1, 2}, and the sum in the definition of order-q Rényi entropy is (1/2)^q + (1/2)^q = 2 * (1/2)^q. Standard logarithm properties simplify log(2 * (1/2)^q) to (1 - q) * log 2, and canceling the non-zero denominator 1 - q leaves log 2 for any q ≠ 1.
The symmetric group S_2 consists precisely of the identity and the transposition (0 1)
The identity and the transposition (0 1) are distinct permutations because evaluating them at 0 gives 0 and 1, respectively (lines 3–6). Since S_2 has order 2! = 2 by Fintype.card_perm, the pair {1, (0 1)} has size 2 by Finset.card_pair, and therefore equals the entire universe of permutations by Finset.eq_univ_of_card (lines 7–10).
uses
Fintype.card_perm,Finset.card_pair,Finset.eq_univ_of_cardhave hne : (1 : Equiv.Perm (Fin 2)) ≠ Equiv.swap 0 1 := by intro h have h2 : (1 : Equiv.Perm (Fin 2)) 0 = (Equiv.swap (0 : Fin 2) 1) 0 := by rw [h] simp at h2 have hcard : Fintype.card (Equiv.Perm (Fin 2)) = 2 := by simp [Fintype.card_perm] symm apply Finset.eq_univ_of_card rw [Finset.card_pair hne, hcard]
The transposition (0 1) in S_2 has order 2
The swap is not the identity since it maps 0 to 1 (lines 14–17). Its square is the identity by sq and Equiv.swap_mul_self (lines 18–19). Because 2 is prime (Nat.prime_two), any non-identity element squaring to 1 has order 2 by orderOf_eq_prime (lines 20–21).
uses
sq,Equiv.swap_mul_self,Nat.prime_two,orderOf_eq_primehave hne : Equiv.swap (0 : Fin 2) 1 ≠ 1 := by intro h have h' : (Equiv.swap (0 : Fin 2) 1) 0 = (1 : Equiv.Perm (Fin 2)) 0 := by rw [h] simp at h' have hsq : (Equiv.swap (0 : Fin 2) 1) ^ 2 = 1 := by rw [sq, Equiv.swap_mul_self] have : Fact (Nat.Prime 2) := ⟨Nat.prime_two⟩ exact orderOf_eq_prime hsq hne
The set of permutation orders occurring in S_2 is {1, 2}
Unfolding permutation_orders and replacing the universe of permutations with {1, (0 1)} via permutation_order_renyi_entropy_two_univ, the possible orders are the image under orderOf. Evaluating at the identity gives 1 by orderOf_one and at the swap gives 2 by permutation_order_renyi_entropy_two_orderOf_swap, yielding the set {1, 2}.
uses
permutation_order_renyi_entropy_two_univ,orderOf_one,permutation_order_renyi_entropy_two_orderOf_swapunfold permutation_orders rw [permutation_order_renyi_entropy_two_univ] simp [orderOf_one, permutation_order_renyi_entropy_two_orderOf_swap]
The probability that a uniformly chosen permutation in S_2 has order 1 is 1/2
Unfolding permutation_order_prob and rewriting the universe as {1, (0 1)} using permutation_order_renyi_entropy_two_univ, the probability is the number of elements of order 1 divided by 2!. In {1, (0 1)}, only the identity has order 1 (orderOf_one, Or.inl), while the swap has order 2 (permutation_order_renyi_entropy_two_orderOf_swap). Hence the fiber is {1}, having cardinality 1, which gives probability 1 / 2! = 1/2.
uses
permutation_order_renyi_entropy_two_univ,permutation_order_renyi_entropy_two_orderOf_swap,orderOf_one,Or.inlunfold permutation_order_prob rw [permutation_order_renyi_entropy_two_univ] have hfilt : (Finset.filter (fun σ : Equiv.Perm (Fin 2) => orderOf σ = 1) {1, Equiv.swap 0 1}) = {1} := by ext x simp only [Finset.mem_filter, Finset.mem_insert, Finset.mem_singleton] constructor · rintro ⟨(rfl | rfl), ho⟩ · rfl · rw [permutation_order_renyi_entropy_two_orderOf_swap] at ho; norm_num at ho · rintro rfl exact ⟨Or.inl rfl, orderOf_one⟩ rw [hfilt] simp
The probability that a uniformly chosen permutation in S_2 has order 2 is 1/2
Unfolding permutation_order_prob and rewriting the universe as {1, (0 1)} via permutation_order_renyi_entropy_two_univ, the probability is the count of elements of order 2 divided by 2!. The identity has order 1 (orderOf_one), leaving only the transposition (0 1) with order 2 (permutation_order_renyi_entropy_two_orderOf_swap, Or.inr). The fiber is therefore {(0 1)}, of cardinality 1, yielding probability 1 / 2! = 1/2.
uses
permutation_order_renyi_entropy_two_univ,orderOf_one,Or.inr,permutation_order_renyi_entropy_two_orderOf_swapunfold permutation_order_prob rw [permutation_order_renyi_entropy_two_univ] have hfilt : (Finset.filter (fun σ : Equiv.Perm (Fin 2) => orderOf σ = 2) {1, Equiv.swap 0 1}) = {Equiv.swap 0 1} := by ext x simp only [Finset.mem_filter, Finset.mem_insert, Finset.mem_singleton] constructor · rintro ⟨(rfl | rfl), ho⟩ · rw [orderOf_one] at ho; norm_num at ho · rfl · rintro rfl exact ⟨Or.inr rfl, permutation_order_renyi_entropy_two_orderOf_swap⟩ rw [hfilt] simp
The order-q Rényi entropy expression reduces to log((1/2)^q + (1/2)^q) / (1 - q)
Unfolding permutation_order_renyi_entropy and rewriting the set of orders to {1, 2} using permutation_order_renyi_entropy_two_orders, we expand the sum over {1, 2} using Finset.sum_insert and Finset.sum_singleton. Substituting the probabilities p(1) = 1/2 and p(2) = 1/2 via permutation_order_renyi_entropy_two_prob_one and permutation_order_renyi_entropy_two_prob_two simplifies the sum to (1/2)^q + (1/2)^q.
uses
permutation_order_renyi_entropy_two_orders,Finset.sum_insert,Finset.sum_singleton,permutation_order_renyi_entropy_two_prob_one,permutation_order_renyi_entropy_two_prob_twounfold permutation_order_renyi_entropy rw [permutation_order_renyi_entropy_two_orders] have hne : (1 : ℕ) ∉ ({2} : Finset ℕ) := by simp rw [Finset.sum_insert hne, Finset.sum_singleton] rw [permutation_order_renyi_entropy_two_prob_one, permutation_order_renyi_entropy_two_prob_two]
The numerator log((1/2)^q + (1/2)^q) simplifies to log 2 - q * log 2
Combining the two identical terms gives 2 * (1/2)^q. Since 2 ≠ 0 and (1/2)^q ≠ 0 (by positivity as 1/2 > 0), Real.log_mul splits the logarithm into log 2 + log((1/2)^q). The power rule Real.log_rpow rewrites log((1/2)^q) as q * log(1/2). Finally, because 1/2 = 2⁻¹ by one_div, Real.log_inv evaluates log(1/2) as -log 2, yielding log 2 + q * (-log 2).
uses
Real.log_mul,Real.log_rpow,one_div,Real.log_invhave hpos : (0 : ℝ) < 1 / 2 := by norm_num have hne1 : (2 : ℝ) ≠ 0 := by norm_num have hne2 : ((1 / 2 : ℝ) ^ q) ≠ 0 := by positivity have hsum : (1 / 2 : ℝ) ^ q + (1 / 2 : ℝ) ^ q = 2 * (1 / 2 : ℝ) ^ q := by ring rw [hsum] rw [Real.log_mul hne1 hne2] rw [Real.log_rpow hpos] have hlog_half : Real.log (1 / 2 : ℝ) = - Real.log 2 := by rw [one_div, Real.log_inv] rw [hlog_half]
Canceling the factor 1 - q proves the Rényi entropy equals log 2
Because q ≠ 1, linear arithmetic establishes 1 - q ≠ 0. Factoring the numerator as (1 - q) * log 2 by ring arithmetic, the non-zero factor 1 - q cancels against the denominator via mul_div_cancel_left₀, leaving log 2.
uses
mul_div_cancel_left₀have hsub : 1 - q ≠ 0 := by intro h apply hq linarith have hring : Real.log 2 + q * -Real.log 2 = (1 - q) * Real.log 2 := by ring rw [hring] exact mul_div_cancel_left₀ (Real.log 2) hsub
Fintype.card_perm- The cardinality of the permutation group of a finite type α is (|α|)!
Finset.card_pair- If two elements a and b are distinct, the set {a, b} has cardinality 2
Finset.eq_univ_of_card- A finset in a finite type whose cardinality equals that of the entire type is the universal finset
sq- In any monoid, the square of an element equals the element multiplied by itself: a ^ 2 = a * a
Equiv.swap_mul_self- Applying a transposition twice is the identity: (i j) * (i j) = 1
Nat.prime_two- The natural number 2 is prime
orderOf_eq_prime- If p is prime, x ^ p = 1, and x ≠ 1, then the order of x is p
permutation_order_renyi_entropy_two_univ- The universal set of permutations of {0, 1} equals {1, (0 1)}
orderOf_one- The identity element of any monoid has order 1
permutation_order_renyi_entropy_two_orderOf_swap- The transposition (0 1) in S_2 has order 2
Or.inl- From a proof of A, deduce A ∨ B
Or.inr- From a proof of B, deduce A ∨ B
permutation_order_renyi_entropy_two_orders- The set of orders of permutations in S_2 is {1, 2}
Finset.sum_insert- If a ∉ s, then the sum over insert a s equals f(a) plus the sum over s
Finset.sum_singleton- The sum of a function over a singleton set {a} is f(a)
permutation_order_renyi_entropy_two_prob_one- The probability that a uniformly chosen permutation in S_2 has order 1 is 1/2
permutation_order_renyi_entropy_two_prob_two- The probability that a uniformly chosen permutation in S_2 has order 2 is 1/2
Real.log_mul- For non-zero real numbers x and y, log(x * y) = log x + log y
Real.log_rpow- For positive real x and real y, log(x ^ y) = y * log x
one_div- In any division monoid, 1 / a = a⁻¹
Real.log_inv- For any real number x, log(x⁻¹) = -log x
mul_div_cancel_left₀- In an algebraic structure with zero, if a ≠ 0 then (a * b) / a = b
Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.
Lean source view module on GitHub
Choose a tactic — a marked line — to see the goals Lean had before and after it, as in Lean’s infoview. Step with ← → or j k.
lemma permutation_order_renyi_entropy_two_univ : (Finset.univ : Finset (Equiv.Perm (Fin 2))) = {1, Equiv.swap 0 1} := by have hne : (1 : Equiv.Perm (Fin 2)) ≠ Equiv.swap 0 1 := by intro h have h2 : (1 : Equiv.Perm (Fin 2)) 0 = (Equiv.swap (0 : Fin 2) 1) 0 := by rw [h] simp at h2 have hcard : Fintype.card (Equiv.Perm (Fin 2)) = 2 := by simp [Fintype.card_perm] symm apply Finset.eq_univ_of_card rw [Finset.card_pair hne, hcard]lemma permutation_order_renyi_entropy_two_orderOf_swap : orderOf (Equiv.swap (0 : Fin 2) 1) = 2 := by have hne : Equiv.swap (0 : Fin 2) 1 ≠ 1 := by intro h have h' : (Equiv.swap (0 : Fin 2) 1) 0 = (1 : Equiv.Perm (Fin 2)) 0 := by rw [h] simp at h' have hsq : (Equiv.swap (0 : Fin 2) 1) ^ 2 = 1 := by rw [sq, Equiv.swap_mul_self] have : Fact (Nat.Prime 2) := ⟨Nat.prime_two⟩ exact orderOf_eq_prime hsq hnelemma permutation_order_renyi_entropy_two_orders : permutation_orders 2 = {1, 2} := by unfold permutation_orders rw [permutation_order_renyi_entropy_two_univ] simp [orderOf_one, permutation_order_renyi_entropy_two_orderOf_swap]lemma permutation_order_renyi_entropy_two_prob_one : permutation_order_prob 2 1 = 1 / 2 := by unfold permutation_order_prob rw [permutation_order_renyi_entropy_two_univ] have hfilt : (Finset.filter (fun σ : Equiv.Perm (Fin 2) => orderOf σ = 1) {1, Equiv.swap 0 1}) = {1} := by ext x simp only [Finset.mem_filter, Finset.mem_insert, Finset.mem_singleton] constructor · rintro ⟨(rfl | rfl), ho⟩ · rfl · rw [permutation_order_renyi_entropy_two_orderOf_swap] at ho; norm_num at ho · rintro rfl exact ⟨Or.inl rfl, orderOf_one⟩ rw [hfilt] simplemma permutation_order_renyi_entropy_two_prob_two : permutation_order_prob 2 2 = 1 / 2 := by unfold permutation_order_prob rw [permutation_order_renyi_entropy_two_univ] have hfilt : (Finset.filter (fun σ : Equiv.Perm (Fin 2) => orderOf σ = 2) {1, Equiv.swap 0 1}) = {Equiv.swap 0 1} := by ext x simp only [Finset.mem_filter, Finset.mem_insert, Finset.mem_singleton] constructor · rintro ⟨(rfl | rfl), ho⟩ · rw [orderOf_one] at ho; norm_num at ho · rfl · rintro rfl exact ⟨Or.inr rfl, permutation_order_renyi_entropy_two_orderOf_swap⟩ rw [hfilt] simp/-- The order-q Rényi entropy of the permutation order in S_2 is log 2 for any q ≠ 1. -/theorem permutation_order_renyi_entropy_two (q : ℝ) (hq : q ≠ 1) : permutation_order_renyi_entropy q 2 = Real.log 2 := by unfold permutation_order_renyi_entropy rw [permutation_order_renyi_entropy_two_orders] have hne : (1 : ℕ) ∉ ({2} : Finset ℕ) := by simp rw [Finset.sum_insert hne, Finset.sum_singleton] rw [permutation_order_renyi_entropy_two_prob_one, permutation_order_renyi_entropy_two_prob_two] have hpos : (0 : ℝ) < 1 / 2 := by norm_num have hne1 : (2 : ℝ) ≠ 0 := by norm_num have hne2 : ((1 / 2 : ℝ) ^ q) ≠ 0 := by positivity have hsum : (1 / 2 : ℝ) ^ q + (1 / 2 : ℝ) ^ q = 2 * (1 / 2 : ℝ) ^ q := by ring rw [hsum] rw [Real.log_mul hne1 hne2] rw [Real.log_rpow hpos] have hlog_half : Real.log (1 / 2 : ℝ) = - Real.log 2 := by rw [one_div, Real.log_inv] rw [hlog_half] have hsub : 1 - q ≠ 0 := by intro h apply hq linarith have hring : Real.log 2 + q * -Real.log 2 = (1 - q) * Real.log 2 := by ring rw [hring] exact mul_div_cancel_left₀ (Real.log 2) hsub