ose_boolean_cube_dist_sq_hamming
theoremverified
The squared Euclidean distance between two standard Boolean-cube vertices equals their Hamming distance.
Statement
theorem ose_boolean_cube_dist_sq_hamming (n : ℕ) (x y : Fin n → Bool) : dist (WithLp.toLp 2 (fun i : Fin n => if x i then (1 : ℝ) else 0) : EuclideanSpace ℝ (Fin n)) (WithLp.toLp 2 (fun i : Fin n => if y i then (1 : ℝ) else 0)) ^ 2 = (hammingDist x y : ℝ)
- Source
- arXiv:2611.08546, Section 6.1, Boolean-cube geometry
- Verified
- 15 Nov 2026
- Axioms
Classical.choiceQuot.soundpropext- Used by 4
- ose_two_layer_cube_exact_extension_thresholdLet n be a natural number at least one, and let r and s be positive real numbers with s²+2rs=1. Consider any metric on pairs (b,x), where…
- ose_boolean_cube_edge_extension_lower_boundFor an arbitrary placement of images of the Boolean cube vertices in Euclidean n-space, if every image lies within Lr of its corresponding…
- ose_boolean_cube_geometryThe standard Boolean cube in Euclidean space lies on the sphere about its center of squared radius n/4, and distinct vertices are…
- ose_two_layer_cube_exact_hilbert_distortionLet n be a natural number at least two, let r and s be positive reals with s²+2rs=1, and consider any metric on pairs (b,x) with a Boolean…
Lean source view module on GitHub
theorem ose_boolean_cube_dist_sq_hamming (n : ℕ) (x y : Fin n → Bool) : dist (WithLp.toLp 2 (fun i : Fin n => if x i then (1 : ℝ) else 0) : EuclideanSpace ℝ (Fin n)) (WithLp.toLp 2 (fun i : Fin n => if y i then (1 : ℝ) else 0)) ^ 2 = (hammingDist x y : ℝ) := by classical rw [EuclideanSpace.dist_sq_eq] simp only [WithLp.ofLp_toLp] simp only [hammingDist, Finset.card_eq_sum_ones, Nat.cast_sum, Nat.cast_one, Finset.sum_filter] apply Finset.sum_congr rfl intro i hi cases hx : x i <;> cases hy : y i <;> norm_num [hx,hy,Real.dist_eq]