File size: 4,131 Bytes
4a56cd6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | import OAI.Probability.FirstPassage.EndpointConnection
namespace OAI
namespace PlanarFPP
open Set Finset
theorem gridConnections_exit_levels (w : Edge β β) (b mβ K A R H : β)
(hK : 0 β€ K) (hH : 1 β€ H) (k m J : β) (hJ : 1 β€ J)
(hg : w β gridConnectionsEvent b mβ K A R k m J)
(herr : β j, J β€ j β j β€ gridLastLevel m β (K+200)*(j : β)^2*gridWidth k j β€ H)
(x : β€) (hlo : -(A+4)*(2 : β)^m β€ (x : β))
(hhi : (exitColumn x m J : β) β€ (A+4)*(2 : β)^m)
(r : β) (hr : |r| β€ R*(2 : β)^k) (n : β) (hn : J+n β€ gridLastLevel m) :
ColumnConnection w b r mβ
(β i β range (n+1),16*((K+200)*((J+i : β) : β)^2*gridWidth k (J+i)))
(endpointTube b r H (x-gridMesh m J) (exitColumn x m J+gridMesh m J))
(-endpointColumn (-x) m (J+n)) (exitColumn x m J) := by
let T := exitColumn x m J
let d := gridMesh m J
have hfloor (j : β) : x β€ -endpointColumn (-x) m j := by
have h := (meshFloor_bounds (-x) (gridMesh m j) (gridMesh_pos m j)).1
change meshFloor (-x) (gridMesh m j) β€ -x at h
dsimp [endpointColumn]
omega
have hT (j : β) (hj : J β€ j) : -endpointColumn (-x) m j β€ T := by
have hm := endpointColumn_mono (-x) m hj
have hd := gridMesh_pos m J
dsimp [T,exitColumn,entranceColumn]
omega
induction n with
| zero =>
have hdiv : gridMesh m J β£ -endpointColumn (-x) m J := dvd_neg.mpr (meshFloor_dvd (-x) _)
have hb := gridConnections_block_connection w b mβ K A R H hK hH k m J hJ hg J
β¨le_refl _,by simpa using hnβ© (herr J le_rfl (by simpa using hn))
(-endpointColumn (-x) m J) T (x-d) (T+d) hdiv 1 (by omega)
(by simp [T,exitColumn,entranceColumn]; ring)
(hlo.trans (by exact_mod_cast hfloor J)) hhi
(by dsimp [d]; have hh := hfloor J; omega) (by rfl) r hr
simpa [T,d] using hb
| succ n ih =>
have hn' : J+n β€ gridLastLevel m := by omega
have hj : J β€ J+n+1 := by omega
have hjlast : J+n+1 β€ gridLastLevel m := by omega
have hp := ih hn'
obtain β¨N,hN,hstepβ© := endpointColumn_step (-x) m (J+n)
have hdiv : gridMesh m (J+n+1) β£ -endpointColumn (-x) m (J+n+1) :=
dvd_neg.mpr (meshFloor_dvd (-x) _)
have hdm : gridMesh m (J+n+1) β€ d := gridMesh_antitone m hj
have hbefore := hT (J+n) (by omega)
have hstart := hfloor (J+n+1)
have hb := gridConnections_block_connection w b mβ K A R H hK hH k m J hJ hg (J+n+1)
β¨hj,hjlastβ© (herr _ hj hjlast) (-endpointColumn (-x) m (J+n+1))
(-endpointColumn (-x) m (J+n)) (x-d) (T+d) hdiv N (by omega) (by omega)
(hlo.trans (by exact_mod_cast hstart))
((by exact_mod_cast hbefore : ((-endpointColumn (-x) m (J+n) : β€) : β) β€ (T : β)).trans hhi) (by omega) (by omega) r hr
have hc := hb.trans hp
rw [add_comm (16*((K+200)*((J+n+1 : β) : β)^2*gridWidth k (J+n+1)))] at hc
simpa only [sum_range_succ,Nat.add_assoc] using hc
theorem gridConnections_exit (w : Edge β β) (b mβ K A R H : β)
(hK : 0 β€ K) (hH : 1 β€ H) (k m J : β) (hJ : 1 β€ J) (hlast : J β€ gridLastLevel m)
(hg : w β gridConnectionsEvent b mβ K A R k m J)
(herr : β j, J β€ j β j β€ gridLastLevel m β (K+200)*(j : β)^2*gridWidth k j β€ H)
(p : Vertex) (hlo : -(A+4)*(2 : β)^m β€ (p.1 : β))
(hhi : (exitColumn p.1 m J : β) β€ (A+4)*(2 : β)^m) (hr : |transverse b p| β€ R*(2 : β)^k) :
β ds, p+displacement ds=endpointVertex b (transverse b p) (exitColumn p.1 m J) β§
pathCost w p ds β€ mβ*((exitColumn p.1 m J-p.1 : β€) : β)+
β i β range (gridLastLevel m-J+1),16*((K+200)*((J+i : β) : β)^2*gridWidth k (J+i)) β§
PathIn p ds (endpointTube b (transverse b p) H (p.1-gridMesh m J) (exitColumn p.1 m J+gridMesh m J)) := by
have hc := gridConnections_exit_levels w b mβ K A R H hK hH k m J hJ hg herr
p.1 hlo hhi (transverse b p) hr (gridLastLevel m-J) (by omega)
rw [Nat.add_sub_of_le hlast,endpointColumn_last,neg_neg] at hc
simpa only [ColumnConnection,endpointVertex_self] using hc
end PlanarFPP
end OAI
|