Documentation

CslibFrontier.Foundations.LinearAlgebra.RandomOrthogonal

Random vectors orthogonal to a fixed string determine it #

Let a ∈ GF(2)^n be nonzero and draw n - 1 vectors y_1, …, y_{n-1} independently and uniformly from the strings orthogonal to a, i.e. uniformly among the tuples with y_i ⬝ a = 0 for every i. With probability at least 1 / 4, the only strings orthogonal to all of them are 0 and a (Cslib.LinearAlgebra.one_div_four_le_card_determines_div_card).

This is Exercise 5 of Chapter 20 of the Arora–Barak web draft (2007-01-08, p. 431/447), which the text uses for Simon's algorithm (p. 422/438). The exercise asks for probability at least 1 / 10; 1 / 4 ≥ 1 / 10. The exercise does not exclude a = 0, but for a = 0 the claim fails: n - 1 vectors always have a nonzero common orthogonal string when n ≥ 1. So the statement assumes a ≠ 0.

Proof. The dot product is a nondegenerate reflexive bilinear form on GF(2)^n, so Mathlib's orthogonality API applies (LinearMap.BilinForm.orthogonal). The strings orthogonal to a form the orthogonal complement a^⊥ of span {a}, of dimension n - 1 (LinearMap.BilinForm.finrank_orthogonal). By the count of linearly independent families over a finite field (card_linearIndependent), exactly ∏_{i < n - 1} (2^{n-1} - 2^i) of the 2^{(n-1)^2} tuples are linearly independent. Independent tuples span a^⊥, so every string w orthogonal to all of them lies in (a^⊥)^⊥ = span {a} = {0, a} (LinearMap.BilinForm.orthogonal_orthogonal). Finally ∏_{i < n - 1} (1 - 2^{i - (n-1)}) = ∏_{j = 1}^{n - 1} (1 - 2^{-j}) ≥ 1 / 4.

Main results #

References #

theorem Cslib.LinearAlgebra.one_div_four_le_card_determines_div_card {n : ℕ} {a : Fin n → ZMod 2} (ha : a ≠ 0) :
1 / 4 ≤ ↑{y : Fin (n - 1) → Fin n → ZMod 2 | (∀ (i : Fin (n - 1)), y i ⬝ᵥ a = 0) ∧ ∀ (w : Fin n → ZMod 2), (∀ (i : Fin (n - 1)), y i ⬝ᵥ w = 0) → w = 0 ∨ w = a}.card / ↑{y : Fin (n - 1) → Fin n → ZMod 2 | ∀ (i : Fin (n - 1)), y i ⬝ᵥ a = 0}.card

Arora–Barak, Exercise 20.5 (web draft 2007-01-08, p. 431/447), with the hypothesis a ≠ 0 it needs. For nonzero a ∈ GF(2)^n, if y_1, …, y_{n-1} are drawn uniformly at random subject to y_i ⬝ a = 0 for every i, then with probability at least 1 / 4 (the exercise asks for 1 / 10) no string other than 0 and a is orthogonal to all of them. Here the probability is the fraction of the tuples with y_i ⬝ a = 0 for every i.