Buckets:
| import OAI.Combinatorics.Sensitivity.Basic | |
| namespace OAI | |
| /-! Disjoint Boolean composition, with each child retaining its own raw coordinates. -/ | |
| noncomputable section | |
| open scoped Classical BigOperators | |
| namespace Paper320 | |
| variable {I J : Type} | |
| def compose (f : (I → Bool) → Bool) (g : (J → Bool) → Bool) : | |
| (I × J → Bool) → Bool := | |
| fun x => f (fun i => g (fun j => x (i, j))) | |
| theorem compose_flip_sensitive_iff (f : (I → Bool) → Bool) (g : (J → Bool) → Bool) | |
| (x : I × J → Bool) (i : I) (j : J) : | |
| compose f g (flip x {(i, j)}) ≠ compose f g x ↔ | |
| g (flip (fun a => x (i, a)) {j}) ≠ g (fun a => x (i, a)) ∧ | |
| f (flip (fun k => g (fun a => x (k, a))) {i}) ≠ | |
| f (fun k => g (fun a => x (k, a))) := by | |
| by_cases hg : g (flip (fun a => x (i, a)) {j}) = g (fun a => x (i, a)) | |
| · have he : (fun k => g (fun a => flip x {(i, j)} (k, a))) = | |
| fun k => g (fun a => x (k, a)) := by | |
| funext k | |
| by_cases hk : k = i | |
| · subst k | |
| rw [flip_prod_same, hg] | |
| · rw [flip_prod_other x j hk] | |
| simp only [compose, he, ne_eq, not_true_eq_false, hg, false_and] | |
| · have hn : g (flip (fun a => x (i, a)) {j}) = !(g (fun a => x (i, a))) := by | |
| cases h₁ : g (flip (fun a => x (i, a)) {j}) <;> | |
| cases h₂ : g (fun a => x (i, a)) <;> simp_all | |
| have he : (fun k => g (fun a => flip x {(i, j)} (k, a))) = | |
| flip (fun k => g (fun a => x (k, a))) {i} := by | |
| funext k | |
| by_cases hk : k = i | |
| · subst k | |
| rw [flip_prod_same, flip_singleton_self, hn] | |
| · rw [flip_prod_other x j hk, flip_singleton_other _ hk] | |
| simp only [compose, he, ne_eq, hg, not_false_eq_true, true_and] | |
| theorem compose_zero (f : (I → Bool) → Bool) (g : (J → Bool) → Bool) | |
| (hg : g (fun _ => false) = false) : | |
| compose f g (fun _ => false) = f (fun _ => false) := by | |
| simp [compose, hg] | |
| theorem compose_flip_product_zero (f : (I → Bool) → Bool) (g : (J → Bool) → Bool) | |
| (C : Finset I) (D : Finset J) (hg : g (fun _ => false) = false) | |
| (hD : g (flip (fun _ => false) D) ≠ g (fun _ => false)) : | |
| compose f g (flip (fun _ => false) (C ×ˢ D)) = f (flip (fun _ => false) C) := by | |
| have hD' : g (flip (fun _ => false) D) = true := by | |
| cases he : g (flip (fun _ => false) D) <;> simp_all | |
| apply congrArg f | |
| funext i | |
| by_cases hi : i ∈ C | |
| · have he : (fun j => flip (fun _ => false) (C ×ˢ D) (i, j)) = | |
| flip (fun _ => false) D := by | |
| funext j | |
| simp [flip, hi] | |
| rw [he, hD'] | |
| simp [flip, hi] | |
| · have he : (fun j => flip (fun _ => false) (C ×ˢ D) (i, j)) = | |
| fun _ => false := by | |
| funext j | |
| simp [flip, hi] | |
| rw [he, hg] | |
| simp [flip, hi] | |
| section Finite | |
| variable [Fintype I] [Fintype J] | |
| theorem sensitivityAt_compose (f : (I → Bool) → Bool) (g : (J → Bool) → Bool) | |
| (x : I × J → Bool) : | |
| sensitivityAt (compose f g) x = | |
| ∑ i ∈ Finset.univ.filter (fun i => | |
| f (flip (fun k => g (fun a => x (k, a))) {i}) ≠ | |
| f (fun k => g (fun a => x (k, a)))), | |
| sensitivityAt g (fun a => x (i, a)) := by | |
| simp only [sensitivityAt, Finset.card_eq_sum_ones, Finset.sum_filter, | |
| compose_flip_sensitive_iff, Fintype.sum_prod_type] | |
| apply Finset.sum_congr rfl | |
| intro i _ | |
| by_cases hi : f (flip (fun k => g (fun a => x (k, a))) {i}) ≠ | |
| f (fun k => g (fun a => x (k, a))) | |
| · simp [hi] | |
| · simp [hi] | |
| theorem sensitivity_compose_le (f : (I → Bool) → Bool) (g : (J → Bool) → Bool) : | |
| sensitivity (compose f g) ≤ sensitivity f * sensitivity g := by | |
| apply sensitivity_le | |
| intro x | |
| rw [sensitivityAt_compose] | |
| calc | |
| _ ≤ ∑ i ∈ Finset.univ.filter (fun i => | |
| f (flip (fun k => g (fun a => x (k, a))) {i}) ≠ | |
| f (fun k => g (fun a => x (k, a)))), sensitivity g := | |
| Finset.sum_le_sum fun i _ => sensitivityAt_le_sensitivity g _ | |
| _ = sensitivityAt f (fun k => g (fun a => x (k, a))) * sensitivity g := by | |
| simp [sensitivityAt] | |
| _ ≤ sensitivity f * sensitivity g := | |
| Nat.mul_le_mul_right _ (sensitivityAt_le_sensitivity f _) | |
| theorem blockSensitivityAt_compose_zero_le (f : (I → Bool) → Bool) | |
| (g : (J → Bool) → Bool) (hg : g (fun _ => false) = false) : | |
| blockSensitivityAt f (fun _ => false) * blockSensitivityAt g (fun _ => false) ≤ | |
| blockSensitivityAt (compose f g) (fun _ => false) := by | |
| obtain ⟨S, hS, hdS, hbS⟩ := exists_blockSensitivityAt_family f (fun _ => false) | |
| obtain ⟨T, hT, hdT, hbT⟩ := exists_blockSensitivityAt_family g (fun _ => false) | |
| have h := le_blockSensitivityAt_of_family (compose f g) (fun _ => false) | |
| (fun p : S × T => p.1.val ×ˢ p.2.val) | |
| (by | |
| intro p | |
| obtain ⟨i, hi⟩ := (hbS p.1.val p.1.property).1 | |
| obtain ⟨j, hj⟩ := (hbT p.2.val p.2.property).1 | |
| exact ⟨(i, j), Finset.mem_product.mpr ⟨hi, hj⟩⟩) | |
| (by | |
| intro p q hpq | |
| apply Finset.disjoint_left.mpr | |
| intro a ha hq | |
| obtain ⟨ha₁, ha₂⟩ := Finset.mem_product.mp ha | |
| obtain ⟨hq₁, hq₂⟩ := Finset.mem_product.mp hq | |
| by_cases hs : p.1 = q.1 | |
| · have ht : p.2.val ≠ q.2.val := by | |
| intro h | |
| exact hpq (Prod.ext hs (Subtype.ext h)) | |
| exact Finset.disjoint_left.mp (hdT _ p.2.property _ q.2.property ht) ha₂ hq₂ | |
| · have hs' : p.1.val ≠ q.1.val := fun h => hs (Subtype.ext h) | |
| exact Finset.disjoint_left.mp (hdS _ p.1.property _ q.1.property hs') ha₁ hq₁) | |
| (by | |
| intro p | |
| rw [compose_flip_product_zero f g _ _ hg (hbT p.2.val p.2.property).2, | |
| compose_zero f g hg] | |
| exact (hbS p.1.val p.1.property).2) | |
| simpa only [Fintype.card_prod, Fintype.card_coe, hS, hT] using h | |
| end Finite | |
| end Paper320 | |
| end | |
| end OAI | |
Xet Storage Details
- Size:
- 5.76 kB
- Xet hash:
- 3df3ae12de156af816341b15525f51eef5267bfa38f347564d64d44d0d6a2c58
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.