cfahlgren1/math / lean /OAI /Combinatorics /Sensitivity /RecursiveBlocks.lean
cfahlgren1's picture
download
raw
3.72 kB
import OAI.Combinatorics.Sensitivity.RecursiveDefinitions
namespace OAI
/-! Disjoint zero-input blocks lift to every column of a chosen row. -/
noncomputable section
open scoped Classical
namespace Paper320
def rowLift {k r : ℕ} {I : Type} (i : Fin k) (B : Finset I) :
Finset ((Fin k × Fin r) × I) :=
(Finset.univ.product B).map
⟨fun p : Fin r × I => ((i, p.1), p.2), by
intro p q hpq
exact Prod.ext (congrArg (fun z => z.1.2) hpq) (congrArg (fun z : (Fin k × Fin r) × I => z.2) hpq)⟩
@[simp] theorem mem_rowLift {k r : ℕ} {I : Type} (i : Fin k) (B : Finset I)
(p : (Fin k × Fin r) × I) : p ∈ rowLift (r := r) i B ↔ p.1.1 = i ∧ p.2 ∈ B := by
rcases p with ⟨⟨j, c⟩, a⟩
unfold rowLift
rw [Finset.mem_map]
constructor
· rintro ⟨⟨c', b⟩, hb, hp⟩
change ((i, c'), b) = ((j, c), a) at hp
cases hp
exact ⟨rfl, (Finset.mem_product.mp hb).2⟩
· rintro ⟨rfl, ha⟩
exact ⟨(c, a), Finset.mem_product.mpr ⟨Finset.mem_univ _, ha⟩, rfl⟩
theorem rowLift_card {k r : ℕ} {I : Type} (i : Fin k) (B : Finset I) :
(rowLift (r := r) i B).card = r * B.card := by
simp [rowLift]
theorem rowLift_nonempty {k r : ℕ} {I : Type} (i : Fin k) (B : Finset I)
(hr : 0 < r) (hB : B.Nonempty) : (rowLift (r := r) i B).Nonempty := by
obtain ⟨a, ha⟩ := hB
exact ⟨((i, ⟨0, hr⟩), a), (mem_rowLift i B _).mpr ⟨rfl, ha⟩⟩
theorem rowLift_disjoint_of_ne {k r : ℕ} {I : Type} (i j : Fin k)
(B C : Finset I) (hij : i ≠ j) : Disjoint (rowLift (r := r) i B) (rowLift j C) := by
apply Finset.disjoint_left.mpr
intro p hp hq
exact hij (((mem_rowLift i B p).mp hp).1.symm.trans ((mem_rowLift j C p).mp hq).1)
theorem rowLift_disjoint {k r : ℕ} {I : Type} (i j : Fin k) (B C : Finset I)
(hBC : Disjoint B C) : Disjoint (rowLift (r := r) i B) (rowLift j C) := by
apply Finset.disjoint_left.mpr
intro p hp hq
exact Finset.disjoint_left.mp hBC ((mem_rowLift i B p).mp hp).2
((mem_rowLift j C p).mp hq).2
theorem rowLift_family_disjoint {k r : ℕ} {I K : Type} (blocks : K → Finset I)
(hB : Pairwise fun a b => Disjoint (blocks a) (blocks b)) :
Pairwise fun a b : Fin k × K =>
Disjoint (rowLift (r := r) a.1 (blocks a.2)) (rowLift b.1 (blocks b.2)) := by
intro a b hab
by_cases hrow : a.1 = b.1
· apply rowLift_disjoint
apply hB
intro hcol
exact hab (Prod.ext hrow hcol)
· exact rowLift_disjoint_of_ne _ _ _ _ hrow
theorem recursiveChild_rowLift_same {k r : ℕ} {I : Type}
(i : Fin k) (B : Finset I) (c : Fin r) :
recursiveChild (flip (fun _ => false) (rowLift (r := r) i B)) i c =
flip (fun _ => false) B := by
funext a
simp [recursiveChild, flip]
theorem recursiveChild_rowLift_other {k r : ℕ} {I : Type}
(i j : Fin k) (B : Finset I) (c : Fin r) (hji : j ≠ i) :
recursiveChild (flip (fun _ => false) (rowLift (r := r) i B)) j c =
fun _ => false := by
funext a
simp [recursiveChild, flip, hji]
theorem recursiveFamily_rowLift {k r h : ℕ} {I : Type} (T : Tournament k)
(label : Fin k → Fin k → Fin r) (F : Fin (h + 1) → (I → Bool) → Bool)
(hzero : ∀ q, F q (fun _ => false) = false) (B : Finset I)
(hB : ∀ q, F q (flip (fun _ => false) B) = true) (i : Fin k) (q : Fin h) :
recursiveFamily T label F q (flip (fun _ => false) (rowLift i B)) = true := by
apply (recursiveFamily_eq_true_iff _ _ _ _ _).mpr
refine ⟨i, (rowClause_eq_true_iff _ _ _ _ _ _).mpr ⟨?_, ?_⟩⟩
· intro c
rw [recursiveChild_rowLift_same]
exact hB _
· intro j hij
rw [recursiveChild_rowLift_other _ _ _ _ (T.ne_of_adj hij).symm]
exact hzero _
end Paper320
end
end OAI

Xet Storage Details

Size:
3.72 kB
·
Xet hash:
6c3ebb7cf8c900c4da1c77c26bca8f4653046678053e188c615cadde6e6155be

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