Download data/lean/OAI/Analysis/HardSphere/Geometry/EndpointDanger.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 20.4 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/HardSphere/Geometry/EndpointDanger.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Analysis/HardSphere/Geometry/EndpointDanger.lean
-
curl -L -o EndpointDanger.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/HardSphere/Geometry/EndpointDanger.lean
20.4 kB
| import Mathlib | |
| import OAI.Analysis.HardSphere.Geometry.EnnrealTsumFinset | |
| import OAI.Analysis.HardSphere.Geometry.NominalDrift | |
| namespace OAI | |
| noncomputable section | |
| open scoped BigOperators Classical | |
| open scoped BigOperators Classical | |
| open scoped BigOperators Classical | |
| open scoped ENNReal NNReal | |
| open scoped ENNReal | |
| namespace HardSphere.Lattice | |
| def endpointDanger {K : β} [NeZero K] (B : Finset (DiscreteTorus K)) (x : DiscreteTorus K) : Prop := | |
| β FβcandidateSets (torusRangeGraph K 1), FβB β§ β cβF, torusNear K F.card x c | |
| lemma fill_endpoint_danger {K : β} [NeZero K] (hK : 2<K) | |
| (B : Finset (DiscreteTorus K)) (r x : Vertex) (hr : torusProjection K rβB) | |
| (hsmall : (badComponent (torusRangeGraph K 1) B (torusProjection K r)).card<K) | |
| (C : Finset Vertex) | |
| (hC : (βC : Set Vertex)=periodicLift K 1 (badComponent (torusRangeGraph K 1) B (torusProjection K r)) r) | |
| (hx : xβexterior C) : endpointDanger B (torusProjection K x) := by | |
| let F := badComponent (torusRangeGraph K 1) B (torusProjection K r) | |
| have hrF : torusProjection K rβF := mem_own_badComponent _ _ hr | |
| obtain β¨D,hD,_,hspanβ© := small_periodic_lifts (a:=1) (by simpa using hK) F | |
| (by simpa using hsmall) (badComponent_preconnected _ _ _) r hrF | |
| have hCD : C=D := Finset.coe_injective (hC.trans hD.symm) | |
| subst D | |
| have hrC : rβC := by change rβ(βC:Set Vertex); rw [hC]; exact β¨hrF,.reflβ© | |
| have hbox := fill_subset_coordinateBox C (show xβfill C from hx) | |
| have hbound (i : Fin 3) : |x i-r i|β€F.card := by | |
| obtain β¨β¨l,hl,hlxβ©,β¨u,hu,hxuβ©β© := hbox i | |
| have hlow := hspan l hl r hrC i | |
| have hhigh := hspan u hu r hrC i | |
| obtain β¨hlowβ,hlowββ© := abs_le.mp hlow | |
| obtain β¨hhighβ,hhighββ© := abs_le.mp hhigh | |
| exact abs_le.mpr β¨by omega,by omegaβ© | |
| refine β¨F,badComponents_candidate _ B (Finset.mem_image.mpr β¨torusProjection K r,hr,rflβ©), | |
| badComponent_subset _ B _,torusProjection K r,hrF,projection_near hboundβ© | |
| lemma endpointsExterior_of_no_danger {K : β} [NeZero K] (hK : 2<K) | |
| (B : Finset (DiscreteTorus K)) (v w : Vertex) | |
| (hsmall : β zβB, (badComponent (torusRangeGraph K 1) B z).card<K) | |
| (hv : Β¬endpointDanger B (torusProjection K v)) (hw : Β¬endpointDanger B (torusProjection K w)) : | |
| endpointsExterior B v w := by | |
| intro r hr C hC | |
| constructor | |
| Β· by_contra hn | |
| exact hv (fill_endpoint_danger hK B r v hr (hsmall _ hr) C hC hn) | |
| Β· by_contra hn | |
| exact hw (fill_endpoint_danger hK B r w hr (hsmall _ hr) C hC hn) | |
| def acceptedEnvironment {K : β} [NeZero K] (a : β) (B : Finset (DiscreteTorus K)) (v w : Vertex) : Prop := | |
| Β¬LargeBadComponent (torusRangeGraph K a) B (K/(10*a)) β§ endpointsExterior B v w | |
| lemma small_star_of_no_large {K a : β} [NeZero K] (ha : 1β€a) | |
| (B : Finset (DiscreteTorus K)) (hB : Β¬LargeBadComponent (torusRangeGraph K a) B (K/(10*a))) : | |
| β zβB, (badComponent (torusRangeGraph K 1) B z).card<K := by | |
| intro z hz | |
| have hC : badComponent (torusRangeGraph K a) B zβbadComponents (torusRangeGraph K a) B := | |
| Finset.mem_image.mpr β¨z,hz,rflβ© | |
| have hcard : (badComponent (torusRangeGraph K a) B z).card<K/(10*a) := by | |
| by_contra hn | |
| exact hB β¨_,hC,by omegaβ© | |
| have hsub : badComponent (torusRangeGraph K 1) B z β badComponent (torusRangeGraph K a) B z := by | |
| intro y hy | |
| rcases (mem_badComponent _ _ _ _).mp hy with β¨hyB,hzyβ© | |
| exact (mem_badComponent _ _ _ _).mpr β¨hyB,hzy.mono (badGraph_graphMono (torusRangeGraph_mono ha) B)β© | |
| exact (Finset.card_le_card hsub).trans_lt (hcard.trans_le (Nat.div_le_self _ _)) | |
| lemma rejection_subset {K a : β} [NeZero K] (hK : 2<K) (ha : 1β€a) | |
| (B : Finset (DiscreteTorus K)) (v w : Vertex) (hE : Β¬acceptedEnvironment a B v w) : | |
| LargeBadComponent (torusRangeGraph K a) B (K/(10*a)) β¨ | |
| endpointDanger B (torusProjection K v) β¨ endpointDanger B (torusProjection K w) := by | |
| by_contra h | |
| push Not at h | |
| apply hE | |
| exact β¨h.1,endpointsExterior_of_no_danger hK B v w (small_star_of_no_large ha B h.1) h.2.1 h.2.2β© | |
| def endpointAnimals {K : β} [NeZero K] (x : DiscreteTorus K) (m : β) : Finset (Finset (DiscreteTorus K)) := | |
| (torusBall m x).biUnion (fun c β¦ rootedAnimals (torusRangeGraph K 1) c m) | |
| lemma endpointAnimals_card {K : β} [NeZero K] (x : DiscreteTorus K) (m : β) : | |
| (endpointAnimals x m).cardβ€(2*m+1)^3*(2^27)^m := by | |
| calc | |
| _ β€ β cβtorusBall m x, (rootedAnimals (torusRangeGraph K 1) c m).card := Finset.card_biUnion_le | |
| _ β€ β _cβtorusBall m x, (2^27)^m := by | |
| apply Finset.sum_le_sum | |
| intro c _ | |
| exact rootedAnimals_card_le _ 27 (by simpa using torusRange_degree (K:=K) 1) c m | |
| _ = (torusBall m x).card*(2^27)^m := by simp | |
| _ β€ _ := Nat.mul_le_mul_right _ (torusNear_ball_card _ _) | |
| lemma mem_endpointAnimals_card {K : β} [NeZero K] (x : DiscreteTorus K) (m : β) | |
| {F : Finset (DiscreteTorus K)} (hF : FβendpointAnimals x m) : F.card=m := by | |
| obtain β¨c,_,hFβ© := Finset.mem_biUnion.mp hF | |
| exact (Finset.mem_filter.mp hF).2.2.1 | |
| lemma danger_contains_endpointAnimal {K : β} [NeZero K] (B : Finset (DiscreteTorus K)) | |
| (x : DiscreteTorus K) (h : endpointDanger B x) : | |
| β m : β, β FβendpointAnimals x (m+1), FβB := by | |
| obtain β¨F,hF,hFB,c,hc,hxcβ© := h | |
| have hpos := Finset.card_pos.mpr (candidate_nonempty _ hF) | |
| have hcard : F.card-1+1=F.card := by omega | |
| refine β¨F.card-1,F,?_,hFBβ© | |
| rw [hcard] | |
| exact Finset.mem_biUnion.mpr β¨c,(mem_torusBall _ _ _).mpr hxc, | |
| Finset.mem_filter.mpr β¨Finset.mem_univ _,hc,rfl,fun y hy β¦ candidate_reach _ hF hc hyβ©β© | |
| theorem endpointDanger_probability {K : β} [NeZero K] | |
| (ΞΌ : PMF (Finset (DiscreteTorus K))) (p : ββ₯0β) (hbad : JointBadLaw ΞΌ p) (x : DiscreteTorus K) : | |
| (β' B, if endpointDanger B x then ΞΌ B else 0) β€ | |
| β' m : β, ((2*(m+1)+1)^3:β)*(((2^27:β):ββ₯0β)*p)^(m+1) := by | |
| have hpoint (B : Finset (DiscreteTorus K)) : | |
| (if endpointDanger B x then ΞΌ B else 0) β€ | |
| β' m : β, β FβendpointAnimals x (m+1), if FβB then ΞΌ B else 0 := by | |
| by_cases h : endpointDanger B x | |
| Β· obtain β¨m,F,hF,hFBβ© := danger_contains_endpointAnimal B x h | |
| rw [ite_eq_left h] | |
| exact le_trans (by | |
| simpa only [ite_eq_left hFB] using | |
| (Finset.single_le_sum (f := fun F : Finset (DiscreteTorus K) β¦ if FβB then ΞΌ B else 0) | |
| (fun _ _ β¦ zero_le) hF)) (ENNReal.le_tsum m) | |
| Β· rw [ite_eq_right h]; exact zero_le | |
| calc | |
| _ β€ β' B, β' m : β, β FβendpointAnimals x (m+1), if FβB then ΞΌ B else 0 := ENNReal.tsum_le_tsum hpoint | |
| _ = β' m : β, β FβendpointAnimals x (m+1), β' B, if FβB then ΞΌ B else 0 := by | |
| rw [ENNReal.tsum_comm] | |
| exact tsum_congr fun m β¦ ennreal_tsum_finset _ _ | |
| _ β€ β' m : β, β _FβendpointAnimals x (m+1), p^(m+1) := by | |
| apply ENNReal.tsum_le_tsum | |
| intro m | |
| apply Finset.sum_le_sum | |
| intro F hF | |
| simpa only [mem_endpointAnimals_card x (m+1) hF] using hbad F | |
| _ β€ _ := by | |
| apply ENNReal.tsum_le_tsum | |
| intro m | |
| simp only [Finset.sum_const,nsmul_eq_mul] | |
| calc | |
| _ β€ (((2*(m+1)+1)^3*(2^27)^(m+1):β):ββ₯0β)*p^(m+1) := by | |
| apply mul_le_mul' _ le_rfl | |
| exact_mod_cast endpointAnimals_card x (m+1) | |
| _ = _ := by simp only [Nat.cast_mul,Nat.cast_pow,mul_pow]; ring | |
| open scoped NNReal | |
| lemma endpoint_polynomial_le (m : β) : (2*(m+1)+1)^3β€27*8^m := by | |
| have hs : m+1β€2^m := by | |
| induction m with | |
| | zero => norm_num | |
| | succ m ih => | |
| rw [pow_succ] | |
| have hp := Nat.one_le_pow m 2 (by norm_num) | |
| omega | |
| calc | |
| _ β€ (3*2^m)^3 := Nat.pow_le_pow_left (by nlinarith) 3 | |
| _ = _ := by rw [mul_pow,β pow_mul,Nat.mul_comm m 3,pow_mul]; norm_num | |
| lemma endpoint_series_le (q : ββ₯0β) (hq : qβ€1/16) : | |
| (β' m : β, ((2*(m+1)+1)^3:β)*q^(m+1))β€54*q := by | |
| have h8 : (8:ββ₯0β)*qβ€1/2 := by | |
| calc | |
| _ β€ 8*(1/16:ββ₯0β) := mul_le_mul' le_rfl hq | |
| _ = _ := by | |
| have h : (8:ββ₯0)*(1/16)=1/2 := by norm_num | |
| have hh := congrArg (fun x : ββ₯0 β¦ (x:ββ₯0β)) h | |
| simpa only [ENNReal.coe_mul,ENNReal.coe_div (show (16:ββ₯0)β 0 by norm_num), | |
| ENNReal.coe_div (show (2:ββ₯0)β 0 by norm_num),ENNReal.coe_ofNat,ENNReal.coe_one] using hh | |
| calc | |
| _ β€ β' m : β, 27*q*((1/2:ββ₯0β)^m) := by | |
| apply ENNReal.tsum_le_tsum | |
| intro m | |
| calc | |
| _ β€ (27*8^m:ββ₯0β)*q^(m+1) := by | |
| apply mul_le_mul' _ le_rfl | |
| exact_mod_cast endpoint_polynomial_le m | |
| _ = 27*q*((8*q)^m) := by rw [pow_succ,mul_pow]; ring | |
| _ β€ _ := mul_le_mul' le_rfl (pow_le_pow_left' h8 m) | |
| _ = _ := by rw [ENNReal.tsum_mul_left,ENNReal.tsum_geometric]; norm_num; ring | |
| lemma rejection_probability {K a : β} [NeZero K] (hK : 2<K) (ha : 1β€a) | |
| (hm : 1β€K/(10*a)) (ΞΌ : PMF (Finset (DiscreteTorus K))) (p : ββ₯0β) | |
| (hbad : JointBadLaw ΞΌ p) (v w : Vertex) : | |
| (β' B, if Β¬acceptedEnvironment a B v w then ΞΌ B else 0)β€ | |
| (K:ββ₯0β)^3*(((2^((2*a+1)^3):β):ββ₯0β)*p)^(K/(10*a))+ | |
| 2*β' m : β, ((2*(m+1)+1)^3:β)*(((2^27:β):ββ₯0β)*p)^(m+1) := by | |
| have hpoint (B : Finset (DiscreteTorus K)) : | |
| (if Β¬acceptedEnvironment a B v w then ΞΌ B else 0)β€ | |
| (if LargeBadComponent (torusRangeGraph K a) B (K/(10*a)) then ΞΌ B else 0)+ | |
| (if endpointDanger B (torusProjection K v) then ΞΌ B else 0)+ | |
| (if endpointDanger B (torusProjection K w) then ΞΌ B else 0) := by | |
| by_cases hE : Β¬acceptedEnvironment a B v w | |
| Β· rw [ite_eq_left hE] | |
| rcases rejection_subset hK ha B v w hE with h|h|h | |
| Β· rw [ite_eq_left h]; exact le_add_of_le_left le_self_add | |
| Β· rw [ite_eq_left h]; exact le_add_of_le_left le_add_self | |
| Β· rw [ite_eq_left h]; exact le_add_self | |
| Β· rw [ite_eq_right hE]; exact zero_le | |
| calc | |
| _ β€ _ := ENNReal.tsum_le_tsum hpoint | |
| _ = _ := by rw [ENNReal.tsum_add,ENNReal.tsum_add] | |
| _ β€ _ := add_le_add (add_le_add | |
| (largeBadComponent_probability (torusRangeGraph K a) ((2*a+1)^3) | |
| (torusRange_degree a) ΞΌ p hbad (K/(10*a)) hm) | |
| (endpointDanger_probability ΞΌ p hbad (torusProjection K v))) | |
| (endpointDanger_probability ΞΌ p hbad (torusProjection K w)) | |
| _ = _ := by | |
| simp only [DiscreteTorus,Fintype.card_fun,Fintype.card_fin,ZMod.card,Nat.cast_pow] | |
| ring | |
| lemma large_rejection_eventually (a : β) (ha : 1β€a) : | |
| βαΆ K : β in Filter.atTop, (K:β)^3*(1/2:β)^(K/(10*a))β€1/4 := by | |
| let d := 10*a | |
| have hd : 0<d := by dsimp [d]; omega | |
| have hl := tendsto_pow_const_mul_const_pow_of_lt_one 3 (by norm_num : (0:β)β€1/2) | |
| (by norm_num : (1/2:β)<1) | |
| have hlim : Filter.Tendsto (fun j : β β¦ ((2*d:β):β)^3*((j:β)^3*(1/2:β)^j)) Filter.atTop (nhds 0) := by | |
| simpa using hl.const_mul (((2*d:β):β)^3) | |
| have hSmall : βαΆ j : β in Filter.atTop, | |
| ((2*d:β):β)^3*((j:β)^3*(1/2:β)^j)β€1/4 := | |
| (hlim.eventually (gt_mem_nhds (by norm_num : (0:β)<1/4))).mono (fun _ h β¦ h.le) | |
| have hdiv := Nat.tendsto_div_const_atTop (ne_of_gt hd) | |
| filter_upwards [hdiv.eventually hSmall,Filter.eventually_ge_atTop d] with K hsm hKd | |
| have hj : 1β€K/d := (Nat.le_div_iff_mul_le hd).mpr (by simpa using hKd) | |
| have hK : Kβ€(2*d)*(K/d) := by | |
| have hb := Nat.lt_mul_div_succ K hd | |
| nlinarith | |
| calc | |
| _ β€ (((2*d:β):β)*(K/d:β))^3*(1/2:β)^(K/d) := by | |
| apply mul_le_mul_of_nonneg_right _ (by positivity) | |
| apply pow_le_pow_leftβ (by positivity) | |
| exact_mod_cast hK | |
| _ = ((2*d:β):β)^3*((K/d:β)^3*(1/2:β)^(K/d)) := by ring | |
| _ β€ _ := hsm | |
| lemma pmf_complement_half {Ξ± : Type*} (ΞΌ : PMF Ξ±) (E : Ξ± β Prop) | |
| (h : (β' x, if Β¬E x then ΞΌ x else 0)β€(1/2:ββ₯0β)) : | |
| (1/2:ββ₯0β)β€β' x, if E x then ΞΌ x else 0 := by | |
| have he : (β' x, if E x then ΞΌ x else 0)+(β' x, if Β¬E x then ΞΌ x else 0)=1 := by | |
| rw [β ENNReal.tsum_add] | |
| convert ΞΌ.tsum_coe using 1 | |
| apply tsum_congr | |
| intro x | |
| by_cases hx : E x <;> simp [hx] | |
| have hn : (β' x, if Β¬E x then ΞΌ x else 0)β β := ne_of_lt (h.trans_lt (by norm_num)) | |
| calc | |
| (1/2:ββ₯0β)=1-(1/2) := by norm_num | |
| _ β€ 1-(β' x, if Β¬E x then ΞΌ x else 0) := tsub_le_tsub_left h 1 | |
| _ = _ := by rw [β he,ENNReal.add_sub_cancel_right hn] | |
| theorem acceptedEnvironment_mass (a : β) (ha : 1β€a) : | |
| β pβ : β, 0<pβ β§ β Kβ : β, β K : β, Kββ€K β β _ : NeZero K, | |
| β ΞΌ : PMF (Finset (DiscreteTorus K)), β p : β, 0β€p β pβ€pβ β | |
| JointBadLaw ΞΌ (ENNReal.ofReal p) β β v w : Vertex, | |
| (1/2:ββ₯0β)β€β' B, if acceptedEnvironment a B v w then ΞΌ B else 0 := by | |
| let A : β := (2:β)^((2*a+1)^3) | |
| let D : β := (2:β)^27 | |
| have hA : 0<A := by dsimp [A]; positivity | |
| have hD : 0<D := by dsimp [D]; positivity | |
| let pβ : β := min ((1/432)/D) ((1/2)/A) | |
| have hpβ : 0<pβ := lt_min (div_pos (by norm_num) hD) (div_pos (by norm_num) hA) | |
| obtain β¨M,hMβ© := Filter.eventually_atTop.mp (large_rejection_eventually a ha) | |
| refine β¨pβ,hpβ,max M (10*a+3),?_β© | |
| intro K hK inst ΞΌ p hp hpp hbad v w | |
| have hKM : Mβ€K := (le_max_left _ _).trans hK | |
| have hKd : 10*a+3β€K := (le_max_right _ _).trans hK | |
| have hK2 : 2<K := by omega | |
| have hm : 1β€K/(10*a) := (Nat.le_div_iff_mul_le (by omega)).mpr (by omega) | |
| have hqD : D*pβ€1/432 := by | |
| have h := (le_div_iffβ hD).mp (hpp.trans (min_le_left _ _)) | |
| nlinarith | |
| have hqA : A*pβ€1/2 := by | |
| have h := (le_div_iffβ hA).mp (hpp.trans (min_le_right _ _)) | |
| nlinarith | |
| have hDeq : ((2^27:β):ββ₯0β)*ENNReal.ofReal p=ENNReal.ofReal (D*p) := by | |
| rw [ENNReal.ofReal_mul hD.le] | |
| simp only [D,ENNReal.ofReal_pow (by norm_num : (0:β)β€2),ENNReal.ofReal_ofNat,Nat.cast_pow,Nat.cast_ofNat] | |
| have hAeq : ((2^((2*a+1)^3):β):ββ₯0β)*ENNReal.ofReal p=ENNReal.ofReal (A*p) := by | |
| rw [ENNReal.ofReal_mul hA.le] | |
| simp only [A,ENNReal.ofReal_pow (by norm_num : (0:β)β€2),ENNReal.ofReal_ofNat,Nat.cast_pow,Nat.cast_ofNat] | |
| have hqDen : ENNReal.ofReal (D*p)β€1/16 := by | |
| calc | |
| _ β€ ENNReal.ofReal (1/16:β) := ENNReal.ofReal_le_ofReal (by linarith) | |
| _ = _ := by rw [ENNReal.ofReal_div_of_pos (by norm_num),ENNReal.ofReal_one,ENNReal.ofReal_ofNat] | |
| have hseries : (β' m : β, ((2*(m+1)+1)^3:β)* | |
| (((2^27:β):ββ₯0β)*ENNReal.ofReal p)^(m+1))β€ENNReal.ofReal (1/8:β) := by | |
| rw [hDeq] | |
| refine (endpoint_series_le _ hqDen).trans ?_ | |
| calc | |
| _ = ENNReal.ofReal (54*(D*p)) := by rw [ENNReal.ofReal_mul (p:=54) (q:=D*p) (by norm_num),ENNReal.ofReal_ofNat] | |
| _ β€ _ := ENNReal.ofReal_le_ofReal (by linarith) | |
| have hlarge : (K:ββ₯0β)^3*(((2^((2*a+1)^3):β):ββ₯0β)*ENNReal.ofReal p)^(K/(10*a))β€ | |
| ENNReal.ofReal (1/4:β) := by | |
| rw [hAeq] | |
| calc | |
| _ β€ (K:ββ₯0β)^3*(ENNReal.ofReal (1/2:β))^(K/(10*a)) := | |
| mul_le_mul' le_rfl (pow_le_pow_left' (ENNReal.ofReal_le_ofReal hqA) _) | |
| _ = ENNReal.ofReal ((K:β)^3*(1/2:β)^(K/(10*a))) := by | |
| rw [ENNReal.ofReal_mul (by positivity),ENNReal.ofReal_pow (by positivity), | |
| ENNReal.ofReal_pow (by norm_num),ENNReal.ofReal_natCast] | |
| _ β€ _ := ENNReal.ofReal_le_ofReal (hM K hKM) | |
| apply pmf_complement_half ΞΌ (fun B β¦ acceptedEnvironment a B v w) | |
| refine (rejection_probability hK2 ha hm ΞΌ _ hbad v w).trans ?_ | |
| refine (add_le_add hlarge (mul_le_mul' le_rfl hseries)).trans_eq ?_ | |
| rw [show (2:ββ₯0β)=ENNReal.ofReal (2:β) by norm_num, | |
| β ENNReal.ofReal_mul (by norm_num),β ENNReal.ofReal_add (by norm_num) (by norm_num)] | |
| norm_num [ENNReal.ofReal_div_of_pos] | |
| def SimpleGoodPath {K : β} (B : Finset (DiscreteTorus K)) (x y : DiscreteTorus K) := | |
| {p : (torusNearestGraph K).Walk x y // p.IsPath β§ β zβp.support, zβB} | |
| lemma exists_nominal_detour {K m n : β} [NeZero K] (hK : 2<K) (R : β) | |
| (hn : 0<n) (ht : n/2β€3^m) (v : Vertex) (Ξβ Ξβ : β€) | |
| (hΞβ : |Ξβ|β€2*n) (hΞβ : |Ξβ|β€2*n) (B : Finset (DiscreteTorus K)) | |
| (hB : acceptedEnvironment (R+2) B v (v+![(n:β€),Ξβ,Ξβ])) (w : PairNoise m) : | |
| β p : SimpleGoodPath B (torusProjection K v) (torusProjection K (v+![(n:β€),Ξβ,Ξβ])), | |
| β xβp.val.support, | |
| xβ(nominalCover (nominalVertices m n v Ξβ Ξβ w)).image (torusProjection K) β¨ | |
| shellAttachment R B ((nominalCover (nominalVertices m n v Ξβ Ξβ w)).image (torusProjection K)) x := by | |
| let U := nominalVertices m n v Ξβ Ξβ w | |
| have hi : U 0=v := nominal_initial m n v Ξβ Ξβ w | |
| have hf : U (Fin.last n)=v+![(n:β€),Ξβ,Ξβ] := nominal_final m n hn v Ξβ Ξβ w | |
| have hv : vβnominalCover U := hi βΈ nominal_mem_cover U 0 | |
| have hw : v+![(n:β€),Ξβ,Ξβ]βnominalCover U := hf βΈ nominal_mem_cover U (Fin.last n) | |
| have hwalk : withinReach nearestStep (β(nominalCover U)) v (v+![(n:β€),Ξβ,Ξβ]) := by | |
| simpa only [hi,hf] using nominalCover_reach U (nominal_speed m n hn ht v Ξβ Ξβ hΞβ hΞβ w) | |
| obtain β¨p,hp,hattachβ© := periodic_good_detour hK R B | |
| (small_star_of_no_large (by omega) B hB.1) (nominalCover U) hv hw hB.2 hwalk | |
| exact β¨β¨p,hp,fun x hx β¦ (hattach x hx).1β©,fun x hx β¦ (hattach x hx).2β© | |
| def detourSample {K m n : β} [NeZero K] (hK : 2<K) (R : β) | |
| (hn : 0<n) (ht : n/2β€3^m) (v : Vertex) (Ξβ Ξβ : β€) | |
| (hΞβ : |Ξβ|β€2*n) (hΞβ : |Ξβ|β€2*n) (B : Finset (DiscreteTorus K)) | |
| (hB : acceptedEnvironment (R+2) B v (v+![(n:β€),Ξβ,Ξβ])) (w : PairNoise m) : | |
| SimpleGoodPath B (torusProjection K v) (torusProjection K (v+![(n:β€),Ξβ,Ξβ])) := | |
| Classical.choose (exists_nominal_detour hK R hn ht v Ξβ Ξβ hΞβ hΞβ B hB w) | |
| lemma detourSample_attachment {K m n : β} [NeZero K] (hK : 2<K) (R : β) | |
| (hn : 0<n) (ht : n/2β€3^m) (v : Vertex) (Ξβ Ξβ : β€) | |
| (hΞβ : |Ξβ|β€2*n) (hΞβ : |Ξβ|β€2*n) (B : Finset (DiscreteTorus K)) | |
| (hB : acceptedEnvironment (R+2) B v (v+![(n:β€),Ξβ,Ξβ])) (w : PairNoise m) : | |
| β xβ(detourSample hK R hn ht v Ξβ Ξβ hΞβ hΞβ B hB w).val.support, | |
| xβ(nominalCover (nominalVertices m n v Ξβ Ξβ w)).image (torusProjection K) β¨ | |
| shellAttachment R B ((nominalCover (nominalVertices m n v Ξβ Ξβ w)).image (torusProjection K)) x := | |
| Classical.choose_spec (exists_nominal_detour hK R hn ht v Ξβ Ξβ hΞβ hΞβ B hB w) | |
| def goodPathKernel {K m n : β} [NeZero K] (hK : 2<K) (R : β) | |
| (hn : 0<n) (ht : n/2β€3^m) (v : Vertex) (Ξβ Ξβ : β€) | |
| (hΞβ : |Ξβ|β€2*n) (hΞβ : |Ξβ|β€2*n) (B : Finset (DiscreteTorus K)) | |
| (hB : acceptedEnvironment (R+2) B v (v+![(n:β€),Ξβ,Ξβ])) : | |
| PMF (SimpleGoodPath B (torusProjection K v) (torusProjection K (v+![(n:β€),Ξβ,Ξβ]))) := | |
| (pairLaw m).map (detourSample hK R hn ht v Ξβ Ξβ hΞβ hΞβ B hB) | |
| lemma pmf_map_expectation {Ξ± Ξ² : Type*} (ΞΌ : PMF Ξ±) (f : Ξ± β Ξ²) (g : Ξ² β ββ₯0β) : | |
| (β' y, (ΞΌ.map f) y*g y)=β' x, ΞΌ x*g (f x) := by | |
| simp_rw [PMF.map_apply,β ENNReal.tsum_mul_right] | |
| rw [ENNReal.tsum_comm] | |
| apply tsum_congr | |
| intro x | |
| simp only [ite_mul,zero_mul] | |
| simp | |
| def pathNoiseTranspose (m : β) : FourNoise m β PairNoise m Γ PairNoise m where | |
| toFun w := (firstPathNoise w,secondPathNoise w) | |
| invFun w := ((w.1.1,w.2.1),(w.1.2,w.2.2)) | |
| left_inv _ := rfl | |
| right_inv _ := rfl | |
| lemma fourLaw_transpose (m : β) (w : FourNoise m) : | |
| fourLaw m w=pairLaw m (firstPathNoise w)*pairLaw m (secondPathNoise w) := by | |
| rcases w with β¨β¨a,bβ©,β¨c,dβ©β© | |
| simp only [fourLaw,pairLaw,firstPathNoise,secondPathNoise,independentPair_apply] | |
| ring | |
| lemma pair_expectation_transpose (m : β) (f : PairNoise m β PairNoise m β ββ₯0β) : | |
| (β' x, pairLaw m x*β' y, pairLaw m y*f x y)= | |
| β' w, fourLaw m w*f (firstPathNoise w) (secondPathNoise w) := by | |
| simp_rw [β ENNReal.tsum_mul_left,β mul_assoc] | |
| rw [β ENNReal.tsum_prod] | |
| have h := (pathNoiseTranspose m).tsum_eq (fun z β¦ pairLaw m z.1*pairLaw m z.2*f z.1 z.2) | |
| calc | |
| _ = β' w, pairLaw m (firstPathNoise w)*pairLaw m (secondPathNoise w)*f (firstPathNoise w) (secondPathNoise w) := h.symm | |
| _ = _ := by simp_rw [fourLaw_transpose] | |
| end HardSphere.Lattice | |
| end | |
| end OAI | |