Sensitivity separation: hamming base #
Adapted from OpenAI's formalization at revision adc7f1241b42e322a6451854ab7e4b4c146bf78a.
Source: https://github.com/openai/math/blob/adc7f1241b42e322a6451854ab7e4b4c146bf78a/lean/OAI/Combinatorics/Sensitivity/HammingBase.lean
Imports, namespaces, module visibility, documentation, and formatting are adapted for complexitylib. The source theorem statements and mathematical proofs are retained.
theorem
Complexity.BooleanAnalysis.Sensitivity.Internal.hammingDist_flip_self
{I : Type}
[Fintype I]
(x : I → Bool)
(i : I)
:
theorem
Complexity.BooleanAnalysis.Sensitivity.Internal.hammingDist_le_flip_add_one
{I : Type}
[Fintype I]
(x z : I → Bool)
(i : I)
:
theorem
Complexity.BooleanAnalysis.Sensitivity.Internal.hammingDist_flip_le_add_one
{I : Type}
[Fintype I]
(x z : I → Bool)
(i : I)
:
theorem
Complexity.BooleanAnalysis.Sensitivity.Internal.hammingDist_flip_eq_add_one
{I : Type}
[Fintype I]
(x z : I → Bool)
(i : I)
(hi : x i = z i)
:
def
Complexity.BooleanAnalysis.Sensitivity.Internal.ballPredicate
{I C : Type}
[Fintype I]
[Fintype C]
(centers : C → I → Bool)
(R : ℕ)
(x : I → Bool)
:
The union of equal-radius Hamming balls.
Equations
- Complexity.BooleanAnalysis.Sensitivity.Internal.ballPredicate centers R x = decide (∃ (c : C), hammingDist x (centers c) ≤ R)
Instances For
theorem
Complexity.BooleanAnalysis.Sensitivity.Internal.ballPredicate_zero_flip
{I C : Type}
[Fintype I]
[Fintype C]
(centers : C → I → Bool)
(R : ℕ)
(x : I → Bool)
(i : I)
(hx : ballPredicate centers R x = false)
(hi : ballPredicate centers R (flip x {i}) = true)
:
∃ (c : C), hammingDist x (centers c) = R + 1 ∧ x i ≠ centers c i
theorem
Complexity.BooleanAnalysis.Sensitivity.Internal.near_center_unique
{I C : Type}
[Fintype I]
(centers : C → I → Bool)
(R : ℕ)
(hsep : ∀ (a b : C), a ≠ b → 2 * (R + 1) < hammingDist (centers a) (centers b))
(x : I → Bool)
{a b : C}
(ha : hammingDist x (centers a) ≤ R + 1)
(hb : hammingDist x (centers b) ≤ R + 1)
:
theorem
Complexity.BooleanAnalysis.Sensitivity.Internal.ballPredicate_sensitivityAt_zero_le
{I C : Type}
[Fintype I]
[Fintype C]
(centers : C → I → Bool)
(R : ℕ)
(hsep : ∀ (a b : C), a ≠ b → 2 * (R + 1) < hammingDist (centers a) (centers b))
(x : I → Bool)
(hx : ballPredicate centers R x = false)
:
def
Complexity.BooleanAnalysis.Sensitivity.Internal.nearestDistance
{I C : Type}
[Fintype I]
[Fintype C]
[Nonempty C]
(centers : C → I → Bool)
(x : I → Bool)
:
Minimum distance to the finite nonempty family of centers.
Equations
- Complexity.BooleanAnalysis.Sensitivity.Internal.nearestDistance centers x = Finset.univ.inf' ⋯ fun (c : C) => hammingDist x (centers c)