roseking's picture
Add lean source and binary files (part 118)
180bc03 verified
Raw History Blame Contribute Delete
18.1 kB
249
lemma firstLayerHit_concat {d : ℕ} (height : Lattice d → ℤ) (X : Path d)
    {H K : ℤ} (hHK : H < K) {n m : ℕ}
    (hn : X ∈ FirstLayerHit height H n)
    (hm : (fun j => X (n+j)) ∈ FirstLayerHit height K m) :
    X ∈ FirstLayerHit height K (n+m) := by
proof · 7 lines
  refine ⟨hm.1,?_⟩
  intro j hj
  by_cases hjn : j < n
  · exact (hn.2 j hjn).trans hHK
  · have hnj : n ≤ j := by omega
    have hh := hm.2 (j-n) (by omega)
    simpa only [Set.mem_ofPred_eq,Nat.add_sub_of_le hnj] using hh
262
lemma stayUntil_concat {d : ℕ} (ℓ : Vector d) (x : Lattice d) (X : Path d) {n m : ℕ}
    (hn : X ∈ StayUntil {z | dot (realPosition x) ℓ ≤ dot (realPosition z) ℓ} n)
    (hm : (fun j => X (n+j)) ∈
      StayUntil {z | dot (realPosition (X n)) ℓ ≤ dot (realPosition z) ℓ} m) :
    X ∈ StayUntil {z | dot (realPosition x) ℓ ≤ dot (realPosition z) ℓ} (n+m) := by
proof · 8 lines
  intro j hj
  by_cases hjn : j ≤ n
  · exact hn j hjn
  · have hnj : n ≤ j := by omega
    have hh1 : dot (realPosition x) ℓ ≤ dot (realPosition (X n)) ℓ := hn n le_rfl
    have hh2 : dot (realPosition (X n)) ℓ ≤ dot (realPosition (X (n+(j-n)))) ℓ := hm (j-n) (by omega)
    have hh := hh1.trans hh2
    simpa only [Set.mem_ofPred_eq,Nat.add_sub_of_le hnj] using hh
276
lemma futureNoDrop_concat {d : ℕ} (ℓ : Vector d) (X : Path d) (n m : ℕ)
    (h : (fun j => X (n+j)) ∈ FutureNoDrop ℓ m) : X ∈ FutureNoDrop ℓ (n+m) := by
proof · 2 lines
  intro j
  simpa only [Nat.add_assoc] using h j
281
lemma layerPairPrefix_truth_concat {d : ℕ} (ℓ : Vector d) (height : Lattice d → ℤ)
    (x y : Lattice d) {H K : ℤ} (hHK : H < K)
    (E F : Set (Lattice d × Lattice d)) (nm : ℕ × ℕ) (P : Path d × Path d)
    (hP : P ∈ layerPairPrefix ℓ height x y H E nm)
    (hQ : commonPairSuffix (nm.1+1) (nm.2+1) P ∈
      layerPairTruthEvent ℓ height (P.1 (nm.1+1)) (P.2 (nm.2+1)) K F) :
    P ∈ layerPairTruthEvent ℓ height x y K F := by
proof · 14 lines
  obtain ⟨ij,hQ⟩ := Set.mem_iUnion.mp hQ
  refine Set.mem_iUnion.mpr ⟨(nm.1+1+ij.1,nm.2+1+ij.2),?_⟩
  have hh1 := firstLayerHit_concat height P.1 hHK hP.1.1.1 hQ.1.1.1.1
  have hh2 := firstLayerHit_concat height P.2 hHK hP.1.1.2 hQ.1.1.1.2
  have hs1 := stayUntil_concat ℓ x P.1 hP.2.1 hQ.1.2.1
  have hs2 := stayUntil_concat ℓ y P.2 hP.2.2 hQ.1.2.2
  have hd1 := futureNoDrop_concat ℓ P.1 (nm.1+1) (ij.1+1) hQ.2.1
  have hd2 := futureNoDrop_concat ℓ P.2 (nm.2+1) (ij.2+1) hQ.2.2
  have he := hQ.1.1.2
  change (P.1 (nm.1+1+(ij.1+1)),P.2 (nm.2+1+(ij.2+1))) ∈ F at he
  exact ⟨⟨⟨⟨by simpa only [Nat.add_assoc] using hh1,
    by simpa only [Nat.add_assoc] using hh2⟩,by simpa only [Set.mem_ofPred_eq,Nat.add_assoc] using he⟩,
    ⟨by simpa only [Nat.add_assoc] using hs1,by simpa only [Nat.add_assoc] using hs2⟩⟩,
    ⟨by simpa only [Nat.add_assoc] using hd1,by simpa only [Nat.add_assoc] using hd2⟩⟩
303
lemma measurableSet_layerPairTruthEvent {d : ℕ} (ℓ : Vector d) (height : Lattice d → ℤ)
    (x y : Lattice d) (H : ℤ) (E : Set (Lattice d × Lattice d)) :
    MeasurableSet (layerPairTruthEvent ℓ height x y H E) :=
proof · 2 lines
  MeasurableSet.iUnion fun nm => (measurableSet_layerPairPrefix ℓ height x y H E nm).inter
    ((measurableSet_futureNoDrop ℓ _).prod (measurableSet_futureNoDrop ℓ _))
309
lemma shared_layer_restart_lower {d : ℕ} (ν : Measure (Row d)) [IsProbabilityMeasure ν]
    (ℓ : Vector d) (height : Lattice d → ℤ)
    (hproj : ∀ z, dot (realPosition z) ℓ = (height z : ℝ))
    (x y : Lattice d) (H : ℤ) (E : Set (Lattice d × Lattice d))
    (B : Lattice d → Lattice d → Set (Path d × Path d))
    (hB : ∀ u v, MeasurableSet (B u v)) (hBD : ∀ u v, B u v ⊆ NoDrop ℓ u ×ˢ NoDrop ℓ v)
    (q : ℝ≥0∞) (hq : ∀ u v, height u=H → height v=H → (u,v)∈E →
      q ≤ sharedPairLaw ν u v (B u v))
    (C : Set (Path d × Path d))
    (hC : ∀ nm P, P ∈ layerPairPrefix ℓ height x y H E nm →
      commonPairSuffix (nm.1+1) (nm.2+1) P ∈ B (P.1 (nm.1+1)) (P.2 (nm.2+1)) → P∈C) :
    q*sharedPairLaw ν x y (layerPairEvent ℓ height x y H E) ≤ sharedPairLaw ν x y C := by
proof · 24 lines
  let A := layerPairPrefix ℓ height x y H E
  let D := fun nm : ℕ × ℕ => A nm ∩ recordPairFuture (nm.1+1) (nm.2+1) B
  have hAm nm : MeasurableSet (A nm) := measurableSet_layerPairPrefix ℓ height x y H E nm
  have hDm nm : MeasurableSet (D nm) := (hAm nm).inter (measurableSet_recordPairFuture _ _ B hB)
  have hdisA := layerPairPrefix_disjoint ℓ height x y H E
  have hdisD : Pairwise (fun nm mn => Disjoint (D nm) (D mn)) := by
    intro nm mn hne
    exact (hdisA hne).mono Set.inter_subset_left Set.inter_subset_left
  have hmain : q*sharedPairLaw ν x y (⋃ nm,A nm) ≤ sharedPairLaw ν x y (⋃ nm,D nm) := by
    rw [measure_iUnion hdisA hAm,measure_iUnion hdisD hDm,← ENNReal.tsum_mul_left]
    apply ENNReal.tsum_le_tsum
    intro nm
    refine shared_pair_record_event_future_lower ν ℓ x y _ _ (by omega) (by omega)
      (A nm) (layerPairPrefix_determined ℓ height x y H E nm) ?_ B hB hBD q ?_
    · intro P hP
      exact ⟨firstLayerHit_record ℓ height hproj H _ _ hP.1.1.1,
        firstLayerHit_record ℓ height hproj H _ _ hP.1.1.2,
        by rw [hproj,hproj,hP.1.1.1.1,hP.1.1.2.1]⟩
    · intro P hP
      exact hq _ _ hP.1.1.1.1 hP.1.1.2.1 hP.1.2
  exact hmain.trans (measure_mono (by
    intro P hP
    obtain ⟨nm,hP⟩ := Set.mem_iUnion.mp hP
    exact hC nm P hP.1 hP.2))