CodingTheory.Johnson.coord_mul_pmOne
theoremverifiedimported Lean
Coordinatewise product of $\pm 1$ embeddings. Let $x, y$ be binary words of length $n$, and encode each as a $\pm 1$ vector in $\bbr^n$ by sending its $i$-th bit to $-1$ when that bit is true and to $+1$ when it is false. Then for every coordinate $i$, the product of the $i$-th entries of these two embeddings equals $1$ if $x_i = y_i$ and $-1$ if $x_i \ne y_i$.
Statement
set_option autoImplicit true in set_option relaxedAutoImplicit true in open scoped BigOperators RealInnerProductSpace in open Finset in lemma CodingTheory.Johnson.coord_mul_pmOne {n : ℕ} (x y : BitVec n) (i : Fin n) : (pmOne x i) * (pmOne y i) = if x i = y i then (1 : ℝ) else (-1 : ℝ)
- Source
- TCSlib, `CodingTheory.Johnson.coord_mul_pmOne`
- Lean proof
- By Allan Li, Frederick Dehmel, Hydroxyi (from the file's git history), from github.com/Shilun-Allan-Li/tcslib at
c8a02591b1e5(Apache-2.0). Compiled here against leanprover/lean4:v4.33.1, Mathlib v4.33.1; written for leanprover/lean4:v4.25.0.CodingTheory.Johnson.coord_mul_pmOne← CodingTheory.Johnson.coord_mul_pmOne (TCSlib/ErrorCorrectingCodes/JohnsonBound.lean:69): verbatim
- Verified
- 07 Oct 2026
- Axioms
Classical.choiceQuot.soundpropext- Built on 2
- CodingTheory.Johnson.BitVecThe type of binary words of length $n$, namely functions $\mathrm{Fin}\,n \to \mathrm{Bool}$.
- CodingTheory.Johnson.pmOneThe map sending a binary word $x$ to the real vector in $\mathbb{R}^n$ whose $i$-th coordinate is $-1$ if $x_i = \texttt{true}$ and $+1$…
- Used by 1
- CodingTheory.Johnson.inner_pmOne_pmOneInner product of two ±1 embeddings. For any two binary words $x, y$ of length $n$, let $\phi(x), \phi(y) \in \mathbb{R}^n$ be their…
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.
set_option autoImplicit true inset_option relaxedAutoImplicit true inopen scoped BigOperators RealInnerProductSpace inopen Finset inlemma CodingTheory.Johnson.coord_mul_pmOne {n : ℕ} (x y : BitVec n) (i : Fin n) : (pmOne x i) * (pmOne y i) = if x i = y i then (1 : ℝ) else (-1 : ℝ) := by by_cases hx : x i <;> by_cases hy : y i <;> simp [pmOne, hx, hy]