avg_pairwise_hamming_dist
For an implicit dimension $n$ and a finite subset $F : \mathrm{Finset} (\mathrm{Fin}\ n \to \mathrm{Bool})$, the average pairwise Hamming distance avg_pairwise_hamming_dist F is the real number given by the sum over all pairs $x, y \in F$ of Mathlib's Hamming distance hammingDist x y cast to $\mathbb{R}$, divided by $(|F| : \mathbb{R})^2$.
Statement
noncomputable def avg_pairwise_hamming_dist {n : ℕ} (F : Finset (Fin n → Bool)) : ℝ
- Defined in
- arXiv:2610.40486 Sec. 1
- Verified
- 30 Oct 2026
- Axioms
- none listed
- Used by 3
- avg_pairwise_hamming_dist_singletonFor any natural number $n$ and any point $c : \mathrm{Fin}\ n \to \mathrm{Bool}$, the average pairwise Hamming distance of the singleton…
- min_avg_pairwise_hamming_dist_density_one_sixteenth_n_eq_fiveFor $n = 5$, every subset $F \subseteq (\mathrm{Fin}\ 5 \to \mathrm{Bool})$ of cardinality $2^{5-4} = 2$ has average pairwise Hamming…
- min_avg_pairwise_hamming_dist_density_one_sixteenth_n_eq_fourFor $n = 4$, every subset $F \subseteq (\mathrm{Fin}\ 4 \to \mathrm{Bool})$ of cardinality $2^{4-4} = 1$ attains average pairwise Hamming…
Read back from the Lean
A definition avg_pairwise_hamming_dist that takes an implicit natural number n and a finite set F of Boolean functions on Fin n (i.e., F : Finset (Fin n → Bool)), and returns the real number obtained by summing the Hamming distance between x and y (cast to ℝ) over all pairs x, y ∈ F, divided by (|F| : ℝ)².
Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.
Lean source view module on GitHub
/-- The average pairwise Hamming distance of a finite subset `F` of the Boolean hypercube `Fin n → Bool`. -/ noncomputable def avg_pairwise_hamming_dist {n : ℕ} (F : Finset (Fin n → Bool)) : ℝ := (∑ x ∈ F, ∑ y ∈ F, (hammingDist x y : ℝ)) / (F.card : ℝ)^2