cfahlgren1's picture
download
raw
5.13 kB
import OAI.Combinatorics.Sensitivity.Composition
import OAI.Combinatorics.Sensitivity.Reindex
namespace OAI
/-! Repeated disjoint composition with explicit finite raw-coordinate types. -/
noncomputable section
open scoped Classical
namespace Paper320
abbrev IterateCoord (I : Type) : ℕ → Type
| 0 => Unit
| m + 1 => I × IterateCoord I m
instance iterateCoordFintype {I : Type} [Fintype I] :
(m : ℕ) → Fintype (IterateCoord I m)
| 0 => inferInstanceAs (Fintype Unit)
| m + 1 =>
letI : Fintype (IterateCoord I m) := iterateCoordFintype (I := I) m
inferInstanceAs (Fintype (I × IterateCoord I m))
def iterateCompose {I : Type} (f : (I → Bool) → Bool) :
(m : ℕ) → (IterateCoord I m → Bool) → Bool
| 0 => fun x => x ()
| m + 1 => compose f (iterateCompose f m)
theorem iterateCompose_one {I : Type} (f : (I → Bool) → Bool)
(x : IterateCoord I 1 → Bool) :
iterateCompose f 1 x = f (fun i => x (i, ())) := rfl
theorem iterateCompose_zero {I : Type} (f : (I → Bool) → Bool)
(hf : f (fun _ => false) = false) (m : ℕ) :
iterateCompose f m (fun _ => false) = false := by
induction m with
| zero => rfl
| succ m ih => exact (compose_zero f (iterateCompose f m) ih).trans hf
variable {I : Type} [Fintype I]
theorem iterateCoord_card (m : ℕ) :
Fintype.card (IterateCoord I m) = Fintype.card I ^ m := by
induction m with
| zero => exact Fintype.card_unique
| succ m ih =>
change Fintype.card (I × IterateCoord I m) = _
rw [Fintype.card_prod, ih, pow_succ, Nat.mul_comm]
theorem sensitivity_iterateCompose_le (f : (I → Bool) → Bool) (m : ℕ) :
sensitivity (iterateCompose f m) ≤ sensitivity f ^ m := by
induction m with
| zero =>
apply sensitivity_le
intro x
exact (sensitivityAt_le_card (iterateCompose f 0) x).trans_eq (iterateCoord_card 0)
| succ m ih =>
change sensitivity (compose f (iterateCompose f m)) ≤ _
calc
_ ≤ sensitivity f * sensitivity (iterateCompose f m) := sensitivity_compose_le _ _
_ ≤ sensitivity f * sensitivity f ^ m := Nat.mul_le_mul_left _ ih
_ = sensitivity f ^ (m + 1) := by rw [pow_succ, Nat.mul_comm]
theorem blockSensitivityAt_iterateCompose_zero (f : (I → Bool) → Bool)
(hf : f (fun _ => false) = false) (m : ℕ) :
blockSensitivityAt f (fun _ => false) ^ m ≤
blockSensitivityAt (iterateCompose f m) (fun _ => false) := by
induction m with
| zero =>
have h := le_blockSensitivityAt (iterateCompose f 0) (fun _ => false)
({{()}} : Finset (Finset Unit))
(by
intro A hA B hB hne
exact (hne ((Finset.mem_singleton.mp hA).trans (Finset.mem_singleton.mp hB).symm)).elim)
(by
intro B hB
have hB' : B = {()} := Finset.mem_singleton.mp hB
subst B
exact ⟨Finset.singleton_nonempty _, by simp [iterateCompose, flip]⟩)
simpa only [Finset.card_singleton, pow_zero] using h
| succ m ih =>
change _ ≤ blockSensitivityAt (compose f (iterateCompose f m)) (fun _ => false)
calc
_ = blockSensitivityAt f (fun _ => false) *
blockSensitivityAt f (fun _ => false) ^ m := by rw [pow_succ, Nat.mul_comm]
_ ≤ blockSensitivityAt f (fun _ => false) *
blockSensitivityAt (iterateCompose f m) (fun _ => false) := Nat.mul_le_mul_left _ ih
_ ≤ _ := blockSensitivityAt_compose_zero_le f (iterateCompose f m)
(iterateCompose_zero f hf m)
def iterateFin (f : (I → Bool) → Bool) (m : ℕ) :
(Fin (Fintype.card I ^ m) → Bool) → Bool :=
reindex (Fintype.equivFinOfCardEq (iterateCoord_card (I := I) m)) (iterateCompose f m)
theorem iterateFin_zero (f : (I → Bool) → Bool)
(hf : f (fun _ => false) = false) (m : ℕ) :
iterateFin f m (fun _ => false) = false :=
iterateCompose_zero f hf m
theorem sensitivity_iterateFin_le (f : (I → Bool) → Bool) (m : ℕ) :
sensitivity (iterateFin f m) ≤ sensitivity f ^ m := by
rw [iterateFin, sensitivity_reindex]
exact sensitivity_iterateCompose_le f m
theorem blockSensitivityAt_iterateFin_zero (f : (I → Bool) → Bool)
(hf : f (fun _ => false) = false) (m : ℕ) :
blockSensitivityAt f (fun _ => false) ^ m ≤
blockSensitivityAt (iterateFin f m) (fun _ => false) := by
rw [iterateFin, blockSensitivityAt_reindex]
exact blockSensitivityAt_iterateCompose_zero f hf m
theorem nonconstant_of_blockSensitivityAt_pos (f : (I → Bool) → Bool) (x : I → Bool)
(h : 0 < blockSensitivityAt f x) : ∃ y z, f y ≠ f z := by
obtain ⟨blocks, hc, _, hb⟩ := exists_blockSensitivityAt_family f x
have hn : blocks.Nonempty := Finset.card_pos.mp (hc.symm ▸ h)
obtain ⟨B, hB⟩ := hn
exact ⟨flip x B, x, (hb B hB).2⟩
theorem iterateFin_nonconstant (f : (I → Bool) → Bool)
(hf : f (fun _ => false) = false)
(h : 0 < blockSensitivityAt f (fun _ => false)) (m : ℕ) :
∃ x y, iterateFin f m x ≠ iterateFin f m y := by
exact nonconstant_of_blockSensitivityAt_pos _ _
((pow_pos h m).trans_le (blockSensitivityAt_iterateFin_zero f hf m))
end Paper320
end
end OAI

Xet Storage Details

Size:
5.13 kB
·
Xet hash:
554e5c6374dbbcfe4535f9483c644f3075233efc11dcae7923060a1d408ec25c

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