cfahlgren1/math / lean /OAI /Combinatorics /Sensitivity /InitialPredicates.lean
cfahlgren1's picture
download
raw
5.38 kB
import OAI.Combinatorics.Sensitivity.HammingBase
import OAI.Combinatorics.Sensitivity.RecursiveProfiles
import OAI.Combinatorics.Sensitivity.Basic
namespace OAI
/-! The separated Hamming-ball predicates and their explicit sensitive blocks. -/
noncomputable section
open scoped Classical
namespace Paper320
def blockCenter {M L : ℕ} (j : Fin M) : Fin M × Fin L → Bool :=
fun p => decide (p.1 = j)
def baseBlock {M L : ℕ} (j : Fin M) : Finset (Fin M × Fin L) :=
Finset.univ.filter fun p => p.1 = j
@[simp] theorem mem_baseBlock {M L : ℕ} (j : Fin M) (p : Fin M × Fin L) :
p ∈ baseBlock j ↔ p.1 = j := by
simp [baseBlock]
theorem baseBlock_card {M L : ℕ} (j : Fin M) : (baseBlock (L := L) j).card = L := by
have h : (baseBlock (L := L) j).card = (Finset.univ : Finset (Fin L)).card := by
apply Finset.card_bij (fun p _ => p.2)
· intro p _
exact Finset.mem_univ _
· intro p hp q hq hpq
exact Prod.ext (((mem_baseBlock j p).mp hp).trans ((mem_baseBlock j q).mp hq).symm) hpq
· intro b _
exact ⟨(j, b), (mem_baseBlock j (j, b)).mpr rfl, rfl⟩
simpa using h
theorem baseBlock_nonempty {M L : ℕ} (hL : 0 < L) (j : Fin M) :
(baseBlock (L := L) j).Nonempty := by
rw [← Finset.card_pos, baseBlock_card]
exact hL
theorem baseBlock_disjoint {M L : ℕ} :
Pairwise fun i j : Fin M => Disjoint (baseBlock (L := L) i) (baseBlock j) := by
intro i j hij
apply Finset.disjoint_left.mpr
rintro ⟨a, b⟩ hi hj
simp only [mem_baseBlock] at hi hj
exact hij (hi.symm.trans hj)
theorem flip_zero_baseBlock {M L : ℕ} (j : Fin M) :
flip (fun _ : Fin M × Fin L => false) (baseBlock j) = blockCenter j := by
ext p
simp [flip, blockCenter]
theorem hammingDist_zero_blockCenter {M L : ℕ} (j : Fin M) :
hammingDist (fun _ : Fin M × Fin L => false) (blockCenter j) = L := by
have hs : (Finset.univ.filter fun p : Fin M × Fin L => false ≠ blockCenter j p) =
baseBlock j := by
ext p
simp [blockCenter]
rw [hammingDist, hs, baseBlock_card]
theorem hammingDist_blockCenter {M L : ℕ} (i j : Fin M) (hij : i ≠ j) :
hammingDist (blockCenter (L := L) i) (blockCenter j) = 2 * L := by
have hs : (Finset.univ.filter fun p : Fin M × Fin L =>
blockCenter i p ≠ blockCenter j p) =
baseBlock i ∪ baseBlock j := by
ext ⟨a, b⟩
by_cases ha : a = i <;> by_cases hb : a = j <;> simp_all [blockCenter]
rw [hammingDist, hs]
rw [Finset.card_union_of_disjoint (baseBlock_disjoint hij), baseBlock_card, baseBlock_card]
omega
def initialFamily (d M : ℕ) : Fin (d + 1) → (Fin M × Fin (d + 2) → Bool) → Bool :=
fun q => ballPredicate blockCenter (d - q.val)
theorem initialFamily_nested (d M : ℕ) : NestedFamily (initialFamily d M) := by
constructor
intro q q' x hqq hx
exact ballPredicate_nested blockCenter (by omega) x hx
theorem initialFamily_zero (d M : ℕ) (q : Fin (d + 1)) :
initialFamily d M q (fun _ => false) = false := by
have hn : ¬ ∃ c : Fin M,
hammingDist (fun _ : Fin M × Fin (d + 2) => false) (blockCenter c) ≤ d - q.val := by
rintro ⟨c, hc⟩
rw [hammingDist_zero_blockCenter] at hc
omega
simp [initialFamily, ballPredicate, hn]
theorem initialFamily_baseBlock (d M : ℕ) (q : Fin (d + 1)) (j : Fin M) :
initialFamily d M q (flip (fun _ => false) (baseBlock j)) = true := by
rw [flip_zero_baseBlock]
apply (ballPredicate_eq_true blockCenter (d - q.val) (blockCenter j)).2
exact ⟨j, by simp⟩
theorem initialFamily_side_zero (d M : ℕ) :
sideSensitivity (initialFamily d M) false ≤ d + 2 := by
apply sideSensitivity_le
intro q x hx
have hs : ∀ a b : Fin M, a ≠ b →
2 * ((d - q.val) + 1) < hammingDist (blockCenter (L := d + 2) a) (blockCenter b) := by
intro a b hab
rw [hammingDist_blockCenter a b hab]
omega
exact (ballPredicate_sensitivityAt_zero_le blockCenter (d - q.val) hs x hx).trans
(by omega)
theorem initialFamily_side_one (d M : ℕ) :
sideSensitivity (initialFamily d M) true ≤ (d + 2) * M := by
apply sideSensitivity_le
intro q x _
simpa [Nat.mul_comm] using sensitivityAt_le_card (initialFamily d M q) x
theorem initialFamily_joint (d M : ℕ) (b : Bool) :
jointSensitivity (initialFamily d M) b = 0 := by
apply Nat.eq_zero_of_le_zero
apply jointSensitivity_le
intro q q' x hqq hx hx'
have hrad : d - q'.val < d - q.val := by omega
unfold jointSensitivityAt
have he : (Finset.univ.filter fun i =>
initialFamily d M q (flip x {i}) ≠ initialFamily d M q x ∧
initialFamily d M q' (flip x {i}) ≠ initialFamily d M q' x) = ∅ := by
apply Finset.filter_eq_empty_iff.mpr
intro i _ hi
obtain ⟨hi, hi'⟩ := hi
cases b with
| false =>
have hflip : initialFamily d M q' (flip x {i}) = true := by
simpa [hx'] using hi'
exact ballPredicate_no_joint_zero blockCenter hrad x i hx hflip
| true =>
have hflip : initialFamily d M q (flip x {i}) = false := by
simpa [hx] using hi
exact ballPredicate_no_joint_one blockCenter hrad x i hx' hflip
rw [he]
simp
theorem nearestDistance_blockCenter_zero (M L : ℕ) [NeZero M] :
nearestDistance (blockCenter (M := M) (L := L)) (fun _ => false) = L := by
simp [nearestDistance, hammingDist_zero_blockCenter]
end Paper320
end
end OAI

Xet Storage Details

Size:
5.38 kB
·
Xet hash:
d774a2526499805d39863079acd38981cc8c87b38de5b6ee9035e718ba62e657

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.