File size: 4,624 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 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | import Mathlib
namespace OAI
open Set MeasureTheory intervalIntegral
universe u v
namespace FeasibleShift
variable {V : Type u} [Fintype V] [DecidableEq V]
noncomputable def component (G : SimpleGraph V) (x : V) : Finset V := by
classical
exact Finset.univ.filter (G.Reachable x)
noncomputable def contactGraph (G : SimpleGraph V) (h : V β β) (s : β) : SimpleGraph V where
Adj x y := G.Adj x y β§ 1 - |h x - h y| β€ s
symm := β¨by intro x y hxy; simpa only [abs_sub_comm] using And.intro hxy.1.symm hxy.2β©
loopless := β¨by intro x hx; exact G.irrefl hx.1β©
noncomputable def prescription (G : SimpleGraph V) (ground : Finset V)
(f : V β β) (x : V) : β :=
if Disjoint (component G x) ground then
(β y β component G x, f y) / (component G x).card else 0
noncomputable def averagedShift (G : SimpleGraph V) (ground : Finset V)
(f h : V β β) (sβ sβ : β) (x : V) : β :=
(sβ - sβ)β»ΒΉ * β« s in sβ..sβ, prescription (contactGraph G h s) ground f x
abbrev FreeSites (pins : Finset V) := {x : V // x β pins}
noncomputable def extendHeight (pins : Finset V) (Ξ² : V β β)
(h : FreeSites pins β β) (x : V) : β :=
if hx : x β pins then Ξ² x else h β¨x, hxβ©
noncomputable def freeShift (G : SimpleGraph V) (ground pins : Finset V)
(Ξ² f : V β β) (sβ sβ : β) (h : FreeSites pins β β) (x : FreeSites pins) : β :=
averagedShift G ground f (extendHeight pins Ξ² h) sβ sβ x
noncomputable def heightPolytope (G : SimpleGraph V) (pins walls : Finset V)
(Ξ² : V β β) (I : V β Set β) : Set (FreeSites pins β β) :=
{h | (β x y, G.Adj x y β |extendHeight pins Ξ² h x - extendHeight pins Ξ² h y| β€ 1) β§
β x β walls, extendHeight pins Ξ² h x β I x}
noncomputable def neighbors (G : SimpleGraph V) (x : V) : Finset V := by
classical
exact Finset.univ.filter (G.Adj x)
noncomputable def shiftGraph (G : SimpleGraph V) (ground : Finset V) : SimpleGraph V where
Adj x y := G.Adj x y β§ Β¬ (x β ground β§ y β ground)
symm := β¨by intro x y h; exact β¨h.1.symm, fun hh => h.2 β¨hh.2, hh.1β©β©β©
loopless := β¨fun x h => G.irrefl h.1β©
noncomputable def localSites (G : SimpleGraph V) (ground : Finset V) : Finset V := by
classical
exact Finset.univ.filter fun x => x β ground β¨ β y, y β ground β§ G.Adj x y
structure ShiftData (W : Type v) [Fintype W] [DecidableEq W]
(n D Db B : β) (Ο : ENNReal) (sstar L M N : β) where
graph : SimpleGraph V
ground : Finset V
pins : Finset V
walls : Finset V
pins_ground : pins β ground
walls_ground : walls β ground
boundary : V β β
intervals : V β Set β
prescribed : V β β
prescribed_ground : β x β ground, prescribed x = 0
prescribed_bound : β x, |prescribed x| β€ M
prescribed_gradient : β x y, graph.Adj x y β |prescribed x - prescribed y| β€ L / n
vertex_count : ((localSites graph ground).card : β) β€ N * (n : β)^2
degree : β x, (neighbors graph x).card β€ D
polytope_measurable : MeasurableSet (heightPolytope graph pins walls boundary intervals)
polytope_positive : volume (heightPolytope graph pins walls boundary intervals) β 0
polytope_finite : volume (heightPolytope graph pins walls boundary intervals) β β€
boxGraph : SimpleGraph W
box_degree : β w, (neighbors boxGraph w).card β€ Db
boxMap : V β W
box_fiber : β w, (Finset.univ.filter fun x => boxMap x = w).card β€ B
box_adjacent : β x y, graph.Adj x y β boxMap x = boxMap y β¨ boxGraph.Adj (boxMap x) (boxMap y)
badBoxes : (FreeSites pins β β) β Set W
contact_bad : β h x y, (contactGraph (shiftGraph graph ground)
(extendHeight pins boundary h) sstar).Adj x y β boxMap x β badBoxes h β§ boxMap y β badBoxes h
sparse : β A : Finset W, (ProbabilityTheory.cond volume
(heightPolytope graph pins walls boundary intervals)) {h | β w β A, w β badBoxes h} β€ Ο^A.card
namespace ShiftData
variable {W : Type v} [Fintype W] [DecidableEq W]
variable {n D Db B : β} {Ο : ENNReal} {sstar L M N : β}
variable (S : ShiftData (V := V) W n D Db B Ο sstar L M N)
noncomputable def polytope := heightPolytope S.graph S.pins S.walls S.boundary S.intervals
noncomputable def law := ProbabilityTheory.cond volume S.polytope
noncomputable def shift (sβ sβ : β) :=
freeShift (shiftGraph S.graph S.ground) S.ground S.pins S.boundary S.prescribed sβ sβ
noncomputable def map (sβ sβ : β) (h : FreeSites S.pins β β) := h + S.shift sβ sβ h
end ShiftData
end FeasibleShift
end OAI
|