Download data/lean/OAI/Probability/FKPressure/Basic.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 148 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/FKPressure/Basic.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/FKPressure/Basic.lean
-
curl -L -o Basic.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/FKPressure/Basic.lean
148 kB
import Mathlib
namespace OAI
section
noncomputable section
open Set Filter MeasureTheory ProbabilityTheory
open scoped Topology ENNReal NNReal
namespace BelowOne
abbrev Time := Set.Icc (0 : β) 1
abbrev Curve := C(Time, β)
abbrev GridPoint := β€ Γ β€
instance : MeasurableSpace Curve := borel Curve
instance : BorelSpace Curve := β¨rflβ©
structure IncreasingReparam where
homeomorph : Time ββ Time
increasing : StrictMono homeomorph
instance : Inhabited IncreasingReparam :=
β¨β¨Homeomorph.refl _, fun _ _ h => hβ©β©
def curveDistance (Ξ± Ξ² : Curve) : β :=
sInf {r : β | β Ο Ο : IncreasingReparam,
r = sSup (Set.range fun t : Time => dist (Ξ± (Ο.homeomorph t)) (Ξ² (Ο.homeomorph t)))}
def IsCurveTest (f : Curve β β) : Prop :=
(β C : β, β Ξ±, |f Ξ±| β€ C) β§
β Ξ±, β Ξ΅ > 0, β r > 0, β Ξ², curveDistance Ξ± Ξ² < r β |f Ξ± - f Ξ²| < Ξ΅
def gridEmbed (Ξ΄ : β) (v : GridPoint) : β :=
β¨Ξ΄ * v.1, Ξ΄ * v.2β©
def gridNeighbor (v w : GridPoint) : Prop :=
(v.1 = w.1 β§ |v.2 - w.2| = 1) β¨
(v.2 = w.2 β§ |v.1 - w.1| = 1)
def interpolate (points : List β) (t : Time) : β :=
if (t : β) = 1 then points.getLast?.getD 0 else
let s := (t : β) * (points.length - 1)
let j := Nat.floor s
let ΞΈ : β := ((s - j : β) : β)
(1 - ΞΈ) * points[j]?.getD 0 + ΞΈ * points[j + 1]?.getD 0
def cycleNext {n : β} (hn : 0 < n) (i : Fin n) : Fin n :=
β¨(i.val + 1) % n, Nat.mod_lt _ hnβ©
def cyclePrev {n : β} (hn : 0 < n) (i : Fin n) : Fin n :=
β¨(i.val + n - 1) % n, Nat.mod_lt _ hnβ©
structure SmoothMarkedJordan where
domain : Set β
isOpen : IsOpen domain
isConnected : IsConnected domain
bounded : Bornology.IsBounded domain
boundary : β β β
smooth : ContDiff β (β(β€ : ββ)) boundary
periodic : Function.Periodic boundary 1
simple : Set.InjOn boundary (Set.Ico 0 1)
regular : β t, deriv boundary t β 0
frontier : frontier domain = boundary '' Set.Icc 0 1
positive_orientation :
0 < β« t in (0 : β)..1,
(boundary t).re * (deriv boundary t).im -
(boundary t).im * (deriv boundary t).re
secondMark : β
secondMark_pos : 0 < secondMark
secondMark_lt : secondMark < 1
def SmoothMarkedJordan.a (D : SmoothMarkedJordan) := D.boundary 0
def SmoothMarkedJordan.b (D : SmoothMarkedJordan) := D.boundary D.secondMark
structure LatticePolygon (Ξ΄ : β) where
domain : Set β
isOpen : IsOpen domain
isConnected : IsConnected domain
bounded : Bornology.IsBounded domain
nVertices : β
vertices : Fin nVertices β GridPoint
vertices_injective : Function.Injective vertices
all_vertices : β v : GridPoint,
(β i, vertices i = v) β gridEmbed Ξ΄ v β closure domain
nBoundary : β
boundary_pos : 0 < nBoundary
boundary_three : 3 β€ nBoundary
boundaryVertex : Fin nBoundary β Fin nVertices
boundary_injective : Function.Injective boundaryVertex
boundary_neighbor : β i,
gridNeighbor (vertices (boundaryVertex i))
(vertices (boundaryVertex (cycleNext boundary_pos i)))
boundary_segment : β i,
segment β (gridEmbed Ξ΄ (vertices (boundaryVertex i)))
(gridEmbed Ξ΄ (vertices (boundaryVertex (cycleNext boundary_pos i)))) β
closure domain
boundaryCurve : Curve
boundary_interpolation : β t,
boundaryCurve t = interpolate
((List.ofFn fun i => gridEmbed Ξ΄ (vertices (boundaryVertex i))) ++
[gridEmbed Ξ΄ (vertices (boundaryVertex β¨0, boundary_posβ©))]) t
boundary_simple : β s t : Time,
(s : β) < 1 β (t : β) < 1 β boundaryCurve s = boundaryCurve t β s = t
frontier : frontier domain = Set.range boundaryCurve
positive_orientation :
0 < β i : Fin nBoundary,
((gridEmbed Ξ΄ (vertices (boundaryVertex i))).re *
(gridEmbed Ξ΄ (vertices (boundaryVertex (cycleNext boundary_pos i)))).im -
(gridEmbed Ξ΄ (vertices (boundaryVertex i))).im *
(gridEmbed Ξ΄ (vertices (boundaryVertex (cycleNext boundary_pos i)))).re)
secondMark : Fin nBoundary
secondMark_ne : secondMark.val β 0
wiredForward : Bool
namespace LatticePolygon
variable {Ξ΄ : β} (P : LatticePolygon Ξ΄)
abbrev Vertex := Fin P.nVertices
def position (v : P.Vertex) : β := gridEmbed Ξ΄ (P.vertices v)
def graph : SimpleGraph P.Vertex :=
SimpleGraph.fromRel fun v w =>
gridNeighbor (P.vertices v) (P.vertices w) β§
segment β (P.position v) (P.position w) β closure P.domain
def edges : Finset (Sym2 P.Vertex) := P.graph.edgeSet.toFinite.toFinset
def first : Fin P.nBoundary := β¨0, P.boundary_posβ©
def aVertex : P.Vertex := P.boundaryVertex P.first
def bVertex : P.Vertex := P.boundaryVertex P.secondMark
def wiredVertices : Finset P.Vertex :=
Finset.univ.filter fun v => β i : Fin P.nBoundary,
P.boundaryVertex i = v β§
if P.wiredForward then i.val β€ P.secondMark.val
else P.secondMark.val β€ i.val β¨ i.val = 0
def wiredEdges : Finset (Sym2 P.Vertex) :=
((Finset.univ : Finset (Fin P.nBoundary)).filter fun i =>
if P.wiredForward then i.val < P.secondMark.val
else P.secondMark.val β€ i.val).image fun i =>
s(P.boundaryVertex i, P.boundaryVertex (cycleNext P.boundary_pos i))
def wiredConfiguration (A : Finset (Sym2 P.Vertex)) : SimpleGraph P.Vertex :=
SimpleGraph.fromRel fun v w =>
(s(v,w) β A) β¨ (v β P.wiredVertices β§ w β P.wiredVertices)
def componentCount (A : Finset (Sym2 P.Vertex)) : β :=
Nat.card (P.wiredConfiguration A).ConnectedComponent
def configurationWeight (q : β) (A : Finset (Sym2 P.Vertex)) : β :=
let p := Real.sqrt q / (1 + Real.sqrt q)
p ^ A.card * (1 - p) ^ (P.edges.card - A.card) * q ^ P.componentCount A
def partitionFunction (q : β) : β :=
β A β P.edges.powerset, P.configurationWeight q A
structure Dart where
source : P.Vertex
target : P.Vertex
adjacent : P.graph.Adj source target
instance : Finite P.Dart :=
Finite.of_injective (fun e : P.Dart => (e.source, e.target)) (by
rintro β¨s, t, hβ© β¨s', t', h'β© he
obtain β¨rfl, rflβ© := Prod.mk.inj he
rfl)
instance : Fintype P.Dart := Fintype.ofFinite _
instance : DecidableEq P.Dart := Classical.decEq _
def Dart.reverse (e : P.Dart) : P.Dart :=
β¨e.target, e.source, P.graph.adj_symm e.adjacentβ©
def dartPosition (e : P.Dart) : β :=
(P.position e.source + P.position e.target) / 2
def dartDirection (e : P.Dart) : β :=
if (P.vertices e.source).1 < (P.vertices e.target).1 then 0 else
if (P.vertices e.source).2 < (P.vertices e.target).2 then 1 else
if (P.vertices e.target).1 < (P.vertices e.source).1 then 2 else 3
def angularSteps (clockwise : Bool) (e f : P.Dart) : β :=
let k := if clockwise then
(P.dartDirection e + 4 - P.dartDirection f) % 4 else
(P.dartDirection f + 4 - P.dartDirection e) % 4
if k = 0 then 4 else k
def IsNextDart (clockwise : Bool) (e f : P.Dart) : Prop :=
e.source = f.source β§ β g : P.Dart, e.source = g.source β
P.angularSteps clockwise e f β€ P.angularSteps clockwise e g
def IsSwitched (A : Finset (Sym2 P.Vertex)) (e f : P.Dart) : Prop :=
if s(e.source, e.target) β A βͺ P.wiredEdges then f = e.reverse P else f = e
def IsContourSuccessor (A : Finset (Sym2 P.Vertex)) (e f : P.Dart) : Prop :=
if P.wiredForward then β h, P.IsNextDart true e h β§ P.IsSwitched A h f
else β h, P.IsSwitched A e h β§ P.IsNextDart false h f
def IsInitialDart (A : Finset (Sym2 P.Vertex)) (e : P.Dart) : Prop :=
if P.wiredForward then β h : P.Dart,
h.source = P.aVertex β§
h.target = P.boundaryVertex (cyclePrev P.boundary_pos P.first) β§
P.IsSwitched A h e
else e.source = P.aVertex β§
e.target = P.boundaryVertex (cycleNext P.boundary_pos P.first)
def IsFinalDart (A : Finset (Sym2 P.Vertex)) (e : P.Dart) : Prop :=
if P.wiredForward then e.source = P.bVertex β§
e.target = P.boundaryVertex (cycleNext P.boundary_pos P.secondMark)
else β h : P.Dart,
h.source = P.bVertex β§
h.target = P.boundaryVertex (cyclePrev P.boundary_pos P.secondMark) β§
P.IsSwitched A h e
def IsInterface (A : Finset (Sym2 P.Vertex)) (Ξ· : Curve) : Prop :=
β walk : List P.Dart,
walk β [] β§ walk.Nodup β§
(β e, walk.head? = some e β§ P.IsInitialDart A e) β§
(β e, walk.getLast? = some e β§ P.IsFinalDart A e) β§
walk.IsChain (P.IsContourSuccessor A) β§
β t, Ξ· t = interpolate
(P.position P.aVertex :: walk.map P.dartPosition ++ [P.position P.bVertex]) t
end LatticePolygon
structure MarkedApproximation (D : SmoothMarkedJordan) where
mesh : β β β
mesh_pos : β n, 0 < mesh n
mesh_zero : Tendsto mesh atTop (π 0)
polygon : β n, LatticePolygon (mesh n)
boundaryReparam : β β IncreasingReparam
boundary_uniform :
Tendsto (fun n => sSup (Set.range fun t : Time =>
dist ((polygon n).boundaryCurve ((boundaryReparam n).homeomorph t))
(D.boundary t))) atTop (π 0)
marked_uniform :
Tendsto (fun n =>
(((boundaryReparam n).homeomorph.symm
β¨((polygon n).secondMark.val : β) / (polygon n).nBoundary,
by
have hn : (0 : β) < (polygon n).nBoundary := by
exact_mod_cast (polygon n).boundary_pos
constructor
Β· exact div_nonneg (Nat.cast_nonneg _) hn.le
Β· exact (div_le_one hn).2 (by exact_mod_cast (polygon n).secondMark.isLt.le)β© : Time) : β))
atTop (π D.secondMark)
interface : β n, Finset (Sym2 (polygon n).Vertex) β Curve
interface_drawing : β n A, A β (polygon n).edges β
(polygon n).IsInterface A (interface n A)
def interfaceExpectation {D : SmoothMarkedJordan} (M : MarkedApproximation D)
(q : β) (n : β) (f : Curve β β) : β :=
(β A β (M.polygon n).edges.powerset,
(M.polygon n).configurationWeight q A * f (M.interface n A)) /
(M.polygon n).partitionFunction q
def kappa (q : β) : β := 4 * Real.pi / Real.arccos (-Real.sqrt q / 2)
def upperHalfPlane : Set β := {z | 0 < z.im}
def pastTrace (Ξ³ : ββ₯0 β β) (t : ββ₯0) : Set β := Ξ³ '' Set.Iic t
def loewnerDomain (Ξ³ : ββ₯0 β β) (t : ββ₯0) : Set β :=
{z β upperHalfPlane \ pastTrace Ξ³ t |
Β¬ Bornology.IsBounded
(connectedComponentIn (upperHalfPlane \ pastTrace Ξ³ t) z)}
def inverseOn (g : β β β) (U : Set β) (w : β) : β := by
classical
exact if h : β z β U, g z = w then h.choose else 0
def IsLoewnerTrace (W : ββ₯0 β β) (Ξ³ : ββ₯0 β β)
(g : ββ₯0 β β β β) : Prop :=
Continuous Ξ³ β§ Ξ³ 0 = 0 β§
(β t, 0 β€ (Ξ³ t).im) β§
(β R : β, β T : ββ₯0, β t β₯ T, R β€ βΞ³ tβ) β§
(β z β upperHalfPlane, g 0 z = z) β§
(β t, DifferentiableOn β (g t) (loewnerDomain Ξ³ t)) β§
(β t, Set.BijOn (g t) (loewnerDomain Ξ³ t) upperHalfPlane) β§
(β t,
Tendsto (fun z => g t z - z)
(Filter.cocompact β β Filter.principal (loewnerDomain Ξ³ t)) (π 0)) β§
(β t,
Tendsto (fun z => z * (g t z - z))
(Filter.cocompact β β Filter.principal (loewnerDomain Ξ³ t)) (π (2 * (t : β) : β))) β§
(β t z, z β loewnerDomain Ξ³ t β
HasDerivWithinAt (fun s : β => g (Real.toNNReal s) z)
(2 / (g t z - (W t : β))) (Set.Ici 0) (t : β)) β§
(β t,
Tendsto (fun y : β => inverseOn (g t) (loewnerDomain Ξ³ t)
((W t : β) + Complex.I * y)) (π[>] 0) (π (Ξ³ t)))
def cayley (z : β) : β := (z - Complex.I) / (z + Complex.I)
def IsDomainCoordinate (D : SmoothMarkedJordan) (Ο : β β β) : Prop :=
DifferentiableOn β Ο (Metric.ball 0 1) β§
Set.BijOn Ο (Metric.ball 0 1) D.domain β§
ContinuousOn Ο (Metric.closedBall 0 1) β§
Set.BijOn Ο (Metric.closedBall 0 1) (closure D.domain) β§
Ο (-1) = D.a β§ Ο 1 = D.b
abbrev BrownianSample := C(ββ₯0, β)
instance : MeasurableSpace BrownianSample := borel BrownianSample
instance : BorelSpace BrownianSample := β¨rflβ©
def IsChordalSLE (ΞΊ : β) (D : SmoothMarkedJordan) (ΞΌ : Measure Curve) : Prop :=
IsProbabilityMeasure ΞΌ β§
β (P : Measure BrownianSample) (Ο : β β β)
(Ξ³ : BrownianSample β ββ₯0 β β)
(g : BrownianSample β ββ₯0 β β β β)
(Ξ· : BrownianSample β Curve),
IsProbabilityMeasure P β§
IsBrownianReal (fun t Ο => Ο t) P β§
IsDomainCoordinate D Ο β§
Measurable Ξ· β§ ΞΌ = Measure.map Ξ· P β§
(βα΅ Ο βP,
IsLoewnerTrace (fun t => Real.sqrt ΞΊ * Ο t) (Ξ³ Ο) (g Ο) β§
(β u : Time, (u : β) < 1 β
Ξ· Ο u = Ο (cayley (Ξ³ Ο (Real.toNNReal ((u : β) / (1 - (u : β))))))) β§
Ξ· Ο β¨1, by simpβ© = D.b)
end BelowOne
noncomputable section
open SimpleGraph Function
namespace BelowOne.FKComponents
variable {V : Type*} {G : SimpleGraph V}
lemma eq_of_walk {Ξ² : Sort*} {f : V β Ξ²}
(hf : β β¦v wβ¦, G.Adj v w β f v = f w) {v w : V} (p : G.Walk v w) :
f v = f w := by
induction p with
| nil => rfl
| cons h p ih => exact (hf h).trans ih
lemma component_card_sup_edge_of_reachable [Finite V] {a b : V}
(hab : G.Reachable a b) :
Nat.card (G β edge a b).ConnectedComponent = Nat.card G.ConnectedComponent := by
classical
let H := G β edge a b
have hconst : β β¦v wβ¦, H.Adj v w β G.connectedComponentMk v = G.connectedComponentMk w := by
intro v w hvw
rcases hvw with hG | he
Β· exact ConnectedComponent.sound hG.reachable
Β· rcases (edge_adj _ _ _ _).mp he with β¨β¨rfl,rflβ© | β¨rfl,rflβ©,_β©
Β· exact ConnectedComponent.sound hab
Β· exact ConnectedComponent.sound hab.symm
let f : H.ConnectedComponent β G.ConnectedComponent :=
ConnectedComponent.lift G.connectedComponentMk (fun _ _ p _ => eq_of_walk hconst p)
let g : G.ConnectedComponent β H.ConnectedComponent :=
ConnectedComponent.map (Hom.ofLE le_sup_left)
let e : H.ConnectedComponent β G.ConnectedComponent :=
{ toFun := f
invFun := g
left_inv := fun c => c.ind fun v => rfl
right_inv := fun c => c.ind fun v => rfl }
exact Nat.card_congr e
lemma component_card_sup_edge_of_not_reachable [Finite V] {a b : V}
(hab : Β¬ G.Reachable a b) :
Nat.card (G β edge a b).ConnectedComponent + 1 = Nat.card G.ConnectedComponent := by
classical
let H := G β edge a b
let A := G.connectedComponentMk a
let B := G.connectedComponentMk b
have hAB : A β B := fun h => hab (ConnectedComponent.exact h)
let collapse : G.ConnectedComponent β {c : G.ConnectedComponent // c β B} :=
fun c => β¨if c = B then A else c, by split_ifs with h; exact hAB; exact hβ©
have hcollapse : collapse A = collapse B := by
apply Subtype.ext
simp [collapse,hAB]
have hconst : β β¦v wβ¦, H.Adj v w β
collapse (G.connectedComponentMk v) = collapse (G.connectedComponentMk w) := by
intro v w hvw
rcases hvw with hG | he
Β· exact congrArg collapse (ConnectedComponent.sound hG.reachable)
Β· rcases (edge_adj _ _ _ _).mp he with β¨β¨rfl,rflβ© | β¨rfl,rflβ©,_β©
Β· exact hcollapse
Β· exact hcollapse.symm
let f : H.ConnectedComponent β {c : G.ConnectedComponent // c β B} :=
ConnectedComponent.lift (fun v => collapse (G.connectedComponentMk v))
(fun _ _ p _ => eq_of_walk hconst p)
let g : G.ConnectedComponent β H.ConnectedComponent :=
ConnectedComponent.map (Hom.ofLE le_sup_left)
have hgab : g A = g B := by
apply ConnectedComponent.sound
apply SimpleGraph.Adj.reachable
exact Or.inr ((edge_adj _ _ _ _).mpr β¨Or.inl β¨rfl,rflβ©,fun h => hAB (congrArg G.connectedComponentMk h)β©)
have hfg (c : G.ConnectedComponent) : f (g c) = collapse c := by
exact c.ind fun v => rfl
let e : H.ConnectedComponent β {c : G.ConnectedComponent // c β B} :=
{ toFun := f
invFun := fun c => g c.val
left_inv := by
intro c
induction c using ConnectedComponent.ind with
| h v =>
change g (if G.connectedComponentMk v = B then A else G.connectedComponentMk v) = g (G.connectedComponentMk v)
split_ifs with hv
Β· rw [hv]; exact hgab
Β· rfl
right_inv := by
intro c
rw [hfg]
apply Subtype.ext
simp [collapse,c.property] }
have hcard := Nat.card_congr e
let := Fintype.ofFinite G.ConnectedComponent
let := Fintype.ofFinite H.ConnectedComponent
simp only [Nat.card_eq_fintype_card] at hcard β’
rw [hcard]
have hsub := Fintype.card_subtype_compl (fun c : G.ConnectedComponent => c = B)
have hpos : 0 < Fintype.card G.ConnectedComponent := Fintype.card_pos_iff.mpr β¨Aβ©
simp only [Fintype.card_unique] at hsub
change Fintype.card {c : G.ConnectedComponent // c β B} =
Fintype.card G.ConnectedComponent - 1 at hsub
omega
lemma component_card_sup_edge [Finite V] (a b : V) :
Nat.card (G β edge a b).ConnectedComponent = Nat.card G.ConnectedComponent β¨
Nat.card (G β edge a b).ConnectedComponent + 1 = Nat.card G.ConnectedComponent := by
by_cases h : G.Reachable a b
Β· exact Or.inl (component_card_sup_edge_of_reachable h)
Β· exact Or.inr (component_card_sup_edge_of_not_reachable h)
end BelowOne.FKComponents
namespace BelowOne.FKFinite
open Finset SimpleGraph
attribute [local instance] Classical.propDecidable
variable {V : Type*}
def configuration (G : SimpleGraph V) (A : Finset (Sym2 V)) : SimpleGraph V :=
G β fromEdgeSet (A : Set (Sym2 V))
def count (G : SimpleGraph V) (A : Finset (Sym2 V)) : β :=
Nat.card (configuration G A).ConnectedComponent
def weight (G : SimpleGraph V) (q v : β) (A : Finset (Sym2 V)) : β :=
v ^ A.card * q ^ count G A
def partition (G : SimpleGraph V) (q v : β) (E : Finset (Sym2 V)) : β :=
β A β E.powerset, weight G q v A
lemma weight_pos (G : SimpleGraph V) {q v : β} (hq : 0 < q) (hv : 0 < v)
(A : Finset (Sym2 V)) : 0 < weight G q v A := by
exact mul_pos (pow_pos hv _) (pow_pos hq _)
lemma partition_pos (G : SimpleGraph V) {q v : β} (hq : 0 < q) (hv : 0 < v)
(E : Finset (Sym2 V)) : 0 < partition G q v E := by
apply sum_pos
Β· intro A hA
exact weight_pos G hq hv A
Β· exact β¨β
,by simpβ©
lemma configuration_insert (G : SimpleGraph V) (A : Finset (Sym2 V)) (a b : V) :
configuration G (insert s(a,b) A) = configuration G A β edge a b := by
classical
ext u w
simp only [configuration, sup_adj, fromEdgeSet_adj, mem_coe, Finset.mem_insert,
edge, Set.mem_singleton_iff]
tauto
lemma configuration_union (G : SimpleGraph V) (A F : Finset (Sym2 V)) :
configuration G (A βͺ F) = configuration (configuration G F) A := by
classical
ext u w
simp only [configuration,sup_adj,fromEdgeSet_adj,mem_coe,Finset.mem_union]
tauto
lemma weight_union (G : SimpleGraph V) (q v : β) {A F : Finset (Sym2 V)}
(hAF : Disjoint A F) :
weight G q v (A βͺ F) = v ^ F.card * weight (configuration G F) q v A := by
classical
simp only [weight,count,configuration_union,card_union_of_disjoint hAF,pow_add]
ring
theorem domain_markov (G : SimpleGraph V) {q v : β} (hv : 0 < v)
{S F : Finset (Sym2 V)} (hSF : Disjoint S F) (f : Finset (Sym2 V) β β) :
(β A β S.powerset, weight G q v (A βͺ F) * f A) /
(β A β S.powerset, weight G q v (A βͺ F)) =
(β A β S.powerset, weight (configuration G F) q v A * f A) /
partition (configuration G F) q v S := by
classical
have hx : β A β S.powerset, weight G q v (A βͺ F) =
v ^ F.card * weight (configuration G F) q v A := by
intro A hA
exact weight_union G q v (hSF.mono_left (mem_powerset.mp hA))
simp_rw [sum_congr rfl hx]
have hn : (β A β S.powerset, weight G q v (A βͺ F) * f A) =
v ^ F.card * (β A β S.powerset, weight (configuration G F) q v A * f A) := by
rw [mul_sum]
apply sum_congr rfl
intro A hA
rw [hx A hA]
ring
rw [hn,β mul_sum]
change _ / (v ^ F.card * partition (configuration G F) q v S) = _
exact mul_div_mul_left _ _ (ne_of_gt (pow_pos hv _))
variable [Finite V]
lemma weight_insert_connected (G : SimpleGraph V) (q v : β) (A : Finset (Sym2 V))
{a b : V} (he : s(a,b) β A) (hab : (configuration G A).Reachable a b) :
weight G q v (insert s(a,b) A) = v * weight G q v A := by
classical
have hc := FKComponents.component_card_sup_edge_of_reachable hab
simp only [weight,count,configuration_insert,card_insert_of_notMem he,pow_succ]
rw [hc]
ring
lemma weight_insert_separated (G : SimpleGraph V) (q v : β) (A : Finset (Sym2 V))
{a b : V} (he : s(a,b) β A) (hab : Β¬(configuration G A).Reachable a b) :
q * weight G q v (insert s(a,b) A) = v * weight G q v A := by
classical
have hc := FKComponents.component_card_sup_edge_of_not_reachable hab
unfold weight count
rw [configuration_insert,card_insert_of_notMem he,β hc,pow_succ,pow_succ]
ring
theorem edge_conditional_probability (G : SimpleGraph V) {q v : β}
(hq : 0 < q) (hv : 0 < v) (A : Finset (Sym2 V)) {a b : V}
(he : s(a,b) β A) :
weight G q v (insert s(a,b) A) /
(weight G q v A + weight G q v (insert s(a,b) A)) =
if (configuration G A).Reachable a b then v/(1+v) else v/(q+v) := by
classical
have hw := weight_pos G hq hv A
split_ifs with hab
Β· rw [weight_insert_connected G q v A he hab]
apply (div_eq_div_iff (ne_of_gt (add_pos hw (mul_pos hv hw)))
(ne_of_gt (add_pos zero_lt_one hv))).mpr
ring
Β· have hc := weight_insert_separated G q v A he hab
have hi := weight_pos G hq hv (insert s(a,b) A)
apply (div_eq_div_iff (ne_of_gt (add_pos hw hi)) (ne_of_gt (add_pos hq hv))).mpr
nlinarith
end BelowOne.FKFinite
namespace BelowOne.LatticePolygon
open Finset SimpleGraph
variable {Ξ΄ : β} (P : LatticePolygon Ξ΄)
def wireGraph : SimpleGraph P.Vertex :=
fromRel fun v w => v β P.wiredVertices β§ w β P.wiredVertices
lemma wiredConfiguration_eq (A : Finset (Sym2 P.Vertex)) :
P.wiredConfiguration A = FKFinite.configuration P.wireGraph A := by
classical
ext v w
simp only [wiredConfiguration,wireGraph,FKFinite.configuration,fromRel_adj,
sup_adj,fromEdgeSet_adj,mem_coe,Sym2.eq_swap]
tauto
lemma componentCount_eq (A : Finset (Sym2 P.Vertex)) :
P.componentCount A = FKFinite.count P.wireGraph A := by
unfold componentCount FKFinite.count
rw [P.wiredConfiguration_eq]
lemma configurationWeight_odds {q : β} (hq : 0 < q) (A : Finset (Sym2 P.Vertex))
(hA : A β P.edges) :
P.configurationWeight q A =
(1 / (1 + Real.sqrt q)) ^ P.edges.card *
FKFinite.weight P.wireGraph q (Real.sqrt q) A := by
have hs : 0 < Real.sqrt q := Real.sqrt_pos.mpr hq
have hd : 1 + Real.sqrt q β 0 := ne_of_gt (by linarith)
have hp : 1 - Real.sqrt q / (1 + Real.sqrt q) = 1/(1+Real.sqrt q) := by
field_simp
ring
have hc : A.card + (P.edges.card - A.card) = P.edges.card :=
Nat.add_sub_of_le (card_le_card hA)
unfold configurationWeight FKFinite.weight
dsimp only
rw [P.componentCount_eq,hp]
rw [div_eq_mul_one_div, mul_pow, β hc, pow_add, Nat.add_sub_cancel_left]
ring
lemma partitionFunction_odds {q : β} (hq : 0 < q) :
P.partitionFunction q = (1 / (1 + Real.sqrt q)) ^ P.edges.card *
FKFinite.partition P.wireGraph q (Real.sqrt q) P.edges := by
unfold partitionFunction FKFinite.partition
rw [mul_sum]
apply sum_congr rfl
intro A hA
exact P.configurationWeight_odds hq A (mem_powerset.mp hA)
theorem normalized_configurationWeight_odds {q : β} (hq : 0 < q)
(A : Finset (Sym2 P.Vertex)) (hA : A β P.edges) :
P.configurationWeight q A / P.partitionFunction q =
FKFinite.weight P.wireGraph q (Real.sqrt q) A /
FKFinite.partition P.wireGraph q (Real.sqrt q) P.edges := by
rw [P.configurationWeight_odds hq A hA,P.partitionFunction_odds hq]
exact mul_div_mul_left _ _ (ne_of_gt (pow_pos (one_div_pos.mpr
(by have := Real.sqrt_nonneg q; linarith)) _))
end BelowOne.LatticePolygon
end
end
end
section
noncomputable section
open Finset SimpleGraph
attribute [local instance] Classical.propDecidable
namespace BelowOne.FKPressure
variable {V I : Type*} [Finite V]
def graph (G : SimpleGraph V) (ends : I β V Γ V) (A : Finset I) : SimpleGraph V :=
G β A.sup (fun e => edge (ends e).1 (ends e).2)
def components (G : SimpleGraph V) (ends : I β V Γ V) (A : Finset I) : β :=
Nat.card (graph G ends A).ConnectedComponent
def partition (G : SimpleGraph V) (ends : I β V Γ V) (s : β) (w : I β β)
(E : Finset I) : β :=
β A β E.powerset, (β e β A, w e) * s ^ components G ends A
omit [Finite V] in
@[simp] lemma graph_empty (G : SimpleGraph V) (ends : I β V Γ V) :
graph G ends β
= G := by simp [graph]
omit [Finite V] in
lemma graph_mono (G : SimpleGraph V) (ends : I β V Γ V) {A B : Finset I}
(h : A β B) : graph G ends A β€ graph G ends B := by
exact sup_le_sup_left (Finset.sup_mono h) _
omit [Finite V] in
lemma graph_insert (G : SimpleGraph V) (ends : I β V Γ V) (e : I) (A : Finset I) :
graph G ends (insert e A) = graph G ends A β edge (ends e).1 (ends e).2 := by
classical
simp [graph, sup_left_comm, sup_comm]
omit [Finite V] in
lemma graph_contracted (G : SimpleGraph V) (ends : I β V Γ V) (e : I) (A : Finset I) :
graph (G β edge (ends e).1 (ends e).2) ends A =
graph G ends A β edge (ends e).1 (ends e).2 := by
simp [graph, sup_assoc, sup_left_comm, sup_comm]
omit [Finite V] in
@[simp] lemma partition_empty (G : SimpleGraph V) (ends : I β V Γ V)
(s : β) (w : I β β) : partition G ends s w β
= s ^ Nat.card G.ConnectedComponent := by
simp [partition, components]
omit [Finite V] in
lemma deletion_contraction (G : SimpleGraph V) (ends : I β V Γ V)
(s : β) (w : I β β) {e : I} {E : Finset I} (he : e β E) :
partition G ends s w (insert e E) = partition G ends s w E +
w e * partition (G β edge (ends e).1 (ends e).2) ends s w E := by
classical
unfold partition
rw [sum_powerset_insert he, mul_sum]
congr 1
apply sum_congr rfl
intro A hA
have heA : e β A := fun h => he (mem_powerset.mp hA h)
rw [prod_insert heA]
simp only [components,graph_insert,graph_contracted]
ring
lemma separating_edge_count (G : SimpleGraph V) (ends : I β V Γ V)
{e : I} {E A : Finset I} (h : Β¬(graph G ends E).Reachable (ends e).1 (ends e).2)
(hA : A β E) :
components (G β edge (ends e).1 (ends e).2) ends A + 1 = components G ends A := by
unfold components
rw [graph_contracted]
apply FKComponents.component_card_sup_edge_of_not_reachable
exact fun hr => h (hr.mono (graph_mono G ends hA))
lemma separating_edge_partition (G : SimpleGraph V) (ends : I β V Γ V)
(s : β) (w : I β β) {e : I} {E : Finset I}
(h : Β¬(graph G ends E).Reachable (ends e).1 (ends e).2) :
partition G ends s w E =
s * partition (G β edge (ends e).1 (ends e).2) ends s w E := by
unfold partition
rw [mul_sum]
apply sum_congr rfl
intro A hA
rw [β separating_edge_count G ends h (mem_powerset.mp hA),pow_succ]
ring
theorem negative_partition (G : SimpleGraph V) (ends : I β V Γ V)
{u : β} (hu : 0 < u) (hu1 : u < 1) (w : I β β) (E : Finset I)
(hw : β e β E, 1 β€ w e) (hc : components G ends E = 1) :
partition G ends (-u) w E < 0 := by
classical
induction E using Finset.induction_on generalizing G with
| empty =>
simp only [components,graph_empty] at hc
simpa [hc] using neg_neg_of_pos hu
| @insert e E he ih =>
have hwE : β f β E, 1 β€ w f := fun f hf => hw f (mem_insert_of_mem hf)
have hwe : 1 β€ w e := hw e (mem_insert_self _ _)
let G' := G β edge (ends e).1 (ends e).2
have hc' : components G' ends E = 1 := by
simpa only [components,G',graph_contracted,graph_insert] using hc
have hp' : partition G' ends (-u) w E < 0 := ih G' hwE hc'
rw [deletion_contraction G ends (-u) w he]
by_cases hE : components G ends E = 1
Β· exact add_neg (ih G hwE hE) (mul_neg_of_pos_of_neg (by linarith) hp')
Β· have hsep : Β¬(graph G ends E).Reachable (ends e).1 (ends e).2 := by
intro hr
have hcards := FKComponents.component_card_sup_edge_of_reachable hr
apply hE
apply hcards.symm.trans
simpa only [components,graph_insert] using hc
rw [separating_edge_partition G ends (-u) w hsep]
change (-u) * partition G' ends (-u) w E + w e * partition G' ends (-u) w E < 0
rw [β add_mul]
exact mul_neg_of_pos_of_neg (by linarith) hp'
theorem signed_partition_pos (G : SimpleGraph V) (ends : I β V Γ V)
{u : β} (hu : 0 < u) (hu1 : u < 1) (w : I β β) (E : Finset I)
(hw : β e β E, 1 β€ w e) :
0 < (-1 : β) ^ components G ends E * partition G ends (-u) w E := by
classical
induction E using Finset.induction_on generalizing G with
| empty =>
simp only [components, graph_empty, partition_empty, β mul_pow, neg_mul_neg,
one_mul]
exact pow_pos hu _
| @insert e E he ih =>
have hwE : β f β E, 1 β€ w f := fun f hf => hw f (mem_insert_of_mem hf)
have hwe : 1 β€ w e := hw e (mem_insert_self _ _)
let G' := G β edge (ends e).1 (ends e).2
have hc' : components G ends (insert e E) = components G' ends E := by
simp only [components,G',graph_contracted,graph_insert]
have hp' := ih G' hwE
rw [hc', deletion_contraction G ends (-u) w he, mul_add]
by_cases hr : (graph G ends E).Reachable (ends e).1 (ends e).2
Β· have hc : components G' ends E = components G ends E := by
simp only [components,G',graph_contracted]
exact FKComponents.component_card_sup_edge_of_reachable hr
have hp := ih G hwE
rw [β hc] at hp
have hpw := mul_pos (lt_of_lt_of_le zero_lt_one hwe) hp'
nlinarith
Β· rw [separating_edge_partition G ends (-u) w hr]
change 0 < (-1 : β) ^ components G' ends E *
((-u) * partition G' ends (-u) w E) +
(-1 : β) ^ components G' ends E * (w e * partition G' ends (-u) w E)
have hpw := mul_pos (show 0 < w e - u by linarith) hp'
nlinarith
def hardSum (G : SimpleGraph V) (ends : I β V Γ V) (E : Finset I) : β :=
β A β E.powerset, if components G ends A = 1 then (-1 : β)^A.card else 0
lemma components_contracted_of_reachable (G : SimpleGraph V) (ends : I β V Γ V)
{e : I} (hr : G.Reachable (ends e).1 (ends e).2) (A : Finset I) :
components (G β edge (ends e).1 (ends e).2) ends A = components G ends A := by
unfold components
rw [graph_contracted]
exact FKComponents.component_card_sup_edge_of_reachable (hr.mono le_sup_left)
omit [Finite V] in
lemma hardSum_deletion_contraction (G : SimpleGraph V) (ends : I β V Γ V)
{e : I} {E : Finset I} (he : e β E) :
hardSum G ends (insert e E) = hardSum G ends E -
hardSum (G β edge (ends e).1 (ends e).2) ends E := by
unfold hardSum
rw [sum_powerset_insert he,sub_eq_add_neg,β sum_neg_distrib]
congr 1
apply sum_congr rfl
intro A hA
have heA : e β A := fun h => he (mem_powerset.mp hA h)
simp only [components,graph_insert,graph_contracted,card_insert_of_notMem heA,pow_succ]
split_ifs <;> ring
lemma hardSum_eq_zero_of_reachable (G : SimpleGraph V) (ends : I β V Γ V)
{e : I} {E : Finset I} (he : e β E) (hr : G.Reachable (ends e).1 (ends e).2) :
hardSum G ends (insert e E) = 0 := by
rw [hardSum_deletion_contraction G ends he]
have h : hardSum (G β edge (ends e).1 (ends e).2) ends E = hardSum G ends E := by
unfold hardSum
congr 1
funext A
rw [components_contracted_of_reachable G ends hr]
rw [h,sub_self]
theorem hardSum_sign (G : SimpleGraph V) (ends : I β V Γ V) (E : Finset I) :
(-1 : β) ^ Nat.card G.ConnectedComponent * hardSum G ends E β€ 0 := by
induction E using Finset.induction_on generalizing G with
| empty =>
simp only [hardSum,powerset_empty,sum_singleton,components,graph_empty,card_empty,pow_zero]
split_ifs with h
Β· simp [h]
Β· simp
| @insert e E he ih =>
by_cases hr : G.Reachable (ends e).1 (ends e).2
Β· rw [hardSum_eq_zero_of_reachable G ends he hr,mul_zero]
Β· have hc := FKComponents.component_card_sup_edge_of_not_reachable hr
have h0 := ih G
have h1 := ih (G β edge (ends e).1 (ends e).2)
rw [hardSum_deletion_contraction G ends he,mul_sub]
have hsign : (-1 : β) ^ Nat.card G.ConnectedComponent =
- (-1 : β) ^ Nat.card (G β edge (ends e).1 (ends e).2).ConnectedComponent := by
rw [β hc,pow_succ]
ring
rw [hsign] at h0 β’
nlinarith
lemma union_constrained_sum (v : I β β) {A D : Finset I} (hA : A β D) :
(β B β D.powerset with A βͺ B = D, β e β B, v e) =
(β e β D \ A, v e) * β e β A, (1 + v e) := by
classical
rw [prod_one_add, mul_sum]
apply sum_bij' (fun B _ => B β© A) (fun C _ => (D \ A) βͺ C)
Β· intro B hB
exact mem_powerset.mpr inter_subset_right
Β· intro C hC
have hc := mem_powerset.mp hC
apply mem_filter.mpr
constructor
Β· exact mem_powerset.mpr (union_subset sdiff_subset (hc.trans hA))
Β· ext e
simp only [mem_union, mem_sdiff]
constructor
Β· rintro (he | β¨he, _β© | he)
Β· exact hA he
Β· exact he
Β· exact hA (hc he)
Β· intro he
by_cases ha : e β A
Β· exact Or.inl ha
Β· exact Or.inr (Or.inl β¨he, haβ©)
Β· intro B hB
obtain β¨hb, habβ© := mem_filter.mp hB
have hbD := mem_powerset.mp hb
ext e
simp only [mem_union, mem_sdiff, mem_inter]
constructor
Β· rintro (β¨hd, haβ© | β¨hb, _β©)
Β· have he : e β A βͺ B := by rw [hab]; exact hd
exact (mem_union.mp he).resolve_left ha
Β· exact hb
Β· intro hb
by_cases ha : e β A
Β· exact Or.inr β¨hb, haβ©
Β· exact Or.inl β¨hbD hb, haβ©
Β· intro C hC
have hc := mem_powerset.mp hC
ext e
simp only [mem_inter, mem_union, mem_sdiff]
constructor
Β· rintro β¨(β¨_, hnβ© | he), haβ©
Β· exact (hn ha).elim
Β· exact he
Β· intro he
exact β¨Or.inr he, hc heβ©
Β· intro B hB
obtain β¨hb, habβ© := mem_filter.mp hB
have hbD := mem_powerset.mp hb
have heq : B = (D \ A) βͺ (B β© A) := by
ext e
simp only [mem_union,mem_sdiff,mem_inter]
constructor
Β· intro he
by_cases ha : e β A
Β· exact Or.inr β¨he,haβ©
Β· exact Or.inl β¨hbD he,haβ©
Β· rintro (β¨hd,hnβ© | β¨he,_β©)
Β· have he : e β A βͺ B := by rw [hab]; exact hd
exact (mem_union.mp he).resolve_left hn
Β· exact he
conv_lhs => rw [heq,prod_union (show Disjoint (D \ A) (B β© A) from
disjoint_left.mpr fun e he he' => (mem_sdiff.mp he).2 (mem_inter.mp he').2)]
omit [Finite V] in
lemma fixed_union (G : SimpleGraph V) (ends : I β V Γ V) (v : I β β)
(s : β) (D : Finset I) :
(β A β D.powerset, (β e β A, v e) * s ^ components G ends A *
β B β D.powerset with A βͺ B = D, β e β B, v e) =
(β e β D, v e) * partition G ends s (fun e => 1 + v e) D := by
unfold partition
rw [mul_sum]
apply sum_congr rfl
intro A hA
have ha := mem_powerset.mp hA
rw [union_constrained_sum v ha]
have hp := prod_sdiff (f := v) ha
calc
_ = ((β e β D \ A, v e) * β e β A, v e) *
((β e β A, (1 + v e)) * s ^ components G ends A) := by ring
_ = _ := by rw [hp]
theorem fixed_union_hard_nonpos {J : Type*} (G : SimpleGraph V)
(ends : I β V Γ V) (hardEnds : J β V Γ V) (v : I β β)
{u : β} (hu : 0 < u) (hu1 : u < 1) (D : Finset I) (H : Finset J)
(hv : β e β D, 0 β€ v e) :
(β e β D, v e) * partition G ends (-u) (fun e => 1 + v e) D *
hardSum (graph G ends D) hardEnds H β€ 0 := by
have hp := signed_partition_pos G ends hu hu1 (fun e => 1 + v e) D
(fun e he => by linarith [hv e he])
have hh := hardSum_sign (graph G ends D) hardEnds H
change (-1 : β) ^ components G ends D * hardSum (graph G ends D) hardEnds H β€ 0 at hh
have hs : ((-1 : β) ^ components G ends D) ^ 2 = 1 := by
rw [β pow_mul, Nat.mul_comm, pow_mul]
simp
have hph := mul_nonpos_of_nonneg_of_nonpos (le_of_lt hp) hh
have hprod : partition G ends (-u) (fun e => 1 + v e) D *
hardSum (graph G ends D) hardEnds H β€ 0 := by
nlinarith [sq_nonneg ((-1 : β) ^ components G ends D)]
exact (by simpa only [mul_assoc] using
mul_nonpos_of_nonneg_of_nonpos (prod_nonneg hv) hprod)
end BelowOne.FKPressure
end
end
section
noncomputable section
open Finset SimpleGraph
attribute [local instance] Classical.propDecidable
namespace BelowOne.FKPressure
variable {V I J : Type*} [Finite V]
lemma regroup_union (E : Finset I) (f : Finset I β Finset I β β) :
(β A β E.powerset, β B β E.powerset, f A B) =
β D β E.powerset, β A β D.powerset,
β B β D.powerset with A βͺ B = D, f A B := by
classical
rw [β sum_product']
have hmap : β p β E.powerset ΓΛ’ E.powerset, p.1 βͺ p.2 β E.powerset := by
intro p hp
obtain β¨ha,hbβ© := mem_product.mp hp
exact mem_powerset.mpr (union_subset (mem_powerset.mp ha) (mem_powerset.mp hb))
rw [β sum_fiberwise_of_maps_to hmap]
apply sum_congr rfl
intro D hD
have hd := mem_powerset.mp hD
apply sum_finset_product'
intro p
simp only [mem_filter,mem_product,mem_powerset]
constructor
Β· rintro β¨β¨ha,hbβ©, habβ©
refine β¨?_, ?_, habβ©
Β· rw [β hab]
exact subset_union_left
Β· rw [β hab]
exact subset_union_right
Β· rintro β¨ha,hb, habβ©
exact β¨β¨ha.trans hd, hb.trans hdβ©,habβ©
def connectedSum (G : SimpleGraph V) (ends : I β V Γ V)
(hardEnds : J β V Γ V) (E : Finset I) (H : Finset J)
(s : β) (v : I β β) : β :=
β A β E.powerset, β B β E.powerset,
(β e β A, v e) * (β e β B, v e) * s ^ components G ends A *
hardSum (graph G ends (A βͺ B)) hardEnds H
omit [Finite V] in
lemma connectedSum_grouped (G : SimpleGraph V) (ends : I β V Γ V)
(hardEnds : J β V Γ V) (E : Finset I) (H : Finset J)
(s : β) (v : I β β) :
connectedSum G ends hardEnds E H s v =
β D β E.powerset, (β e β D, v e) *
partition G ends s (fun e => 1 + v e) D *
hardSum (graph G ends D) hardEnds H := by
unfold connectedSum
rw [regroup_union]
apply sum_congr rfl
intro D hD
rw [β fixed_union, sum_mul]
apply sum_congr rfl
intro A hA
rw [mul_sum, sum_mul]
apply sum_congr rfl
intro B hB
have hab := (mem_filter.mp hB).2
rw [hab]
ring
theorem connectedSum_nonpos (G : SimpleGraph V) (ends : I β V Γ V)
(hardEnds : J β V Γ V) (E : Finset I) (H : Finset J)
{u : β} (hu : 0 < u) (hu1 : u < 1) (v : I β β)
(hv : β e β E, 0 β€ v e) :
connectedSum G ends hardEnds E H (-u) v β€ 0 := by
rw [connectedSum_grouped]
apply sum_nonpos
intro D hD
exact fixed_union_hard_nonpos G ends hardEnds v hu hu1 D H
(fun e he => hv e (mem_powerset.mp hD he))
end BelowOne.FKPressure
end
end
section
noncomputable section
open Finset
attribute [local instance] Classical.propDecidable
namespace BelowOne.PartitionCumulant
instance finiteSetoid (Ξ± : Type*) [Finite Ξ±] : Finite (Setoid Ξ±) :=
Finite.of_injective (fun r : Setoid Ξ± => r.r) (fun _ _ h => Setoid.ext (by simp [h]))
instance fintypeSetoid (Ξ± : Type*) [Finite Ξ±] : Fintype (Setoid Ξ±) := Fintype.ofFinite _
variable {Ξ± : Type*}
def extendMap (r : Setoid Ξ±) (o : Option (Quotient r)) : Option Ξ± β Option (Quotient r)
| none => o
| some a => some (Quotient.mk r a)
def extend (r : Setoid Ξ±) (o : Option (Quotient r)) : Setoid (Option Ξ±) :=
Setoid.ker (extendMap r o)
@[simp] lemma extend_some (r : Setoid Ξ±) (o : Option (Quotient r)) (a b : Ξ±) :
extend r o (some a) (some b) β r a b := by
change some (Quotient.mk r a) = some (Quotient.mk r b) β r a b
rw [Option.some.injEq, Quotient.eq]
@[simp] lemma extend_none_some (r : Setoid Ξ±) (o : Option (Quotient r)) (a : Ξ±) :
extend r o none (some a) β o = some (Quotient.mk r a) := Iff.rfl
@[simp] lemma restrict_extend (r : Setoid Ξ±) (o : Option (Quotient r)) :
(extend r o).comap some = r := by
ext a b
exact extend_some r o a b
lemma extend_injective (r : Setoid Ξ±) : Function.Injective (extend r) := by
intro o p h
have hh (a : Ξ±) : (o = some (Quotient.mk r a)) β (p = some (Quotient.mk r a)) := by
simpa only [extend_none_some] using Setoid.ext_iff.mp h none (some a)
cases o with
| none =>
cases p with
| none => rfl
| some q =>
obtain β¨a,rflβ© := q.exists_rep
simpa using (hh a).mpr rfl
| some q =>
obtain β¨a,rflβ© := q.exists_rep
exact ((hh a).mp rfl).symm
lemma extend_bijective : Function.Bijective
(fun p : Ξ£ r : Setoid Ξ±, Option (Quotient r) => extend p.1 p.2) := by
constructor
Β· rintro β¨r,oβ© β¨s,pβ© h
have hrs : r = s := by
simpa using congrArg (Setoid.comap (some : Ξ± β Option Ξ±)) h
subst s
have hop : o = p := extend_injective r h
subst p
rfl
Β· intro s
let r := s.comap (some : Ξ± β Option Ξ±)
by_cases h : β a, s none (some a)
Β· obtain β¨a,haβ© := h
refine β¨β¨r,some (Quotient.mk r a)β©, ?_β©
apply Setoid.ext
intro x y
cases x with
| none =>
cases y with
| none => simp
| some b =>
simp only [extend_none_some, Option.some.injEq, Quotient.eq]
change s (some a) (some b) β s none (some b)
exact β¨fun h => s.trans ha h, fun h => s.trans (s.symm ha) hβ©
| some a' =>
cases y with
| none =>
change some (Quotient.mk r a') = some (Quotient.mk r a) β s (some a') none
rw [Option.some.injEq, Quotient.eq]
change s (some a') (some a) β s (some a') none
exact β¨fun h => s.trans h (s.symm ha), fun h => s.trans h haβ©
| some b => exact extend_some r _ _ _
Β· refine β¨β¨r,noneβ©, ?_β©
apply Setoid.ext
intro x y
cases x with
| none =>
cases y with
| none => simp
| some b =>
rw [extend_none_some]
exact iff_of_false (by simp) (fun hb => h β¨b,hbβ©)
| some a =>
cases y with
| none =>
change some (Quotient.mk r a) = none β s (some a) none
exact iff_of_false (by simp) (fun ha => h β¨a,s.symm haβ©)
| some b => exact extend_some r _ _ _
def extensionEquiv : (Ξ£ r : Setoid Ξ±, Option (Quotient r)) β Setoid (Option Ξ±) :=
Equiv.ofBijective _ extend_bijective
lemma card_extend_none [Finite Ξ±] (r : Setoid Ξ±) :
Nat.card (Quotient (extend r none)) = Nat.card (Quotient r) + 1 := by
have hs : Function.Surjective (extendMap r none) := by
intro x
cases x with
| none => exact β¨none,rflβ©
| some q =>
obtain β¨a,rflβ© := q.exists_rep
exact β¨some a,rflβ©
change Nat.card (Quotient (Setoid.ker (extendMap r none))) = _
rw [Nat.card_congr (Setoid.quotientKerEquivOfSurjective (extendMap r none) hs)]
let := Fintype.ofFinite (Quotient r)
simp only [Nat.card_eq_fintype_card, Fintype.card_option]
lemma card_extend_some [Finite Ξ±] (r : Setoid Ξ±) (q : Quotient r) :
Nat.card (Quotient (extend r (some q))) = Nat.card (Quotient r) := by
let f : Option Ξ± β Quotient r := Option.elim' q (Quotient.mk r)
have he : extend r (some q) = Setoid.ker f := by
apply Setoid.ext
intro x y
change extendMap r (some q) x = extendMap r (some q) y β f x = f y
cases x <;> cases y <;> simp [extendMap, f]
have hs : Function.Surjective f := by
intro p
obtain β¨a,rflβ© := p.exists_rep
exact β¨some a,rflβ©
rw [he]
exact Nat.card_congr (Setoid.quotientKerEquivOfSurjective f hs)
theorem sum_option [Finite Ξ±] (f : β β β) :
(β s : Setoid (Option Ξ±), f (Nat.card (Quotient s))) =
β r : Setoid Ξ±, (f (Nat.card (Quotient r) + 1) +
(Nat.card (Quotient r) : β) * f (Nat.card (Quotient r))) := by
classical
let := Fintype.ofFinite Ξ±
let (r : Setoid Ξ±) := Fintype.ofFinite (Quotient r)
rw [β extensionEquiv.sum_comp, Fintype.sum_sigma]
apply sum_congr rfl
intro r _
rw [Fintype.sum_option]
change f (Nat.card (Quotient (extend r none))) +
(β x : Quotient r, f (Nat.card (Quotient (extend r (some x))))) = _
simp only [card_extend_none, card_extend_some]
simp only [sum_const, card_univ, nsmul_eq_mul, Nat.card_eq_fintype_card]
def coefficient (n : β) : β := (-1) ^ (n - 1) * (n - 1).factorial
lemma coefficient_recurrence {n : β} (hn : 0 < n) :
coefficient (n+1) + (n : β) * coefficient n = 0 := by
have hn' : n = (n-1)+1 := by omega
simp only [coefficient, Nat.add_sub_cancel]
conv_lhs => arg 1; arg 1; rw [hn',pow_succ]
have hf : n.factorial = n * (n-1).factorial := by
conv_lhs => rw [hn', Nat.factorial_succ]
rw [β hn']
rw [hf]
push_cast
ring
theorem sum_coefficient_option [Finite Ξ±] [Nonempty Ξ±] :
(β r : Setoid (Option Ξ±), coefficient (Nat.card (Quotient r))) = 0 := by
rw [sum_option]
apply sum_eq_zero
intro r _
let : Nonempty (Quotient r) := β¨Quotient.mk r (Classical.arbitrary Ξ±)β©
exact coefficient_recurrence Nat.card_pos
def setoidEquiv {Ξ² : Type*} (e : Ξ± β Ξ²) : Setoid Ξ± β Setoid Ξ² where
toFun r := r.comap e.symm
invFun s := s.comap e
left_inv r := by
apply Setoid.ext
intro a b
change r (e.symm (e a)) (e.symm (e b)) β r a b
simp only [e.symm_apply_apply]
right_inv s := by
apply Setoid.ext
intro a b
change s (e (e.symm a)) (e (e.symm b)) β s a b
simp only [e.apply_symm_apply]
lemma card_relabel {Ξ² : Type*} (e : Ξ± β Ξ²) (r : Setoid Ξ±) :
Nat.card (Quotient (setoidEquiv e r)) = Nat.card (Quotient r) := by
apply Nat.card_congr
exact Quotient.congr e.symm (fun _ _ => Iff.rfl)
lemma sum_relabel {Ξ² : Type*} [Finite Ξ±] [Finite Ξ²] (e : Ξ± β Ξ²) (f : β β β) :
(β r : Setoid Ξ±, f (Nat.card (Quotient r))) =
β s : Setoid Ξ², f (Nat.card (Quotient s)) := by
exact Fintype.sum_equiv (setoidEquiv e) _ _ (fun r => by rw [card_relabel])
lemma sum_coefficient_nontrivial [Finite Ξ±] [Nontrivial Ξ±] :
(β r : Setoid Ξ±, coefficient (Nat.card (Quotient r))) = 0 := by
classical
obtain β¨a,b,habβ© := exists_pair_ne Ξ±
let : Nonempty {x : Ξ± // x β a} := β¨β¨b,hab.symmβ©β©
rw [β sum_relabel (Equiv.optionSubtypeNe a)]
exact sum_coefficient_option
lemma sum_coefficient_subsingleton [Finite Ξ±] [Subsingleton Ξ±] [Nonempty Ξ±] :
(β r : Setoid Ξ±, coefficient (Nat.card (Quotient r))) = 1 := by
let : Unique (Setoid Ξ±) :=
{ default := β€
uniq := fun r => Setoid.ext (fun a b => by
rw [Subsingleton.elim b a]
simp) }
rw [Fintype.sum_unique]
have hcard : Nat.card (Quotient (default : Setoid Ξ±)) = 1 := by
apply Nat.card_eq_one_iff_unique.mpr
refine β¨?_, β¨Quotient.mk _ (Classical.arbitrary Ξ±)β©β©
refine β¨fun x y => ?_β©
induction x using Quotient.inductionOn with | h a =>
induction y using Quotient.inductionOn with | h b =>
rw [Subsingleton.elim b a]
rw [hcard]
norm_num [coefficient]
lemma sum_coefficient [Finite Ξ±] [Nonempty Ξ±] :
(β r : Setoid Ξ±, coefficient (Nat.card (Quotient r))) =
if Nat.card Ξ± = 1 then 1 else 0 := by
classical
cases subsingleton_or_nontrivial Ξ± with
| inl h =>
let := h
rw [sum_coefficient_subsingleton, ite_eq_left (Nat.card_eq_one_iff_unique.mpr β¨h,inferInstanceβ©)]
| inr h =>
let := h
rw [sum_coefficient_nontrivial, ite_eq_right]
exact fun he => not_subsingleton Ξ± (Nat.card_eq_one_iff_unique.mp he).1
def coarseningQuotientEquiv (r s : Setoid Ξ±) (h : r β€ s) :
Quotient (Setoid.correspondence r β¨s,hβ©) β Quotient s := by
apply Equiv.trans _ (Setoid.quotientQuotientEquivQuotient r s h)
apply Quotient.congrRight
intro a b
induction a using Quotient.inductionOn with | h x =>
induction b using Quotient.inductionOn with | h y =>
change s x y β Quotient.mk s x = Quotient.mk s y
exact Quotient.eq.symm
theorem sum_coarsenings [Finite Ξ±] [Nonempty Ξ±] (r : Setoid Ξ±) :
(β s : {s : Setoid Ξ± // r β€ s}, coefficient (Nat.card (Quotient s.1))) =
if Nat.card (Quotient r) = 1 then 1 else 0 := by
classical
let := Fintype.ofFinite (Quotient r)
let : Nonempty (Quotient r) := β¨Quotient.mk r (Classical.arbitrary Ξ±)β©
rw [β sum_coefficient (Ξ± := Quotient r)]
apply Fintype.sum_equiv (Setoid.correspondence r).toEquiv
intro s
exact congrArg coefficient (Nat.card_congr (coarseningQuotientEquiv r s.1 s.2)).symm
theorem connected_cancellation [Finite Ξ±] [Nonempty Ξ±]
{Ξ© : Type*} [Fintype Ξ©] (component : Ξ© β Setoid Ξ±) (weight : Ξ© β β) :
(β r : Setoid Ξ±, coefficient (Nat.card (Quotient r)) *
β Ο : Ξ©, if component Ο β€ r then weight Ο else 0) =
β Ο : Ξ©, if Nat.card (Quotient (component Ο)) = 1 then weight Ο else 0 := by
classical
simp only [mul_sum]
rw [sum_comm]
apply sum_congr rfl
intro Ο _
have he : (β r : Setoid Ξ±, coefficient (Nat.card (Quotient r)) *
(if component Ο β€ r then weight Ο else 0)) =
(β r : {r : Setoid Ξ± // component Ο β€ r},
coefficient (Nat.card (Quotient r.1))) * weight Ο := by
rw [sum_mul, β Finset.sum_subtype (univ.filter (fun r => component Ο β€ r))
(by simp) (fun r => coefficient (Nat.card (Quotient r)) * weight Ο), sum_filter]
apply sum_congr rfl
intro r _
split_ifs <;> simp_all
rw [he, sum_coarsenings]
split_ifs <;> simp
end BelowOne.PartitionCumulant
end
end
section
noncomputable section
open Finset SimpleGraph
attribute [local instance] Classical.propDecidable
namespace BelowOne.FKPressure
variable {V I J : Type*} [Finite V]
def blockStructureSum (G : SimpleGraph V) (ends : I β V Γ V)
(hardEnds : J β V Γ V) (E : Finset I) (H : Finset J)
(s : β) (v : I β β) (r : Setoid V) : β :=
β A β E.powerset, β B β E.powerset, β L β H.powerset,
if (graph (graph G ends (A βͺ B)) hardEnds L).reachableSetoid β€ r then
(β e β A, v e) * (β e β B, v e) * s ^ components G ends A * (-1 : β)^L.card
else 0
theorem exponential_cancellation [Nonempty V] (G : SimpleGraph V) (ends : I β V Γ V)
(hardEnds : J β V Γ V) (E : Finset I) (H : Finset J)
(s : β) (v : I β β) :
(β r : Setoid V, PartitionCumulant.coefficient (Nat.card (Quotient r)) *
blockStructureSum G ends hardEnds E H s v r) =
connectedSum G ends hardEnds E H s v := by
classical
let Ξ© := (E.powerset ΓΛ’ E.powerset) ΓΛ’ H.powerset
let component (Ο : ((Finset I Γ Finset I) Γ Finset J)) : Setoid V :=
(graph (graph G ends (Ο.1.1 βͺ Ο.1.2)) hardEnds Ο.2).reachableSetoid
let weight (Ο : ((Finset I Γ Finset I) Γ Finset J)) : β :=
(β e β Ο.1.1, v e) * (β e β Ο.1.2, v e) *
s ^ components G ends Ο.1.1 * (-1 : β)^Ο.2.card
have hsum (f : ((Finset I Γ Finset I) Γ Finset J) β β) :
(β Ο : Ξ©, f Ο.1) = β A β E.powerset, β B β E.powerset,
β L β H.powerset, f ((A,B),L) := by
rw [Finset.sum_coe_sort Ξ© f]
simp only [Ξ©, sum_product]
have h := PartitionCumulant.connected_cancellation
(fun Ο : Ξ© => component Ο.1) (fun Ο : Ξ© => weight Ο.1)
have hs (r : Setoid V) :
(β Ο : Ξ©, if component Ο.1 β€ r then weight Ο.1 else 0) =
blockStructureSum G ends hardEnds E H s v r := by
exact hsum (fun Ο => if component Ο β€ r then weight Ο else 0)
have hc : (β Ο : Ξ©, if Nat.card (Quotient (component Ο.1)) = 1 then weight Ο.1 else 0) =
connectedSum G ends hardEnds E H s v := by
rw [hsum (fun Ο => if Nat.card (Quotient (component Ο)) = 1 then weight Ο else 0)]
unfold connectedSum hardSum
apply sum_congr rfl
intro A hA
apply sum_congr rfl
intro B hB
rw [mul_sum]
apply sum_congr rfl
intro L hL
change (if components (graph G ends (A βͺ B)) hardEnds L = 1 then _ else _) = _
split_ifs <;> simp [weight]
simpa only [hs, hc] using h
theorem logarithmic_structure_nonpos [Nonempty V]
(G : SimpleGraph V) (ends : I β V Γ V) (hardEnds : J β V Γ V)
(E : Finset I) (H : Finset J) {u : β} (hu : 0 < u) (hu1 : u < 1)
(v : I β β) (hv : β e β E, 0 β€ v e) :
(β r : Setoid V, PartitionCumulant.coefficient (Nat.card (Quotient r)) *
blockStructureSum G ends hardEnds E H (-u) v r) β€ 0 := by
rw [exponential_cancellation]
exact connectedSum_nonpos G ends hardEnds E H hu hu1 v hv
end BelowOne.FKPressure
end
end
section
noncomputable section
open Finset SimpleGraph Set
namespace BelowOne.FKPressure
attribute [local instance] Classical.propDecidable
variable {V : Type*} [Fintype V]
lemma component_card_block_sum (G : SimpleGraph V) (r : Setoid V)
(h : G.reachableSetoid β€ r) :
Nat.card G.ConnectedComponent =
β q : Quotient r, Nat.card
(Quotient (G.reachableSetoid.comap
(Subtype.val : Quotient.mk r β»ΒΉ' {q} β V))) := by
classical
change Nat.card (Quotient G.reachableSetoid) = _
rw [β Nat.card_congr (Setoid.sigmaQuotientEquivOfLe h)]
exact Nat.card_sigma
omit [Fintype V] in
lemma reachable_induce_block (G : SimpleGraph V) (r : Setoid V)
(h : G.reachableSetoid β€ r) (q : Quotient r)
(x y : Quotient.mk r β»ΒΉ' {q}) :
(G.induce (Quotient.mk r β»ΒΉ' {q})).Reachable x y β G.Reachable x.1 y.1 := by
constructor
Β· intro hxy
exact hxy.map (SimpleGraph.Embedding.induce _).toHom
Β· rintro β¨pβ©
have hp : β z β p.support, z β Quotient.mk r β»ΒΉ' {q} := by
intro z hz
have hr : r x.1 z := h β¨p.takeUntil z hzβ©
change Quotient.mk r z = q
exact (Quotient.sound hr).symm.trans x.property
exact β¨p.induce _ hpβ©
lemma components_induce_block_sum (G : SimpleGraph V) (r : Setoid V)
(h : G.reachableSetoid β€ r) :
Nat.card G.ConnectedComponent =
β q : Quotient r, Nat.card (G.induce (Quotient.mk r β»ΒΉ' {q})).ConnectedComponent := by
classical
rw [component_card_block_sum G r h]
apply sum_congr rfl
intro q hq
have he : G.reachableSetoid.comap (Subtype.val : Quotient.mk r β»ΒΉ' {q} β V) =
(G.induce (Quotient.mk r β»ΒΉ' {q})).reachableSetoid := by
apply Setoid.ext
intro x y
exact (reachable_induce_block G r h q x y).symm
rw [he]
rfl
lemma component_weight_block_prod (G : SimpleGraph V) (r : Setoid V)
(h : G.reachableSetoid β€ r) (s : β) :
s ^ Nat.card G.ConnectedComponent =
β q : Quotient r, s ^ Nat.card (G.induce (Quotient.mk r β»ΒΉ' {q})).ConnectedComponent := by
classical
rw [components_induce_block_sum G r h,β Finset.prod_pow_eq_pow_sum]
variable {I : Type*}
omit [Fintype V] in
lemma graph_adj_iff (G : SimpleGraph V) (ends : I β V Γ V) (A : Finset I) (x y : V) :
(graph G ends A).Adj x y β G.Adj x y β¨ β e β A, (edge (ends e).1 (ends e).2).Adj x y := by
classical
induction A using Finset.induction_on with
| empty => simp
| @insert e A he ih =>
simp only [graph_insert,SimpleGraph.sup_adj,ih]
aesop
omit [Fintype V] in
lemma endpoints_reachable (G : SimpleGraph V) (ends : I β V Γ V) {A : Finset I} {e : I}
(he : e β A) : (graph G ends A).Reachable (ends e).1 (ends e).2 := by
by_cases h : (ends e).1 = (ends e).2
Β· rw [h]
Β· apply SimpleGraph.Adj.reachable
apply (graph_adj_iff G ends A _ _).mpr
exact Or.inr β¨e,he,(edge_adj _ _ _ _).mpr β¨Or.inl β¨rfl,rflβ©,hβ©β©
omit [Fintype V] in
lemma graph_reachable_le_iff (G : SimpleGraph V) (ends : I β V Γ V) (A : Finset I)
(r : Setoid V) : (graph G ends A).reachableSetoid β€ r β
G.reachableSetoid β€ r β§ β e β A, r (ends e).1 (ends e).2 := by
constructor
Β· intro h
exact β¨fun x y hxy => h (hxy.mono le_sup_left),fun e he => h (endpoints_reachable G ends he)β©
Β· rintro β¨hG,hAβ© x y β¨pβ©
apply Quotient.exact
apply FKComponents.eq_of_walk (f := Quotient.mk r) (p := p)
intro x y hxy
apply Quotient.sound
rcases (graph_adj_iff G ends A x y).mp hxy with hxy | β¨e,he,hexyβ©
Β· exact hG hxy.reachable
Β· rcases (edge_adj _ _ _ _).mp hexy with β¨β¨rfl,rflβ© | β¨rfl,rflβ©,_β©
Β· exact hA e he
Β· exact r.symm (hA e he)
def edgeBlock (r : Setoid V) (ends : I β V Γ V) (e : I) : Quotient r := Quotient.mk r (ends e).1
omit [Fintype V] in
lemma graph_induce_filter (G : SimpleGraph V) (r : Setoid V) (ends : I β V Γ V)
(A : Finset I) (q : Quotient r) :
(graph G ends (A.filter (edgeBlock r ends Β· = q))).induce (Quotient.mk r β»ΒΉ' {q}) =
(graph G ends A).induce (Quotient.mk r β»ΒΉ' {q}) := by
classical
ext x y
simp only [SimpleGraph.induce_adj,graph_adj_iff,mem_filter]
constructor
Β· rintro (h | β¨e,β¨he,_β©,hxyβ©)
Β· exact Or.inl h
Β· exact Or.inr β¨e,he,hxyβ©
Β· rintro (h | β¨e,he,hxyβ©)
Β· exact Or.inl h
Β· refine Or.inr β¨e,β¨he,?_β©,hxyβ©
rcases (edge_adj _ _ _ _).mp hxy with β¨h | h,_β©
Β· change Quotient.mk r (ends e).1 = q
rw [β h.1]
exact x.2
Β· change Quotient.mk r (ends e).1 = q
rw [β h.2]
exact y.2
end BelowOne.FKPressure
end
end
section
noncomputable section
open Finset
namespace BelowOne.SubsetSplitting
variable {I Q : Type*} [Fintype Q]
attribute [local instance] Classical.propDecidable
abbrev Selection (E : Finset I) := β₯E.powerset
def fiber (E : Finset I) (f : I β Q) (q : Q) : Finset I := E.filter (f Β· = q)
def split (E : Finset I) (f : I β Q) (A : Selection E) (q : Q) : Selection (fiber E f q) :=
β¨A.1.filter (f Β· = q), mem_powerset.mpr (by
intro e he
have h := mem_filter.mp he
exact mem_filter.mpr β¨mem_powerset.mp A.2 h.1,h.2β©)β©
def join (E : Finset I) (f : I β Q) (B : β q, Selection (fiber E f q)) : Selection E :=
β¨univ.biUnion (fun q => (B q).1),mem_powerset.mpr (by
intro e he
obtain β¨q,_,hqβ© := mem_biUnion.mp he
exact mem_filter.mp (mem_powerset.mp (B q).2 hq) |>.1)β©
lemma join_split (E : Finset I) (f : I β Q) (A : Selection E) :
join E f (split E f A) = A := by
classical
apply Subtype.ext
ext e
simp only [join,split,mem_biUnion,mem_univ,true_and,mem_filter]
constructor
Β· rintro β¨q,he,_β©
exact he
Β· intro he
exact β¨f e,he,rflβ©
lemma split_join (E : Finset I) (f : I β Q) (B : β q, Selection (fiber E f q)) :
split E f (join E f B) = B := by
classical
funext q
apply Subtype.ext
ext e
simp only [split,join,mem_filter,mem_biUnion,mem_univ,true_and]
constructor
Β· rintro β¨β¨r,heβ©,hqβ©
have hr := mem_filter.mp (mem_powerset.mp (B r).2 he) |>.2
have hqr : q = r := hq.symm.trans hr
cases hqr
exact he
Β· intro he
exact β¨β¨q,heβ©,mem_filter.mp (mem_powerset.mp (B q).2 he) |>.2β©
def selectionEquiv (E : Finset I) (f : I β Q) : Selection E β (β q, Selection (fiber E f q)) where
toFun := split E f
invFun := join E f
left_inv := join_split E f
right_inv := split_join E f
lemma sum_factorization (E : Finset I) (f : I β Q) (W : Finset I β β)
(w : Q β Finset I β β)
(hW : β A β E, W A = β q, w q (A.filter (f Β· = q))) :
(β A β E.powerset, W A) = β q, β A β (fiber E f q).powerset, w q A := by
classical
have hs : (β A : Selection E, W A.1) =
β B : (β q, Selection (fiber E f q)), β q, w q (B q).1 := by
apply Fintype.sum_equiv (selectionEquiv E f)
intro A
exact hW A.1 (mem_powerset.mp A.2)
have hp := Fintype.prod_sum (fun q (A : Selection (fiber E f q)) => w q A.1)
simpa only [Selection,Finset.sum_coe_sort] using hs.trans hp.symm
def piTripleEquiv {Q : Type*} (A B C : Q β Type*) :
((β q, A q) Γ (β q, B q) Γ (β q, C q)) β (β q, A q Γ B q Γ C q) where
toFun p q := (p.1 q,p.2.1 q,p.2.2 q)
invFun p := (fun q => (p q).1, fun q => (p q).2.1, fun q => (p q).2.2)
left_inv p := rfl
right_inv p := by funext q; rfl
lemma sum_triple_coe {I J K : Type*} (E : Finset I) (F : Finset J) (H : Finset K)
(W : I β J β K β β) :
(β p : E Γ F Γ H, W p.1.1 p.2.1.1 p.2.2.1) =
β a β E, β b β F, β c β H, W a b c := by
simp only [Fintype.sum_prod_type]
rw [show (β a : E, β b : F, β c : H, W a.1 b.1 c.1) =
β a β E, β b : F, β c : H, W a b.1 c.1 from Finset.sum_coe_sort E (fun a => β b : F, β c : H, W a b.1 c.1)]
apply sum_congr rfl
intro a ha
rw [show (β b : F, β c : H, W a b.1 c.1) =
β b β F, β c : H, W a b c.1 from Finset.sum_coe_sort F (fun b => β c : H, W a b c.1)]
simp only [Finset.sum_coe_sort]
lemma sum_factorization_three {J K : Type*}
(E : Finset I) (F : Finset J) (H : Finset K)
(f : I β Q) (g : J β Q) (h : K β Q)
(W : Finset I β Finset J β Finset K β β)
(w : Q β Finset I β Finset J β Finset K β β)
(hW : β A β E, β B β F, β C β H,
W A B C = β q, w q (A.filter (f Β· = q)) (B.filter (g Β· = q)) (C.filter (h Β· = q))) :
(β A β E.powerset, β B β F.powerset, β C β H.powerset, W A B C) =
β q, β A β (fiber E f q).powerset, β B β (fiber F g q).powerset,
β C β (fiber H h q).powerset, w q A B C := by
classical
let e := (Equiv.prodCongr (selectionEquiv E f)
(Equiv.prodCongr (selectionEquiv F g) (selectionEquiv H h))).trans
(piTripleEquiv _ _ _)
have hs : (β p : Selection E Γ Selection F Γ Selection H, W p.1.1 p.2.1.1 p.2.2.1) =
β p : (β q, Selection (fiber E f q) Γ Selection (fiber F g q) Γ Selection (fiber H h q)),
β q, w q (p q).1.1 (p q).2.1.1 (p q).2.2.1 := by
apply Fintype.sum_equiv e
intro p
exact hW p.1.1 (mem_powerset.mp p.1.2) p.2.1.1 (mem_powerset.mp p.2.1.2)
p.2.2.1 (mem_powerset.mp p.2.2.2)
have hp := Fintype.prod_sum (fun q
(p : Selection (fiber E f q) Γ Selection (fiber F g q) Γ Selection (fiber H h q)) =>
w q p.1.1 p.2.1.1 p.2.2.1)
have hh := hs.trans hp.symm
change (β p : E.powerset Γ F.powerset Γ H.powerset, _) =
β q, β p : (fiber E f q).powerset Γ (fiber F g q).powerset Γ (fiber H h q).powerset, _ at hh
rw [sum_triple_coe] at hh
simpa only [sum_triple_coe] using hh
end BelowOne.SubsetSplitting
end
end
section
noncomputable section
open Finset SimpleGraph
namespace BelowOne.FKPressure
attribute [local instance] Classical.propDecidable
variable {V I J : Type*} [Fintype V]
lemma filter_classical (E : Finset I) (p : I β Prop) (d : DecidablePred p) :
@Finset.filter I p d E = @Finset.filter I p (fun e => Classical.propDecidable (p e)) E := by
exact @Finset.filter_congr_decidable I E p d (fun e => Classical.propDecidable (p e))
lemma powerset_filter_eq (E : Finset I) (p : I β Prop) :
(E.filter p).powerset = E.powerset.filter (fun A => β e β A, p e) := by
classical
ext A
simp only [mem_powerset,mem_filter]
constructor
Β· intro h
exact β¨fun e he => (mem_filter.mp (h he)).1,fun e he => (mem_filter.mp (h he)).2β©
Β· rintro β¨hβ,hββ© e he
exact mem_filter.mpr β¨hβ he,hβ e heβ©
lemma sum_powerset_filter (E : Finset I) (p : I β Prop) (W : Finset I β β) :
(β A β E.powerset, if β e β A, p e then W A else 0) =
β A β (E.filter p).powerset, W A := by
rw [powerset_filter_eq,sum_filter]
omit [Fintype V] in
lemma confinement_iff (G : SimpleGraph V) (ends : I β V Γ V)
(hardEnds : J β V Γ V) (A B : Finset I) (L : Finset J) (r : Setoid V)
(hG : G.reachableSetoid β€ r) :
(graph (graph G ends (A βͺ B)) hardEnds L).reachableSetoid β€ r β
(β e β A, r (ends e).1 (ends e).2) β§
(β e β B, r (ends e).1 (ends e).2) β§
(β e β L, r (hardEnds e).1 (hardEnds e).2) := by
rw [graph_reachable_le_iff,graph_reachable_le_iff]
simp only [hG,true_and,mem_union,or_imp,forall_and,and_assoc]
omit [Fintype V] in
lemma blockStructureSum_restrict (G : SimpleGraph V) (ends : I β V Γ V)
(hardEnds : J β V Γ V) (E : Finset I) (H : Finset J)
(s : β) (v : I β β) (r : Setoid V) (hG : G.reachableSetoid β€ r) :
blockStructureSum G ends hardEnds E H s v r =
β A β (E.filter (fun e => r (ends e).1 (ends e).2)).powerset,
β B β (E.filter (fun e => r (ends e).1 (ends e).2)).powerset,
β L β (H.filter (fun e => r (hardEnds e).1 (hardEnds e).2)).powerset,
(β e β A, v e) * (β e β B, v e) * s ^ components G ends A * (-1 : β)^L.card := by
unfold blockStructureSum
simp_rw [confinement_iff G ends hardEnds _ _ _ r hG]
rw [β sum_powerset_filter E (fun e => r (ends e).1 (ends e).2)]
apply sum_congr rfl
intro A hA
by_cases ha : β e β A, r (ends e).1 (ends e).2
Β· have eqa : (β e β A, r (ends e).1 (ends e).2) = True := propext (iff_true_intro ha)
simp only [eqa,true_and,ite_true]
rw [β sum_powerset_filter E (fun e => r (ends e).1 (ends e).2)]
apply sum_congr rfl
intro B hB
by_cases hb : β e β B, r (ends e).1 (ends e).2
Β· have eqb : (β e β B, r (ends e).1 (ends e).2) = True := propext (iff_true_intro hb)
simp only [eqb,true_and,ite_true]
rw [sum_powerset_filter]
Β· simp [hb]
Β· simp [ha]
def inducedBlockMoment (G : SimpleGraph V) (ends : I β V Γ V)
(hardEnds : J β V Γ V) (E : Finset I) (H : Finset J)
(s : β) (v : I β β) (r : Setoid V) (q : Quotient r) : β :=
β A β (E.filter (fun e => r (ends e).1 (ends e).2 β§ edgeBlock r ends e = q)).powerset,
β B β (E.filter (fun e => r (ends e).1 (ends e).2 β§ edgeBlock r ends e = q)).powerset,
β L β (H.filter (fun e => r (hardEnds e).1 (hardEnds e).2 β§ edgeBlock r hardEnds e = q)).powerset,
(β e β A, v e) * (β e β B, v e) *
s ^ Nat.card ((graph G ends A).induce (Quotient.mk r β»ΒΉ' {q})).ConnectedComponent * (-1 : β)^L.card
lemma structure_weight_factor (G : SimpleGraph V) (ends : I β V Γ V)
(hardEnds : J β V Γ V) (A B : Finset I) (L : Finset J)
(s : β) (v : I β β) (r : Setoid V) (hA : (graph G ends A).reachableSetoid β€ r) :
(β e β A, v e) * (β e β B, v e) * s ^ components G ends A * (-1 : β)^L.card =
β q : Quotient r,
(β e β A.filter (edgeBlock r ends Β· = q), v e) *
(β e β B.filter (edgeBlock r ends Β· = q), v e) *
s ^ Nat.card ((graph G ends (A.filter (edgeBlock r ends Β· = q))).induce
(Quotient.mk r β»ΒΉ' {q})).ConnectedComponent *
(-1 : β)^(L.filter (edgeBlock r hardEnds Β· = q)).card := by
classical
simp_rw [graph_induce_filter,Finset.prod_mul_distrib]
rw [prod_fiberwise,prod_fiberwise]
congr 1
Β· congr 1
exact component_weight_block_prod (graph G ends A) r hA s
Β· simpa only [prod_const] using
(prod_fiberwise L (edgeBlock r hardEnds) (fun _ => (-1:β))).symm
lemma blockStructureSum_factorization (G : SimpleGraph V) (ends : I β V Γ V)
(hardEnds : J β V Γ V) (E : Finset I) (H : Finset J)
(s : β) (v : I β β) (r : Setoid V) (hG : G.reachableSetoid β€ r) :
blockStructureSum G ends hardEnds E H s v r =
β q : Quotient r, inducedBlockMoment G ends hardEnds E H s v r q := by
rw [blockStructureSum_restrict G ends hardEnds E H s v r hG]
have hf := SubsetSplitting.sum_factorization_three
(E.filter (fun e => r (ends e).1 (ends e).2))
(E.filter (fun e => r (ends e).1 (ends e).2))
(H.filter (fun e => r (hardEnds e).1 (hardEnds e).2))
(edgeBlock r ends) (edgeBlock r ends) (edgeBlock r hardEnds)
(fun A B L => (β e β A, v e) * (β e β B, v e) * s ^ components G ends A * (-1 : β)^L.card)
(fun q A B L => (β e β A, v e) * (β e β B, v e) *
s ^ Nat.card ((graph G ends A).induce (Quotient.mk r β»ΒΉ' {q})).ConnectedComponent * (-1 : β)^L.card)
(by
intro A hA B hB L hL
simpa only [filter_classical] using structure_weight_factor G ends hardEnds A B L s v r
((graph_reachable_le_iff G ends A r).mpr β¨hG,fun e he => (mem_filter.mp (hA he)).2β©))
simpa only [SubsetSplitting.fiber,filter_filter,inducedBlockMoment,filter_classical] using hf
end BelowOne.FKPressure
end
end
section
noncomputable section
open Finset
open scoped Classical
namespace BelowOne.MultiaffineDerivative
variable {V : Type*} [Fintype V]
abbrev coordinate (i : V) : (V β β) := Pi.single i 1
def restrict (T : Finset V) : (V β β) βL[β] (T β β) :=
ContinuousLinearMap.pi (fun i => ContinuousLinearMap.proj i.1)
omit [Fintype V] in
lemma restrict_apply (T : Finset V) (x : V β β) (i : T) : restrict T x i = x i.1 := rfl
def Matches {n : β} (Ο : Fin n β V) {T : Finset V} (e : Fin n βͺ T) : Prop :=
β t : T, β i, e i = t β§ Ο i = t.1
omit [Fintype V] in
lemma matches_iff {n : β} (Ο : Fin n β V) {T : Finset V} (e : Fin n βͺ T) :
Matches Ο e β (β i, Ο i = (e i).1) β§ Function.Surjective e := by
constructor
Β· intro h
constructor
Β· intro i
obtain β¨j,hj,hΟβ© := h (e i)
have hji := e.injective hj
simpa [hji] using hΟ
Β· intro t
obtain β¨i,hi,_β© := h t
exact β¨i,hiβ©
Β· rintro β¨hΟ,heβ© t
obtain β¨i,rflβ© := he t
exact β¨i,rfl,hΟ iβ©
omit [Fintype V] in
lemma matches_data {n : β} {Ο : Fin n β V} {T : Finset V} {e : Fin n βͺ T}
(h : Matches Ο e) : Function.Injective Ο β§ univ.image Ο = T := by
obtain β¨hΟ,heβ© := (matches_iff Ο e).mp h
constructor
Β· intro i j hij
apply e.injective
apply Subtype.ext
rw [βhΟ i,βhΟ j,hij]
Β· ext t
simp only [mem_image,mem_univ,true_and]
constructor
Β· rintro β¨i,rflβ©
rw [hΟ i]
exact (e i).2
Β· intro ht
obtain β¨i,hiβ© := he β¨t,htβ©
exact β¨i,(hΟ i).trans (congrArg Subtype.val hi)β©
omit [Fintype V] in
lemma matches_unique {n : β} {Ο : Fin n β V} {T : Finset V} {e f : Fin n βͺ T}
(he : Matches Ο e) (hf : Matches Ο f) : e = f := by
ext i
exact ((matches_iff Ο e).mp he).1 i |>.symm.trans (((matches_iff Ο f).mp hf).1 i)
def matchingEmbedding {n : β} (Ο : Fin n β V) (T : Finset V)
(h : Function.Injective Ο β§ univ.image Ο = T) : Fin n βͺ T where
toFun i := β¨Ο i,by rw [βh.2]; exact mem_image_of_mem Ο (mem_univ i)β©
inj' := fun i j hij => h.1 (congrArg Subtype.val hij)
omit [Fintype V] in
lemma matchingEmbedding_matches {n : β} (Ο : Fin n β V) (T : Finset V)
(h : Function.Injective Ο β§ univ.image Ο = T) : Matches Ο (matchingEmbedding Ο T h) := by
intro t
have ht : t.1 β univ.image Ο := by rw [h.2]; exact t.2
obtain β¨i,_,hiβ© := mem_image.mp ht
refine β¨i,?_,hiβ©
exact Subtype.ext hi
omit [Fintype V] in
lemma sum_matches {n : β} (Ο : Fin n β V) (T : Finset V) :
(β e : Fin n βͺ T, if Matches Ο e then (1:β) else 0) =
if Function.Injective Ο β§ univ.image Ο = T then 1 else 0 := by
by_cases h : Function.Injective Ο β§ univ.image Ο = T
Β· rw [ite_eq_left h]
let e := matchingEmbedding Ο T h
have he := matchingEmbedding_matches Ο T h
rw [Fintype.sum_eq_single e]
Β· exact ite_eq_left he
Β· intro f hf
exact ite_eq_right (fun hh => hf (matches_unique hh he))
Β· rw [ite_eq_right h]
apply sum_eq_zero
intro e he
exact ite_eq_right (fun hh => h (matches_data hh))
omit [Fintype V] in
lemma factor_indicator {n : β} (Ο : Fin n β V) (T : Finset V) (e : Fin n βͺ T) (t : T) :
(if ht : t β Set.range e then
coordinate (Ο (e.toEquivRange.symm β¨t,htβ©)) t.1 else 0) =
if β i, e i = t β§ Ο i = t.1 then (1:β) else 0 := by
by_cases ht : t β Set.range e
Β· obtain β¨i,rflβ© := ht
rw [dite_eq_left (Set.mem_range_self i)]
have hi : e.toEquivRange.symm β¨e i, Set.mem_range_self iβ© = i :=
e.toEquivRange.symm_apply_apply i
rw [hi]
simp [coordinate,Pi.single_apply,e.injective.eq_iff,eq_comm]
Β· rw [dite_eq_right ht,ite_eq_right]
rintro β¨i,hi,_β©
exact ht β¨i,hiβ©
lemma prod_indicator {T : Type*} [Fintype T] (p : T β Prop) :
(β t : T, if p t then (1:β) else 0) = if β t, p t then 1 else 0 := by
by_cases h : β t, p t
Β· simp [h]
Β· rw [ite_eq_right h]
obtain β¨t,htβ© := not_forall.mp h
exact Finset.prod_eq_zero (mem_univ t) (ite_eq_right ht)
lemma ite_classical {Ξ± : Sort*} (p : Prop) (d : Decidable p) (a b : Ξ±) :
@ite Ξ± p d a b = @ite Ξ± p (Classical.propDecidable p) a b := by
cases d <;> simp_all
lemma dite_classical {Ξ± : Sort*} (p : Prop) (d : Decidable p) (a : p β Ξ±) (b : Β¬p β Ξ±) :
@dite Ξ± p d a b = @dite Ξ± p (Classical.propDecidable p) a b := by
cases d <;> simp_all
lemma range_equiv_classical {Ξ± Ξ² : Type*} [Fintype Ξ±] (d : DecidableEq Ξ²) (e : Ξ± βͺ Ξ²) :
@Function.Embedding.toEquivRange Ξ± Ξ² _ d e =
@Function.Embedding.toEquivRange Ξ± Ξ² _ (fun a b => Classical.propDecidable (a = b)) e := by
ext i
rfl
lemma monomial_derivative {n : β} (Ο : Fin n β V) (T : Finset V) :
iteratedFDeriv β n (fun x : V β β => β i β T, x i) 0 (coordinate β Ο) =
if Function.Injective Ο β§ univ.image Ο = T then 1 else 0 := by
let f := ContinuousMultilinearMap.mkPiAlgebra β T β
have hf : (fun x : V β β => β i β T, x i) = f β restrict T := by
funext x
simp only [Function.comp_apply,f,ContinuousMultilinearMap.mkPiAlgebra_apply,restrict_apply]
exact (Finset.prod_coe_sort T x).symm
rw [hf,ContinuousLinearMap.iteratedFDeriv_comp_right _ f.contDiff _ le_rfl]
rw [f.iteratedFDeriv_eq]
simp only [ContinuousMultilinearMap.compContinuousLinearMap_apply,
ContinuousMultilinearMap.iteratedFDeriv,_root_.sum_apply,
ContinuousMultilinearMap.iteratedFDerivComponent_apply,
ContinuousLinearMap.map_zero,Pi.zero_apply,
Function.comp_apply,restrict_apply,f,ContinuousMultilinearMap.mkPiAlgebra_apply]
trans β e : Fin n βͺ T, if Matches Ο e then (1:β) else 0
Β· apply sum_congr rfl
intro e he
trans β t : T, if β i, e i = t β§ Ο i = t.1 then (1:β) else 0
Β· apply prod_congr rfl
intro t ht
simpa only [range_equiv_classical,ite_classical,dite_classical] using factor_indicator Ο T e t
Β· by_cases hm : Matches Ο e
Β· rw [ite_eq_left hm]
apply prod_eq_one
intro t ht
exact ite_eq_left (hm t)
Β· rw [ite_eq_right hm]
obtain β¨t,htβ© := not_forall.mp hm
exact prod_eq_zero (mem_univ t) (ite_eq_right ht)
Β· exact sum_matches Ο T
end BelowOne.MultiaffineDerivative
end
end
section
noncomputable section
open Finset
open scoped Classical ContDiff
namespace BelowOne.MultiaffineDerivative
variable {V : Type*} [Fintype V]
lemma contDiff_monomial (T : Finset V) (n : ββΟ) :
ContDiff β n (fun x : V β β => β i β T, x i) := by
fun_prop
lemma weighted_monomial_derivative {n : β} (Ο : Fin n β V) (T : Finset V) (c : β) :
iteratedFDeriv β n (fun x : V β β => c * β i β T, x i) 0 (coordinate β Ο) =
if Function.Injective Ο β§ univ.image Ο = T then c else 0 := by
change iteratedFDeriv β n (fun x : V β β => c β’ β i β T, x i) 0 (coordinate β Ο) = _
rw [iteratedFDeriv_const_smul_apply' (contDiff_monomial T n).contDiffAt]
simp only [_root_.smul_apply,smul_eq_mul,monomial_derivative]
split_ifs <;> simp
def polynomial (W : Finset V β β) (x : V β β) : β :=
β T : Finset V, W T * β i β T, x i
lemma contDiff_polynomial (W : Finset V β β) (n : ββΟ) :
ContDiff β n (polynomial W) := by
unfold polynomial
fun_prop
lemma polynomial_derivative (W : Finset V β β) {n : β} (Ο : Fin n β V) :
iteratedFDeriv β n (polynomial W) 0 (coordinate β Ο) =
if Function.Injective Ο then W (univ.image Ο) else 0 := by
unfold polynomial
rw [iteratedFDeriv_fun_sum_apply
(fun T hT => (contDiff_const.mul (contDiff_monomial T n)).contDiffAt)]
simp only [_root_.sum_apply,weighted_monomial_derivative]
by_cases hΟ : Function.Injective Ο
Β· simp only [hΟ,true_and,ite_true]
simp [eq_comm]
Β· simp [hΟ]
lemma polynomial_zero (W : Finset V β β) : polynomial W 0 = W β
:= by
have h := polynomial_derivative W (fun i : Fin 0 => i.elim0)
simpa only [iteratedFDeriv_zero_apply,Finset.univ_eq_empty,Finset.image_empty,
Function.injective_of_subsingleton,ite_true] using h
end BelowOne.MultiaffineDerivative
end
end
section
noncomputable section
open Finset Function Set
namespace BelowOne.OrderedPartitionBridge
variable {n : β}
def partition (c : OrderedFinpartition n) : Setoid (Fin n) := Setoid.ker c.index
lemma index_emb (c : OrderedFinpartition n) (i : Fin c.length) (j : Fin (c.partSize i)) :
c.index (c.emb i j) = i := by
exact congrArg Sigma.fst (c.equivSigma.left_inv β¨i,jβ©)
lemma index_surjective (c : OrderedFinpartition n) : Surjective c.index := by
intro i
exact β¨c.emb i β¨0,c.partSize_pos iβ©,index_emb c i _β©
lemma card_partition (c : OrderedFinpartition n) : Nat.card (Quotient (partition c)) = c.length := by
unfold partition
rw [Nat.card_congr (Setoid.quotientKerEquivOfSurjective c.index (index_surjective c)),Nat.card_fin]
def maximum (c : OrderedFinpartition n) (i : Fin c.length) : Fin n :=
c.emb i β¨c.partSize i - 1, Nat.sub_one_lt_of_lt (c.partSize_pos i)β©
lemma index_maximum (c : OrderedFinpartition n) (i : Fin c.length) :
c.index (maximum c i) = i := index_emb c _ _
lemma le_maximum (c : OrderedFinpartition n) (x : Fin n) :
x β€ maximum c (c.index x) := by
nth_rw 1 [β c.emb_invEmbedding x]
exact (c.emb_strictMono _).monotone (Fin.le_iff_val_le_val.mpr (Nat.le_sub_one_of_lt (c.invEmbedding x).isLt))
lemma relation_iff_range (c : OrderedFinpartition n) (i : Fin c.length) (x : Fin n) :
c.index x = i β x β Set.range (c.emb i) := by
constructor
Β· intro h
subst i
exact β¨c.invEmbedding x,c.emb_invEmbedding xβ©
Β· rintro β¨j,rflβ©
exact index_emb c _ _
lemma maximum_eq_of_partition_eq (c d : OrderedFinpartition n)
(h : partition c = partition d) (x : Fin n) :
maximum c (c.index x) = maximum d (d.index x) := by
apply le_antisymm
Β· have hr : d.index (maximum c (c.index x)) = d.index x := by
apply (Setoid.ext_iff.mp h _ _).mp
exact index_maximum c _
simpa only [hr] using le_maximum d (maximum c (c.index x))
Β· have hr : c.index (maximum d (d.index x)) = c.index x := by
apply (Setoid.ext_iff.mp h _ _).mpr
exact index_maximum d _
simpa only [hr] using le_maximum c (maximum d (d.index x))
lemma partition_injective : Injective (partition (n := n)) := by
intro c d h
have hl : c.length = d.length := (card_partition c).symm.trans
((congrArg (fun r : Setoid (Fin n) => Nat.card (Quotient r)) h).trans (card_partition d))
have hm : Set.range (maximum c) = Set.range (maximum d) := by
ext x
constructor
Β· rintro β¨i,rflβ©
refine β¨d.index (maximum c i),?_β©
simpa only [index_maximum] using (maximum_eq_of_partition_eq c d h (maximum c i)).symm
Β· rintro β¨i,rflβ©
refine β¨c.index (maximum d i),?_β©
simpa only [index_maximum] using maximum_eq_of_partition_eq c d h (maximum d i)
cases c with | mk cl cs cp ce cm co cd cc =>
cases d with | mk dl ds dp de dm do' dd dc =>
dsimp only at hl
subst dl
have hmax : (fun i => ce i β¨cs i - 1,Nat.sub_one_lt_of_lt (cp i)β©) =
(fun i => de i β¨ds i - 1,Nat.sub_one_lt_of_lt (dp i)β©) :=
co.range_inj_of_wellFoundedLT do' |>.mp hm
have hr (i : Fin cl) : Set.range (ce i) = Set.range (de i) := by
ext x
let c' : OrderedFinpartition n := β¨cl,cs,cp,ce,cm,co,cd,ccβ©
let d' : OrderedFinpartition n := β¨cl,ds,dp,de,dm,do',dd,dcβ©
rw [β relation_iff_range c' i x,β relation_iff_range d' i x]
have hx := Setoid.ext_iff.mp h x (ce i β¨cs i-1,Nat.sub_one_lt_of_lt (cp i)β©)
change (c'.index x = c'.index (ce i β¨cs i-1,Nat.sub_one_lt_of_lt (cp i)β©)) β
(d'.index x = d'.index (ce i β¨cs i-1,Nat.sub_one_lt_of_lt (cp i)β©)) at hx
have hci : c'.index (ce i β¨cs i-1,Nat.sub_one_lt_of_lt (cp i)β©) = i :=
index_emb c' _ _
have hdi : d'.index (ce i β¨cs i-1,Nat.sub_one_lt_of_lt (cp i)β©) = i := by
rw [congrFun hmax i]
exact index_emb d' _ _
simpa only [hci,hdi] using hx
have hs : cs = ds := by
funext i
have hh := Nat.card_congr (Set.equivOfEq (hr i))
simpa only [Nat.card_range_of_injective (cm i).injective,
Nat.card_range_of_injective (dm i).injective, Nat.card_fin] using hh
subst ds
have he : ce = de := by
funext i
exact ((cm i).range_inj_of_wellFoundedLT (dm i)).mp (hr i)
subst de
rfl
def block (r : Setoid (Fin n)) (x : Fin n) : Finset (Fin n) := by
classical
exact univ.filter (r x)
@[simp] lemma mem_block (r : Setoid (Fin n)) (x y : Fin n) : y β block r x β r x y := by
classical
simp [block]
lemma block_nonempty (r : Setoid (Fin n)) (x : Fin n) : (block r x).Nonempty :=
β¨x,(mem_block r x x).mpr (r.refl x)β©
lemma block_eq (r : Setoid (Fin n)) {x y : Fin n} (h : r x y) : block r x = block r y := by
ext z
simp only [mem_block]
exact β¨fun hx => r.trans (r.symm h) hx,fun hy => r.trans h hyβ©
def blockMax (r : Setoid (Fin n)) (x : Fin n) : Fin n :=
(block r x).max' (block_nonempty r x)
lemma blockMax_related (r : Setoid (Fin n)) (x : Fin n) : r x (blockMax r x) :=
(mem_block r x _).mp (max'_mem _ _)
lemma blockMax_eq (r : Setoid (Fin n)) {x y : Fin n} (h : r x y) : blockMax r x = blockMax r y := by
simp only [blockMax,block_eq r h]
def maxima (r : Setoid (Fin n)) : Finset (Fin n) := by
classical
exact univ.image (blockMax r)
lemma maximum_fixed (r : Setoid (Fin n)) {x : Fin n} (h : x β maxima r) : blockMax r x = x := by
classical
obtain β¨y,_,rflβ© := mem_image.mp h
exact (blockMax_eq r (blockMax_related r y)).symm
lemma blockMax_mem (r : Setoid (Fin n)) (x : Fin n) : blockMax r x β maxima r := by
classical
exact mem_image_of_mem _ (mem_univ x)
def ofSetoid (r : Setoid (Fin n)) : OrderedFinpartition n where
length := (maxima r).card
partSize i := (block r ((maxima r).orderEmbOfFin rfl i)).card
partSize_pos i := card_pos.mpr (block_nonempty r _)
emb i := (block r ((maxima r).orderEmbOfFin rfl i)).orderEmbOfFin rfl
emb_strictMono i := OrderEmbedding.strictMono _
parts_strictMono := by
have hm (i : Fin (maxima r).card) :
(block r ((maxima r).orderEmbOfFin rfl i)).orderEmbOfFin rfl
β¨(block r ((maxima r).orderEmbOfFin rfl i)).card-1,
Nat.sub_one_lt_of_lt (card_pos.mpr (block_nonempty r _))β© =
(maxima r).orderEmbOfFin rfl i := by
rw [orderEmbOfFin_last rfl (card_pos.mpr (block_nonempty r _))]
exact maximum_fixed r (orderEmbOfFin_mem _ _ _)
simpa only [hm] using (maxima r).orderEmbOfFin rfl |>.strictMono
disjoint := by
intro i _ j _ hij
dsimp only [Function.onFun]
rw [range_orderEmbOfFin,range_orderEmbOfFin]
apply Set.disjoint_left.mpr
intro x hi hj
have hr := r.trans (mem_block r _ x |>.mp hi) (r.symm (mem_block r _ x |>.mp hj))
have he := blockMax_eq r hr
rw [maximum_fixed r (orderEmbOfFin_mem _ _ _),
maximum_fixed r (orderEmbOfFin_mem _ _ _)] at he
exact hij ((maxima r).orderEmbOfFin rfl |>.injective he)
cover := by
intro x
obtain β¨i,hiβ© : β i : Fin (maxima r).card,
(maxima r).orderEmbOfFin rfl i = blockMax r x := by
apply Set.mem_range.mp
rw [range_orderEmbOfFin]
exact blockMax_mem r x
refine β¨i,?_β©
rw [range_orderEmbOfFin]
apply (mem_block r _ x).mpr
rw [hi]
exact r.symm (blockMax_related r x)
lemma range_ofSetoid (r : Setoid (Fin n)) (i : Fin (ofSetoid r).length) :
Set.range ((ofSetoid r).emb i) = block r ((maxima r).orderEmbOfFin rfl i) :=
range_orderEmbOfFin _ _
@[simp] lemma partition_ofSetoid (r : Setoid (Fin n)) : partition (ofSetoid r) = r := by
apply Setoid.ext
intro x y
change (ofSetoid r).index x = (ofSetoid r).index y β r x y
have hx := (relation_iff_range (ofSetoid r) ((ofSetoid r).index x) x).mp rfl
rw [range_ofSetoid] at hx
have hy := (relation_iff_range (ofSetoid r) ((ofSetoid r).index y) y).mp rfl
rw [range_ofSetoid] at hy
constructor
Β· intro h
rw [β h] at hy
exact r.trans (r.symm ((mem_block r _ _).mp hx)) ((mem_block r _ _).mp hy)
Β· intro h
apply Eq.symm
apply (relation_iff_range (ofSetoid r) ((ofSetoid r).index x) y).mpr
rw [range_ofSetoid]
exact (mem_block r _ _).mpr (r.trans ((mem_block r _ _).mp hx) h)
def partitionEquiv (n : β) : OrderedFinpartition n β Setoid (Fin n) :=
Equiv.ofBijective partition β¨partition_injective,fun r => β¨ofSetoid r,partition_ofSetoid rβ©β©
end BelowOne.OrderedPartitionBridge
end
end
section
noncomputable section
open Finset Filter
open scoped Topology
namespace BelowOne.PartitionCumulant
lemma iteratedDeriv_succ_log {n : β} {x : β} (hx : x β 0) :
iteratedDeriv (n+1) Real.log x = (-1 : β)^n * n.factorial * x^(-(n:β€)-1) := by
have heq : deriv Real.log =αΆ [π x] Inv.inv := by
filter_upwards [eventually_ne_nhds hx] with y hy
simp [Real.deriv_log]
rw [iteratedDeriv_succ',heq.iteratedDeriv_eq,iteratedDeriv_eq_iterate,iter_deriv_inv]
grind
lemma iteratedDeriv_log_one {n : β} (hn : 0 < n) :
iteratedDeriv n Real.log 1 = coefficient n := by
obtain β¨k,rflβ© := Nat.exists_eq_succ_of_ne_zero (Nat.ne_zero_of_lt hn)
simp [iteratedDeriv_succ_log (by norm_num : (1:β) β 0),coefficient]
variable {E : Type*} [NormedAddCommGroup E] [NormedSpace β E]
lemma iteratedFDeriv_log_comp {f : E β β} {x : E} {n : β}
(hf : ContDiffAt β n f x) (hx : f x = 1) (hn : 0 < n) (v : Fin n β E) :
iteratedFDeriv β n (Real.log β f) x v =
β c : OrderedFinpartition n, coefficient c.length *
β i : Fin c.length, iteratedFDeriv β (c.partSize i) f x (v β c.emb i) := by
have hg : ContDiffAt β n Real.log (f x) := by
rw [hx]
exact Real.contDiffAt_log.mpr (by norm_num)
rw [iteratedFDeriv_comp hg hf (le_refl _)]
simp only [FormalMultilinearSeries.taylorComp,_root_.sum_apply,
FormalMultilinearSeries.compAlongOrderedFinpartition_apply,ftaylorSeries]
apply sum_congr rfl
intro c hc
have hcl : 0 < c.length := Nat.pos_of_ne_zero (fun h => by
have hi := (c.index β¨0,hnβ©).isLt
omega)
rw [hx,iteratedFDeriv_apply_eq_iteratedDeriv_mul_prod,
iteratedDeriv_log_one hcl]
simp only [smul_eq_mul,mul_comm]
rfl
def blockDerivative {n : β} (f : E β β) (x : E) (v : Fin n β E)
(r : Setoid (Fin n)) : β :=
let c := OrderedPartitionBridge.ofSetoid r
β i : Fin c.length, iteratedFDeriv β (c.partSize i) f x (v β c.emb i)
lemma logarithmic_derivative_partition_sum {f : E β β} {x : E} {n : β}
(hf : ContDiffAt β n f x) (hx : f x = 1) (hn : 0 < n) (v : Fin n β E) :
iteratedFDeriv β n (Real.log β f) x v =
β r : Setoid (Fin n), coefficient (Nat.card (Quotient r)) * blockDerivative f x v r := by
rw [iteratedFDeriv_log_comp hf hx hn]
apply Fintype.sum_equiv (OrderedPartitionBridge.partitionEquiv n)
intro c
have hc : OrderedPartitionBridge.ofSetoid (OrderedPartitionBridge.partition c) = c := by
apply OrderedPartitionBridge.partition_injective
simp
change coefficient c.length * _ = coefficient
(Nat.card (Quotient (OrderedPartitionBridge.partition c))) * _
rw [OrderedPartitionBridge.card_partition]
change _ = coefficient c.length * blockDerivative f x v (OrderedPartitionBridge.partition c)
unfold blockDerivative
rw [hc]
end BelowOne.PartitionCumulant
end
end
section
noncomputable section
open Finset SimpleGraph
open scoped Classical ContDiff
namespace BelowOne.FKPressure
variable {V I J : Type*} [Fintype V]
def siteMoment (ends : I β V Γ V) (hardEnds : J β V Γ V)
(E : Finset I) (H : Finset J) (s : β) (v : I β β) (T : Set V) : β :=
β A β (E.filter (fun e => (ends e).1 β T β§ (ends e).2 β T)).powerset,
β B β (E.filter (fun e => (ends e).1 β T β§ (ends e).2 β T)).powerset,
β L β (H.filter (fun e => (hardEnds e).1 β T β§ (hardEnds e).2 β T)).powerset,
(β e β A, v e) * (β e β B, v e) *
s ^ Nat.card ((graph (β₯ : SimpleGraph V) ends A).induce T).ConnectedComponent * (-1 : β)^L.card
omit [Fintype V] in
lemma siteMoment_empty (ends : I β V Γ V) (hardEnds : J β V Γ V)
(E : Finset I) (H : Finset J) (s : β) (v : I β β) :
siteMoment ends hardEnds E H s v β
= 1 := by
simp [siteMoment,Nat.card_eq_fintype_card]
omit [Fintype V] in
lemma block_edge_iff (r : Setoid V) (ends : I β V Γ V) (q : Quotient r) (e : I) :
r (ends e).1 (ends e).2 β§ edgeBlock r ends e = q β
(ends e).1 β Quotient.mk r β»ΒΉ' {q} β§ (ends e).2 β Quotient.mk r β»ΒΉ' {q} := by
change (r (ends e).1 (ends e).2 β§ Quotient.mk r (ends e).1 = q) β
Quotient.mk r (ends e).1 = q β§ Quotient.mk r (ends e).2 = q
constructor
Β· rintro β¨h,eβ©
exact β¨e,(Quotient.sound h).symm.trans eβ©
Β· rintro β¨hβ,hββ©
exact β¨Quotient.exact (hβ.trans hβ.symm),hββ©
omit [Fintype V] in
lemma inducedBlockMoment_eq_siteMoment (ends : I β V Γ V) (hardEnds : J β V Γ V)
(E : Finset I) (H : Finset J) (s : β) (v : I β β) (r : Setoid V) (q : Quotient r) :
inducedBlockMoment β₯ ends hardEnds E H s v r q =
siteMoment ends hardEnds E H s v (Quotient.mk r β»ΒΉ' {q}) := by
unfold inducedBlockMoment siteMoment
simp_rw [block_edge_iff]
omit [Fintype V] in
lemma bot_reachable_le (r : Setoid V) : (β₯ : SimpleGraph V).reachableSetoid β€ r := by
intro x y h
have hx := SimpleGraph.reachable_bot.mp h
exact hx βΈ r.refl x
lemma blockStructureSum_siteMoment (ends : I β V Γ V) (hardEnds : J β V Γ V)
(E : Finset I) (H : Finset J) (s : β) (v : I β β) (r : Setoid V) :
blockStructureSum β₯ ends hardEnds E H s v r =
β q : Quotient r, siteMoment ends hardEnds E H s v (Quotient.mk r β»ΒΉ' {q}) := by
rw [blockStructureSum_factorization _ ends hardEnds E H s v r (bot_reachable_le r)]
simp_rw [inducedBlockMoment_eq_siteMoment]
def sitePolynomial (ends : I β V Γ V) (hardEnds : J β V Γ V)
(E : Finset I) (H : Finset J) (s : β) (v : I β β) : (V β β) β β :=
MultiaffineDerivative.polynomial (fun T : Finset V => siteMoment ends hardEnds E H s v T)
lemma sitePolynomial_zero (ends : I β V Γ V) (hardEnds : J β V Γ V)
(E : Finset I) (H : Finset J) (s : β) (v : I β β) :
sitePolynomial ends hardEnds E H s v 0 = 1 := by
rw [sitePolynomial,MultiaffineDerivative.polynomial_zero]
simpa only [Finset.coe_empty] using siteMoment_empty ends hardEnds E H s v
lemma coe_image_emb {n : β} (c : OrderedFinpartition n) (i : Fin c.length) :
((univ.image (c.emb i) : Finset (Fin n)) : Set (Fin n)) = Set.range (c.emb i) := by
ext x
simp
lemma product_moments_partition {n : β}
(W : Set (Fin n) β β) (c : OrderedFinpartition n) :
(β q : Quotient (OrderedPartitionBridge.partition c),
W (Quotient.mk (OrderedPartitionBridge.partition c) β»ΒΉ' {q})) =
β i : Fin c.length, W (Set.range (c.emb i)) := by
unfold OrderedPartitionBridge.partition
let e := Setoid.quotientKerEquivOfSurjective c.index
(OrderedPartitionBridge.index_surjective c)
apply Fintype.prod_equiv e
intro q
congr 1
ext x
change Quotient.mk (Setoid.ker c.index) x = q β _
constructor
Β· intro hx
exact (OrderedPartitionBridge.relation_iff_range c (e q) x).mp (congrArg e hx)
Β· intro hx
apply e.injective
exact (OrderedPartitionBridge.relation_iff_range c (e q) x).mpr hx
lemma blockDerivative_sitePolynomial {n : β}
(ends : I β Fin n Γ Fin n) (hardEnds : J β Fin n Γ Fin n)
(E : Finset I) (H : Finset J) (s : β) (v : I β β) (r : Setoid (Fin n)) :
PartitionCumulant.blockDerivative (sitePolynomial ends hardEnds E H s v) 0
MultiaffineDerivative.coordinate r =
blockStructureSum β₯ ends hardEnds E H s v r := by
unfold PartitionCumulant.blockDerivative
let c := OrderedPartitionBridge.ofSetoid r
have hp : OrderedPartitionBridge.partition c = r := OrderedPartitionBridge.partition_ofSetoid r
have heq : (β q : Quotient r, siteMoment ends hardEnds E H s v (Quotient.mk r β»ΒΉ' {q})) =
β i : Fin c.length, siteMoment ends hardEnds E H s v (Set.range (c.emb i)) := by
rw [β hp]
exact product_moments_partition _ c
rw [blockStructureSum_siteMoment,heq]
change (β i : Fin c.length, _) = _
apply prod_congr rfl
intro i hi
rw [sitePolynomial,MultiaffineDerivative.polynomial_derivative,
ite_eq_left (c.emb_strictMono i).injective]
simp only [Finset.coe_image,Finset.coe_univ,Set.image_univ,c]
theorem sitePolynomial_log_derivative {n : β} (hn : 0 < n)
(ends : I β Fin n Γ Fin n) (hardEnds : J β Fin n Γ Fin n)
(E : Finset I) (H : Finset J) (s : β) (v : I β β) :
iteratedFDeriv β n (Real.log β sitePolynomial ends hardEnds E H s v) 0
MultiaffineDerivative.coordinate = connectedSum β₯ ends hardEnds E H s v := by
have : NeZero n := β¨Nat.ne_zero_of_lt hnβ©
have hf : ContDiffAt β n (sitePolynomial ends hardEnds E H s v) 0 :=
(MultiaffineDerivative.contDiff_polynomial _ n).contDiffAt
rw [PartitionCumulant.logarithmic_derivative_partition_sum hf
(sitePolynomial_zero ends hardEnds E H s v) hn]
simp_rw [blockDerivative_sitePolynomial]
exact exponential_cancellation β₯ ends hardEnds E H s v
theorem sitePolynomial_log_derivative_nonpos {n : β} (hn : 0 < n)
(ends : I β Fin n Γ Fin n) (hardEnds : J β Fin n Γ Fin n)
(E : Finset I) (H : Finset J) {u : β} (hu : 0 < u) (hu1 : u < 1)
(v : I β β) (hv : β e β E, 0 β€ v e) :
iteratedFDeriv β n (Real.log β sitePolynomial ends hardEnds E H (-u) v) 0
MultiaffineDerivative.coordinate β€ 0 := by
rw [sitePolynomial_log_derivative hn]
exact connectedSum_nonpos β₯ ends hardEnds E H hu hu1 v hv
end BelowOne.FKPressure
end
end
section
noncomputable section
open Finset SimpleGraph
open scoped Classical
namespace BelowOne.FKPressure
variable {V I J : Type*} [Fintype V]
def inducedPartition (ends : I β V Γ V) (E : Finset I)
(s : β) (v : I β β) (T : Set V) : β :=
β A β (E.filter (fun e => (ends e).1 β T β§ (ends e).2 β T)).powerset,
(β e β A, v e) *
s ^ Nat.card ((graph (β₯ : SimpleGraph V) ends A).induce T).ConnectedComponent
lemma alternating_powerset (H : Finset J) :
(β L β H.powerset, (-1 : β)^L.card) = if H = β
then 1 else 0 := by
have hh : (β L β H.powerset, (-1 : β)^L.card) = β h β H, (1 + (-1 : β)) := by
simpa only [prod_const] using (prod_one_add (f := fun _ : J => (-1:β)) H).symm
rw [hh]
by_cases h : H = β
Β· simp [h]
Β· rw [ite_eq_right h]
obtain β¨e,heβ© := nonempty_iff_ne_empty.mpr h
exact prod_eq_zero he (by norm_num)
omit [Fintype V] in
lemma siteMoment_separate (ends : I β V Γ V) (hardEnds : J β V Γ V)
(E : Finset I) (H : Finset J) (s : β) (v : I β β) (T : Set V) :
siteMoment ends hardEnds E H s v T =
inducedPartition ends E s v T *
(β B β (E.filter (fun e => (ends e).1 β T β§ (ends e).2 β T)).powerset,
β e β B, v e) *
(β L β (H.filter (fun e => (hardEnds e).1 β T β§ (hardEnds e).2 β T)).powerset,
(-1:β)^L.card) := by
unfold siteMoment inducedPartition
rw [sum_mul,sum_mul]
apply sum_congr rfl
intro A hA
rw [show (β e β A, v e) * s ^ Nat.card (induce T (graph β₯ ends A)).ConnectedComponent *
(β B β (E.filter (fun e => (ends e).1 β T β§ (ends e).2 β T)).powerset, β e β B, v e) =
β B β (E.filter (fun e => (ends e).1 β T β§ (ends e).2 β T)).powerset,
(β e β A, v e) * s ^ Nat.card (induce T (graph β₯ ends A)).ConnectedComponent * (β e β B, v e) from mul_sum _ _ _]
rw [sum_mul]
apply sum_congr rfl
intro B hB
rw [mul_sum]
apply sum_congr rfl
intro L hL
ring
omit [Fintype V] in
lemma siteMoment_squarefree (ends : I β V Γ V) (hardEnds : J β V Γ V)
(E : Finset I) (H : Finset J) (s : β) (v : I β β) (T : Set V) :
siteMoment ends hardEnds E H s v T =
if (H.filter (fun e => (hardEnds e).1 β T β§ (hardEnds e).2 β T)) = β
then
(β e β E.filter (fun e => (ends e).1 β T β§ (ends e).2 β T), (1 + v e)) *
inducedPartition ends E s v T else 0 := by
rw [siteMoment_separate,alternating_powerset,β prod_one_add]
split_ifs <;> ring
omit [Fintype V] in
lemma siteMoment_collision_zero (ends : I β V Γ V) (hardEnds : J β V Γ V)
(E : Finset I) (H : Finset J) (s : β) (v : I β β) (T : Set V)
{e : J} (he : e β H) (hβ : (hardEnds e).1 β T) (hβ : (hardEnds e).2 β T) :
siteMoment ends hardEnds E H s v T = 0 := by
rw [siteMoment_squarefree,ite_eq_right]
exact nonempty_iff_ne_empty.mp β¨e,mem_filter.mpr β¨he,hβ,hββ©β©
end BelowOne.FKPressure
end
end
section
noncomputable section
open Finset SimpleGraph
open scoped Classical
namespace BelowOne.FKPressure
variable {V W I J : Type*} [Fintype V] [Fintype W]
def imageEquiv (f : V β W) (T : Set V) (hf : Set.InjOn f T) : T β f '' T :=
Equiv.ofBijective (fun x => β¨f x, Set.mem_image_of_mem f x.propertyβ©) (by
constructor
Β· intro x y h
exact Subtype.ext (hf x.property y.property (congrArg Subtype.val h))
Β· rintro β¨y,x,hx,rflβ©
exact β¨β¨x,hxβ©,rflβ©)
omit [Fintype V] [Fintype W] in
lemma induced_graph_image_iso (f : V β W) (T : Set V) (hf : Set.InjOn f T)
(ends : I β V Γ V) (ends' : J β W Γ W) (g : I β J) (A : Finset I)
(hT : β e β A, (ends e).1 β T β§ (ends e).2 β T)
(he : β e β A, ends' (g e) = (f (ends e).1, f (ends e).2)) :
Nonempty ((graph β₯ ends A).induce T βg
(graph β₯ ends' (A.image g)).induce (f '' T)) := by
refine β¨{ toEquiv := imageEquiv f T hf, map_rel_iff' := ?_ }β©
intro x y
change (graph β₯ ends' (A.image g)).Adj (f x) (f y) β (graph β₯ ends A).Adj x y
simp only [graph_adj_iff,SimpleGraph.bot_adj,false_or]
constructor
Β· rintro β¨j,hj,hxyβ©
obtain β¨e,heA,rflβ© := mem_image.mp hj
rw [he e heA] at hxy
obtain β¨h,hneβ© := (edge_adj _ _ _ _).mp hxy
refine β¨e,heA,(edge_adj _ _ _ _).mpr β¨?_,?_β©β©
Β· rcases h with β¨hx,hyβ© | β¨hx,hyβ©
Β· exact Or.inl β¨hf x.property (hT e heA).1 hx,hf y.property (hT e heA).2 hyβ©
Β· exact Or.inr β¨hf x.property (hT e heA).2 hx,hf y.property (hT e heA).1 hyβ©
Β· intro h
exact hne (congrArg f h)
Β· rintro β¨e,heA,hxyβ©
refine β¨g e,mem_image_of_mem g heA,?_β©
rw [he e heA]
obtain β¨h,hneβ© := (edge_adj _ _ _ _).mp hxy
apply (edge_adj _ _ _ _).mpr
constructor
Β· rcases h with β¨hx,hyβ© | β¨hx,hyβ©
Β· exact Or.inl β¨congrArg f hx,congrArg f hyβ©
Β· exact Or.inr β¨congrArg f hx,congrArg f hyβ©
Β· exact fun h => hne (hf x.property y.property h)
omit [Fintype V] [Fintype W] in
lemma induced_component_image (f : V β W) (T : Set V) (hf : Set.InjOn f T)
(ends : I β V Γ V) (ends' : J β W Γ W) (g : I β J) (A : Finset I)
(hT : β e β A, (ends e).1 β T β§ (ends e).2 β T)
(he : β e β A, ends' (g e) = (f (ends e).1, f (ends e).2)) :
Nat.card ((graph β₯ ends A).induce T).ConnectedComponent =
Nat.card ((graph β₯ ends' (A.image g)).induce (f '' T)).ConnectedComponent := by
obtain β¨eβ© := induced_graph_image_iso f T hf ends ends' g A hT he
exact Nat.card_congr e.connectedComponentEquiv
omit [Fintype V] [Fintype W] in
lemma inducedPartition_reindex (f : V β W) (T : Set V) (hf : Set.InjOn f T)
(ends : I β V Γ V) (ends' : J β W Γ W) (g : I β J) (E : Finset I)
(s : β) (v : J β β)
(hT : β e β E, (ends e).1 β T β§ (ends e).2 β T)
(he : β e β E, ends' (g e) = (f (ends e).1, f (ends e).2))
(hg : Set.InjOn g E) :
inducedPartition ends E s (v β g) T =
inducedPartition ends' (E.image g) s v (f '' T) := by
have hfilter : E.filter (fun e => (ends e).1 β T β§ (ends e).2 β T) = E := by
exact filter_eq_self.mpr hT
have hfilter' : (E.image g).filter (fun e => (ends' e).1 β f '' T β§
(ends' e).2 β f '' T) = E.image g := by
apply filter_eq_self.mpr
intro j hj
obtain β¨e,heE,rflβ© := mem_image.mp hj
rw [he e heE]
exact β¨Set.mem_image_of_mem f (hT e heE).1,Set.mem_image_of_mem f (hT e heE).2β©
unfold inducedPartition
rw [hfilter,hfilter',powerset_image,sum_image]
Β· apply sum_congr rfl
intro A hA
have hAE := mem_powerset.mp hA
rw [induced_component_image f T hf ends ends' g A
(fun e heA => hT e (hAE heA)) (fun e heA => he e (hAE heA)),prod_image]
Β· rfl
Β· intro a ha b hb hab
exact hg (hAE ha) (hAE hb) hab
Β· intro A hA B hB hAB
exact (Finset.image_eq_image_iff_of_injOn hg
(mem_powerset.mp hA) (mem_powerset.mp hB)).mp hAB
end BelowOne.FKPressure
end
end
section
noncomputable section
open Finset SimpleGraph
open scoped Classical
namespace BelowOne.FKPressure
attribute [local instance] Classical.propDecidable
variable {V U I : Type*} [Fintype V] [Fintype U] [LinearOrder U]
def liftEdges (Ο : U β V) (ends : I β V Γ V) (E : Finset I) : Finset (I Γ U Γ U) :=
(E ΓΛ’ (univ ΓΛ’ univ)).filter (fun e => Ο e.2.1 = (ends e.1).1 β§ Ο e.2.2 = (ends e.1).2)
def hardEdges (Ο : U β V) : Finset (U Γ U) :=
univ.filter (fun e => e.1 < e.2 β§ Ο e.1 = Ο e.2)
def squarefreeMoment (ends : I β V Γ V) (E : Finset I)
(s : β) (v : I β β) (T : Set V) : β :=
(β e β E.filter (fun e => (ends e).1 β T β§ (ends e).2 β T), (1 + v e)) *
inducedPartition ends E s v T
omit [Fintype V] [LinearOrder U] in
lemma mem_liftEdges (Ο : U β V) (ends : I β V Γ V) (E : Finset I) (e : I Γ U Γ U) :
e β liftEdges Ο ends E β e.1 β E β§ Ο e.2.1 = (ends e.1).1 β§ Ο e.2.2 = (ends e.1).2 := by
simp [liftEdges]
omit [Fintype V] [LinearOrder U] in
lemma liftEdges_filter_image (Ο : U β V) (ends : I β V Γ V) (E : Finset I) (T : Set U) :
((liftEdges Ο ends E).filter (fun e => e.2.1 β T β§ e.2.2 β T)).image Prod.fst =
E.filter (fun e => (ends e).1 β Ο '' T β§ (ends e).2 β Ο '' T) := by
ext e
constructor
Β· intro h
obtain β¨β¨d,i,jβ©,hlift,heqβ© := mem_image.mp h
change d = e at heq
subst e
obtain β¨he,hijβ© := mem_filter.mp hlift
obtain β¨hd,hi,hjβ© := (mem_liftEdges _ _ _ _).mp he
exact mem_filter.mpr β¨hd,β¨i,hij.1,hiβ©,β¨j,hij.2,hjβ©β©
Β· intro h
obtain β¨he,β¨i,hi,heiβ©,β¨j,hj,hejβ©β© := mem_filter.mp h
exact mem_image.mpr β¨(e,i,j),mem_filter.mpr
β¨(mem_liftEdges _ _ _ _).mpr β¨he,hei,hejβ©,hi,hjβ©,rflβ©
omit [Fintype V] [LinearOrder U] in
lemma liftEdges_filter_inj (Ο : U β V) (ends : I β V Γ V) (E : Finset I)
(T : Set U) (hΟ : Set.InjOn Ο T) :
Set.InjOn Prod.fst (β((liftEdges Ο ends E).filter (fun e => e.2.1 β T β§ e.2.2 β T)) : Set (I Γ U Γ U)) := by
rintro β¨e,i,jβ© h β¨e',i',j'β© h' he
obtain β¨hm,hi,hjβ© := mem_filter.mp h
obtain β¨hm',hi',hj'β© := mem_filter.mp h'
obtain β¨_,hei,hejβ© := (mem_liftEdges _ _ _ _).mp hm
obtain β¨_,hei',hej'β© := (mem_liftEdges _ _ _ _).mp hm'
change e = e' at he
subst e'
have hii := hΟ hi hi' (hei.trans hei'.symm)
have hjj := hΟ hj hj' (hej.trans hej'.symm)
exact Prod.ext rfl (Prod.ext hii hjj)
omit [Fintype V] in
lemma hardEdges_filter_empty_iff (Ο : U β V) (T : Set U) :
(hardEdges Ο).filter (fun e => e.1 β T β§ e.2 β T) = β
β Set.InjOn Ο T := by
rw [Finset.eq_empty_iff_forall_notMem]
simp only [mem_filter,hardEdges,mem_univ,true_and]
constructor
Β· intro h a ha b hb hab
by_contra hne
rcases lt_or_gt_of_ne hne with hab' | hba'
Β· exact h (a,b) β¨β¨hab',habβ©,ha,hbβ©
Β· exact h (b,a) β¨β¨hba',hab.symmβ©,hb,haβ©
Β· intro h e he
exact (ne_of_lt he.1.1) (h he.2.1 he.2.2 he.1.2)
omit [Fintype V] in
lemma inducedPartition_filter (ends : I β V Γ V) (E : Finset I)
(s : β) (v : I β β) (T : Set V) :
inducedPartition ends (E.filter (fun e => (ends e).1 β T β§ (ends e).2 β T)) s v T =
inducedPartition ends E s v T := by
unfold inducedPartition
rw [filter_filter]
simp only [and_self]
omit [Fintype V] in
lemma siteMoment_lift (Ο : U β V) (ends : I β V Γ V) (E : Finset I)
(s : β) (v : I β β) (T : Set U) :
siteMoment Prod.snd id (liftEdges Ο ends E) (hardEdges Ο) s (v β Prod.fst) T =
if Set.InjOn Ο T then squarefreeMoment ends E s v (Ο '' T) else 0 := by
rw [siteMoment_squarefree]
simp only [id_eq]
simp only [hardEdges_filter_empty_iff]
split_ifs with hΟ
Β· let F := (liftEdges Ο ends E).filter (fun e => e.2.1 β T β§ e.2.2 β T)
have hF : β e β F, e.2.1 β T β§ e.2.2 β T := fun e he => (mem_filter.mp he).2
have he : β e β F, ends (Prod.fst e) = (Ο e.2.1,Ο e.2.2) := by
intro e he
have h := (mem_liftEdges _ _ _ _).mp (mem_filter.mp he).1
exact Prod.ext h.2.1.symm h.2.2.symm
have hpart := inducedPartition_reindex Ο T hΟ Prod.snd ends Prod.fst F s v hF he
(liftEdges_filter_inj Ο ends E T hΟ)
rw [inducedPartition_filter] at hpart
rw [liftEdges_filter_image] at hpart
rw [inducedPartition_filter] at hpart
unfold squarefreeMoment
rw [hpart]
congr 1
rw [β liftEdges_filter_image Ο ends E T,prod_image]
Β· rfl
Β· exact liftEdges_filter_inj Ο ends E T hΟ
Β· rfl
end BelowOne.FKPressure
end
end
section
noncomputable section
open Finset SimpleGraph
open scoped Classical
namespace BelowOne.FKPressure
variable {V I : Type*} [Fintype V]
def unscaledSitePolynomial (ends : I β V Γ V) (E : Finset I)
(s : β) (v : I β β) : (V β β) β β :=
MultiaffineDerivative.polynomial (fun T => squarefreeMoment ends E s v (T : Set V))
lemma unscaledSitePolynomial_zero (ends : I β V Γ V) (E : Finset I)
(s : β) (v : I β β) : unscaledSitePolynomial ends E s v 0 = 1 := by
rw [unscaledSitePolynomial,MultiaffineDerivative.polynomial_zero]
simp [squarefreeMoment,inducedPartition,Nat.card_eq_fintype_card]
lemma injOn_range_iff {X Y Z : Type*} (f : Y β Z) (e : X βͺ Y) :
Set.InjOn f (Set.range e) β Function.Injective (f β e) := by
constructor
Β· intro h x y hxy
exact e.injective (h β¨x,rflβ© β¨y,rflβ© hxy)
Β· intro h x hx y hy hxy
obtain β¨a,rflβ© := hx
obtain β¨b,rflβ© := hy
exact congrArg e (h hxy)
lemma lifted_derivative {n k : β} (Ο : Fin n β V) (e : Fin k βͺ Fin n)
(ends : I β V Γ V) (E : Finset I) (s : β) (v : I β β) :
iteratedFDeriv β k (unscaledSitePolynomial ends E s v) 0
(MultiaffineDerivative.coordinate β (Ο β e)) =
siteMoment Prod.snd id (liftEdges Ο ends E) (hardEdges Ο) s
(v β Prod.fst) (Set.range e) := by
rw [unscaledSitePolynomial,MultiaffineDerivative.polynomial_derivative,
siteMoment_lift,injOn_range_iff]
simp only [Finset.coe_image,Finset.coe_univ,Set.image_univ,Set.range_comp]
split_ifs <;> rfl
lemma blockDerivative_lift {n : β} (Ο : Fin n β V)
(ends : I β V Γ V) (E : Finset I) (s : β) (v : I β β) (r : Setoid (Fin n)) :
PartitionCumulant.blockDerivative (unscaledSitePolynomial ends E s v) 0
(MultiaffineDerivative.coordinate β Ο) r =
PartitionCumulant.blockDerivative
(sitePolynomial Prod.snd id (liftEdges Ο ends E) (hardEdges Ο) s (v β Prod.fst)) 0
MultiaffineDerivative.coordinate r := by
unfold PartitionCumulant.blockDerivative
apply prod_congr rfl
intro i hi
let c := OrderedPartitionBridge.ofSetoid r
let e : Fin (c.partSize i) βͺ Fin n := β¨c.emb i,(c.emb_strictMono i).injectiveβ©
change iteratedFDeriv β _ (unscaledSitePolynomial ends E s v) 0
(MultiaffineDerivative.coordinate β (Ο β e)) = _
rw [lifted_derivative]
rw [sitePolynomial,MultiaffineDerivative.polynomial_derivative,
ite_eq_left (c.emb_strictMono i).injective]
simp only [Finset.coe_image,Finset.coe_univ,Set.image_univ]
rfl
theorem unscaledSitePolynomial_log_derivative {n : β} (hn : 0 < n)
(Ο : Fin n β V) (ends : I β V Γ V) (E : Finset I) (s : β) (v : I β β) :
iteratedFDeriv β n (Real.log β unscaledSitePolynomial ends E s v) 0
(MultiaffineDerivative.coordinate β Ο) =
connectedSum β₯ Prod.snd id (liftEdges Ο ends E) (hardEdges Ο) s (v β Prod.fst) := by
rw [β sitePolynomial_log_derivative hn]
have hf : ContDiffAt β n (unscaledSitePolynomial ends E s v) 0 :=
(MultiaffineDerivative.contDiff_polynomial _ n).contDiffAt
have hg : ContDiffAt β n (sitePolynomial Prod.snd id (liftEdges Ο ends E)
(hardEdges Ο) s (v β Prod.fst)) 0 :=
(MultiaffineDerivative.contDiff_polynomial _ n).contDiffAt
rw [PartitionCumulant.logarithmic_derivative_partition_sum hf
(unscaledSitePolynomial_zero ends E s v) hn,
PartitionCumulant.logarithmic_derivative_partition_sum hg
(sitePolynomial_zero _ _ _ _ _ _) hn]
simp_rw [blockDerivative_lift]
theorem unscaledSitePolynomial_log_derivative_nonpos {n : β} (hn : 0 < n)
(Ο : Fin n β V) (ends : I β V Γ V) (E : Finset I)
{u : β} (hu : 0 < u) (hu1 : u < 1) (v : I β β) (hv : β e β E, 0 β€ v e) :
iteratedFDeriv β n (Real.log β unscaledSitePolynomial ends E (-u) v) 0
(MultiaffineDerivative.coordinate β Ο) β€ 0 := by
have : NeZero n := β¨Nat.ne_zero_of_lt hnβ©
rw [unscaledSitePolynomial_log_derivative hn]
apply connectedSum_nonpos β₯ Prod.snd id _ _ hu hu1
intro e he
exact hv e.1 ((mem_liftEdges _ _ _ _).mp he).1
end BelowOne.FKPressure
end
end
section
noncomputable section
open Finset
namespace BelowOne.ComponentProduct
attribute [local instance] Classical.propDecidable
variable {V Q : Type*} [Fintype V] [Fintype Q]
def saturated (f : V β Q) (T : Finset V) : Prop :=
β a b, f a = f b β (a β T β b β T)
def preimage (f : V β Q) (J : Finset Q) : Finset V := univ.filter (fun v => f v β J)
omit [Fintype Q] in
lemma mem_preimage (f : V β Q) (J : Finset Q) (v : V) :
v β preimage f J β f v β J := by simp [preimage]
omit [Fintype Q] in
lemma preimage_saturated (f : V β Q) (J : Finset Q) : saturated f (preimage f J) := by
intro a b hab
simp only [mem_preimage,hab]
omit [Fintype Q] in
lemma image_preimage (f : V β Q) (hf : Function.Surjective f) (J : Finset Q) :
(preimage f J).image f = J := by
ext q
simp only [mem_image,mem_preimage]
constructor
Β· rintro β¨v,hv,rflβ©
exact hv
Β· intro hq
obtain β¨v,rflβ© := hf q
exact β¨v,hq,rflβ©
omit [Fintype Q] in
lemma preimage_image (f : V β Q) (T : Finset V) (hT : saturated f T) :
preimage f (T.image f) = T := by
ext v
simp only [mem_preimage,mem_image]
constructor
Β· rintro β¨w,hw,hwvβ©
exact (hT w v hwv).mp hw
Β· intro hv
exact β¨v,hv,rflβ©
omit [Fintype Q] in
lemma selected_product (f : V β Q) (J : Finset Q) (s : β) (x : V β β) :
(β q β J, s * β v β univ.filter (fun v => f v = q), x v) =
s ^ J.card * β v β preimage f J, x v := by
rw [prod_mul_distrib,prod_const]
congr 1
exact Finset.prod_fiberwise_eq_prod_filter univ J f x
lemma expansion (f : V β Q) (hf : Function.Surjective f) (s : β) (x : V β β) :
(β q : Q, (1 + s * β v β univ.filter (fun v => f v = q), x v)) =
β T : Finset V, if saturated f T then
s ^ (T.image f).card * β v β T, x v else 0 := by
rw [prod_one_add]
symm
rw [β sum_filter]
symm
apply sum_bij (fun J hJ => preimage f J)
Β· intro J hJ
exact mem_filter.mpr β¨mem_univ _,preimage_saturated f Jβ©
Β· intro J hJ K hK hJK
have h := congrArg (Finset.image f) hJK
simpa only [image_preimage f hf] using h
Β· intro T hT
refine β¨T.image f,mem_powerset.mpr (subset_univ _),?_β©
exact preimage_image f T (mem_filter.mp hT).2
Β· intro J hJ
rw [selected_product,image_preimage f hf]
end BelowOne.ComponentProduct
end
end
section
noncomputable section
open Finset SimpleGraph
namespace BelowOne.FKPressure
attribute [local instance] Classical.propDecidable
variable {V I : Type*} [Fintype V]
omit [Fintype V] in
lemma reachable_induce_saturated (G : SimpleGraph V) (T : Finset V)
(hT : ComponentProduct.saturated G.connectedComponentMk T) (x y : (T : Set V)) :
(G.induce T).Reachable x y β G.Reachable x.1 y.1 := by
constructor
Β· exact fun h => h.map (SimpleGraph.Embedding.induce _).toHom
Β· rintro β¨pβ©
have hp : β z β p.support, z β (T : Set V) := by
intro z hz
have he : G.connectedComponentMk x = G.connectedComponentMk z :=
ConnectedComponent.sound β¨p.takeUntil z hzβ©
exact (hT x z he).mp x.property
exact β¨p.induce (T : Set V) hpβ©
omit [Fintype V] in
lemma component_card_induce_saturated (G : SimpleGraph V) (T : Finset V)
(hT : ComponentProduct.saturated G.connectedComponentMk T) :
Nat.card (G.induce T).ConnectedComponent = (T.image G.connectedComponentMk).card := by
let f : β₯(T : Set V) β G.ConnectedComponent := fun x => G.connectedComponentMk x
have hr : (G.induce T).reachableSetoid = Setoid.ker f := by
apply Setoid.ext
intro x y
change (G.induce T).Reachable x y β G.connectedComponentMk x = G.connectedComponentMk y
rw [reachable_induce_saturated G T hT]
exact β¨ConnectedComponent.sound,ConnectedComponent.exactβ©
have him : Set.range f = (β(T.image G.connectedComponentMk) : Set G.ConnectedComponent) := by
ext q
simp only [Set.mem_range,Finset.mem_coe,mem_image,f]
constructor
Β· rintro β¨x,rflβ©
exact β¨x,x.property,rflβ©
Β· rintro β¨x,hx,rflβ©
exact β¨β¨x,hxβ©,rflβ©
change Nat.card (Quotient (G.induce T).reachableSetoid) = _
rw [hr,Nat.card_congr (Setoid.quotientKerEquivRange f),him,Nat.card_eq_fintype_card]
exact Fintype.card_coe _
omit [Fintype V] in
lemma saturated_graph_iff (ends : I β V Γ V) (A : Finset I) (T : Finset V) :
ComponentProduct.saturated (graph β₯ ends A).connectedComponentMk T β
β e β A, ((ends e).1 β T β (ends e).2 β T) := by
constructor
Β· intro h e he
exact h _ _ (ConnectedComponent.sound (endpoints_reachable β₯ ends he))
Β· intro h a b hab
have hr : (graph β₯ ends A).Reachable a b := ConnectedComponent.exact hab
obtain β¨pβ© := hr
clear hab
induction p with
| nil => rfl
| @cons a b c hab p ih =>
have heq : a β T β b β T := by
obtain hfalse | β¨e,he,hxyβ© := (graph_adj_iff β₯ ends A a b).mp hab
Β· exact False.elim hfalse
obtain β¨hxy,_β© := (edge_adj _ _ _ _).mp hxy
rcases hxy with β¨rfl,rflβ© | β¨rfl,rflβ©
Β· exact h e he
Β· exact (h e he).symm
exact heq.trans ih
def componentProduct (G : SimpleGraph V) (s : β) (x : V β β) : β :=
β c : G.ConnectedComponent, (1 + s *
β v β univ.filter (fun v => G.connectedComponentMk v = c), x v)
lemma componentProduct_expansion (ends : I β V Γ V) (A : Finset I)
(s : β) (x : V β β) :
componentProduct (graph β₯ ends A) s x =
β T : Finset V, if β e β A, ((ends e).1 β T β (ends e).2 β T) then
s ^ Nat.card ((graph β₯ ends A).induce T).ConnectedComponent * β v β T, x v else 0 := by
rw [componentProduct,ComponentProduct.expansion
(graph β₯ ends A).connectedComponentMk (fun q => Quot.mk_surjective q)]
apply sum_congr rfl
intro T hT
by_cases h : ComponentProduct.saturated (graph β₯ ends A).connectedComponentMk T
Β· rw [ite_eq_left h,ite_eq_left ((saturated_graph_iff ends A T).mp h),component_card_induce_saturated _ T h]
Β· rw [ite_eq_right h,ite_eq_right (fun hh => h ((saturated_graph_iff ends A T).mpr hh))]
end BelowOne.FKPressure
end
end
section
noncomputable section
open Finset
namespace BelowOne.SubsetSplitting
attribute [local instance] Classical.propDecidable
variable {I : Type*}
lemma sum_factorization_binary (E : Finset I) (p : I β Prop) (W Wβ Wβ : Finset I β β)
(hW : β A β E, W A = Wβ (A.filter p) * Wβ (A.filter (fun e => Β¬p e))) :
(β A β E.powerset, W A) =
(β A β (E.filter p).powerset, Wβ A) *
(β A β (E.filter (fun e => Β¬p e)).powerset, Wβ A) := by
have h := sum_factorization E (fun e => decide (p e)) W
(fun b A => if b then Wβ A else Wβ A) (by
intro A hA
rw [Fintype.prod_bool]
simpa only [Bool.false_eq_true,ite_false,ite_true,decide_eq_false_iff_not,
decide_eq_true_eq] using hW A hA)
simpa only [Fintype.prod_bool,fiber,Bool.false_eq_true,ite_false,ite_true,
decide_eq_false_iff_not,decide_eq_true_eq,mul_comm] using h
end BelowOne.SubsetSplitting
end
end
section
noncomputable section
open Finset SimpleGraph
namespace BelowOne.FKPressure
attribute [local instance] Classical.propDecidable
variable {V I : Type*} [Fintype V]
omit [Fintype V] in
lemma graph_induce_inside_filter (G : SimpleGraph V) (ends : I β V Γ V)
(A : Finset I) (T : Set V) :
(graph G ends (A.filter (fun e => (ends e).1 β T β§ (ends e).2 β T))).induce T =
(graph G ends A).induce T := by
ext x y
simp only [SimpleGraph.induce_adj,graph_adj_iff,mem_filter]
constructor
Β· rintro (h | β¨e,β¨he,_β©,hxyβ©)
Β· exact Or.inl h
Β· exact Or.inr β¨e,he,hxyβ©
Β· rintro (h | β¨e,he,hxyβ©)
Β· exact Or.inl h
Β· refine Or.inr β¨e,β¨he,?_β©,hxyβ©
rcases (edge_adj _ _ _ _).mp hxy with β¨β¨hx,hyβ© | β¨hx,hyβ©,_β©
Β· exact β¨hx βΈ x.property,hy βΈ y.propertyβ©
Β· exact β¨hy βΈ y.property,hx βΈ x.propertyβ©
omit [Fintype V] in
lemma confined_edge_sum (ends : I β V Γ V) (E : Finset I) (T : Set V)
(s : β) (v : I β β) :
(β A β E.powerset, if β e β A, ((ends e).1 β T β (ends e).2 β T) then
(β e β A, v e) * s ^ Nat.card ((graph β₯ ends A).induce T).ConnectedComponent else 0) =
inducedPartition ends E s v T *
β e β E.filter (fun e => (ends e).1 β T β§ (ends e).2 β T), (1 + v e) := by
trans β A β (E.filter (fun e => (ends e).1 β T β (ends e).2 β T)).powerset,
(β e β A, v e) * s ^ Nat.card ((graph β₯ ends A).induce T).ConnectedComponent
Β· have hh := sum_powerset_filter E (fun e => (ends e).1 β T β (ends e).2 β T)
(fun A => (β e β A, v e) * s ^ Nat.card ((graph β₯ ends A).induce T).ConnectedComponent)
simpa only [MultiaffineDerivative.ite_classical,filter_classical] using hh
let F := E.filter (fun e => (ends e).1 β T β (ends e).2 β T)
have h := SubsetSplitting.sum_factorization_binary F
(fun e => (ends e).1 β T β§ (ends e).2 β T)
(fun A => (β e β A, v e) * s ^ Nat.card ((graph β₯ ends A).induce T).ConnectedComponent)
(fun A => (β e β A, v e) * s ^ Nat.card ((graph β₯ ends A).induce T).ConnectedComponent)
(fun A => β e β A, v e) (by
intro A hA
simp only [filter_classical]
have hg := graph_induce_inside_filter (β₯ : SimpleGraph V) ends A T
simp only [filter_classical] at hg
rw [hg]
rw [β Finset.prod_filter_mul_prod_filter_not A
(fun e => (ends e).1 β T β§ (ends e).2 β T) v]
simp only [filter_classical]
ring)
have hi : F.filter (fun e => (ends e).1 β T β§ (ends e).2 β T) =
E.filter (fun e => (ends e).1 β T β§ (ends e).2 β T) := by
ext e
simp only [F,mem_filter]
tauto
have ho : F.filter (fun e => Β¬((ends e).1 β T β§ (ends e).2 β T)) =
E.filter (fun e => (ends e).1 β T β§ (ends e).2 β T) := by
ext e
simp only [F,mem_filter]
tauto
simp only [filter_classical] at h hi ho β’
rw [hi,ho,β prod_one_add] at h
simpa only [F,inducedPartition,filter_classical] using h
def percolationSitePolynomial (ends : I β V Γ V) (E : Finset I)
(s : β) (v : I β β) (x : V β β) : β :=
(β A β E.powerset, (β e β A, v e) * componentProduct (graph β₯ ends A) s x) /
β e β E, (1 + v e)
def percolationCoefficient (ends : I β V Γ V) (E : Finset I)
(s : β) (v : I β β) (T : Finset V) : β :=
(inducedPartition ends E s v T *
β e β E.filter (fun e => (ends e).1 β T β§ (ends e).2 β T), (1 + v e)) /
β e β E, (1 + v e)
lemma percolationSitePolynomial_eq (ends : I β V Γ V) (E : Finset I)
(s : β) (v : I β β) :
percolationSitePolynomial ends E s v =
MultiaffineDerivative.polynomial (percolationCoefficient ends E s v) := by
funext x
unfold percolationSitePolynomial
simp_rw [componentProduct_expansion,mul_sum]
rw [sum_comm]
unfold MultiaffineDerivative.polynomial percolationCoefficient
rw [sum_div]
apply sum_congr rfl
intro T hT
rw [div_mul_eq_mul_div]
congr 1
have hh := confined_edge_sum ends E (T : Set V) s v
simp only [Finset.mem_coe,filter_classical] at hh β’
rw [β hh,sum_mul]
apply sum_congr rfl
intro A hA
split_ifs <;> ring
end BelowOne.FKPressure
end
end
section
noncomputable section
open Finset
namespace BelowOne.FKPressure
attribute [local instance] Classical.propDecidable
variable {V I : Type*} [Fintype V]
def incidentProduct (ends : I β V Γ V) (E : Finset I) (v : I β β) (i : V) : β :=
β e β E, (if (ends e).1 = i then 1 + v e else 1) *
(if (ends e).2 = i then 1 + v e else 1)
def incidentScale (ends : I β V Γ V) (E : Finset I) (v : I β β) (i : V) : β :=
(incidentProduct ends E v i)β»ΒΉ
omit [Fintype V] in
lemma incidentProduct_pos (ends : I β V Γ V) (E : Finset I) (v : I β β)
(hv : β e β E, 0 β€ v e) (i : V) : 0 < incidentProduct ends E v i := by
unfold incidentProduct
apply prod_pos
intro e he
apply mul_pos <;> split_ifs <;> linarith [hv e he]
omit [Fintype V] in
lemma incidentProduct_subprod (ends : I β V Γ V) (E : Finset I)
(v : I β β) (T : Finset V) :
(β i β T, incidentProduct ends E v i) =
β e β E, (if (ends e).1 β T then 1 + v e else 1) *
(if (ends e).2 β T then 1 + v e else 1) := by
unfold incidentProduct
rw [prod_comm]
apply prod_congr rfl
intro e he
rw [prod_mul_distrib]
simp only [prod_ite_eq]
omit [Fintype V] in
lemma incident_product_identity (ends : I β V Γ V) (E : Finset I)
(v : I β β) (T : Finset V) :
(β e β E, (1 + v e)) *
(β e β E.filter (fun e => (ends e).1 β T β§ (ends e).2 β T), (1 + v e)) =
(β i β T, incidentProduct ends E v i) *
(β e β E.filter (fun e => (ends e).1 β T β§ (ends e).2 β T), (1 + v e)) := by
rw [incidentProduct_subprod]
simp only [prod_filter]
rw [β prod_mul_distrib,β prod_mul_distrib]
apply prod_congr rfl
intro e he
split_ifs <;> simp_all
omit [Fintype V] in
lemma percolationCoefficient_rescale (ends : I β V Γ V) (E : Finset I)
(s : β) (v : I β β) (hv : β e β E, 0 β€ v e) (T : Finset V) :
percolationCoefficient ends E s v T =
(β i β T, incidentScale ends E v i) * squarefreeMoment ends E s v T := by
have hP : (β e β E, (1 + v e)) β 0 := ne_of_gt (prod_pos (fun e he => by linarith [hv e he]))
have hD : (β i β T, incidentProduct ends E v i) β 0 :=
ne_of_gt (prod_pos (fun i hi => incidentProduct_pos ends E v hv i))
have hid := incident_product_identity ends E v T
unfold percolationCoefficient squarefreeMoment incidentScale
rw [prod_inv_distrib]
simp only [Finset.mem_coe,filter_classical] at hid β’
field_simp
nlinarith [congrArg (fun r : β => r * inducedPartition ends E s v T) hid]
lemma percolationSitePolynomial_rescale (ends : I β V Γ V) (E : Finset I)
(s : β) (v : I β β) (hv : β e β E, 0 β€ v e) (x : V β β) :
percolationSitePolynomial ends E s v x =
unscaledSitePolynomial ends E s v (fun i => incidentScale ends E v i * x i) := by
rw [percolationSitePolynomial_eq]
unfold unscaledSitePolynomial MultiaffineDerivative.polynomial
apply sum_congr rfl
intro T hT
rw [percolationCoefficient_rescale ends E s v hv T,prod_mul_distrib]
ring
end BelowOne.FKPressure
end
end
section
noncomputable section
open Finset
open scoped Classical
namespace BelowOne.MultiaffineDerivative
variable {V : Type*} [Fintype V]
def diagonalEquiv (c : V β β) (hc : β i, c i β 0) : (V β β) βL[β] (V β β) where
toFun x i := c i * x i
invFun x i := (c i)β»ΒΉ * x i
left_inv x := by ext i; simp [hc i]
right_inv x := by ext i; simp [hc i]
map_add' x y := by ext i; exact mul_add _ _ _
map_smul' a x := by ext i; simp only [Pi.smul_apply,smul_eq_mul,RingHom.id_apply]; ring
continuous_toFun := by fun_prop
continuous_invFun := by fun_prop
omit [Fintype V] in
lemma diagonalEquiv_coordinate (c : V β β) (hc : β i, c i β 0) (i : V) :
diagonalEquiv c hc (coordinate i) = c i β’ coordinate i := by
ext j
by_cases h : i = j
Β· subst j; simp [diagonalEquiv,coordinate]
Β· simp [diagonalEquiv,coordinate,h]
lemma iteratedFDeriv_diagonal (f : (V β β) β β) (c : V β β)
(hc : β i, c i β 0) (n : β) (Ο : Fin n β V) :
iteratedFDeriv β n (fun x => f (fun i => c i * x i)) 0 (coordinate β Ο) =
(β j, c (Ο j)) * iteratedFDeriv β n f 0 (coordinate β Ο) := by
have h := (diagonalEquiv c hc).iteratedFDerivWithin_comp_right f
(s := Set.univ) uniqueDiffOn_univ (x := 0) (Set.mem_univ _) n
simp only [Set.preimage_univ,iteratedFDerivWithin_univ,map_zero] at h
change iteratedFDeriv β n (f β diagonalEquiv c hc) 0 (coordinate β Ο) = _
rw [h,ContinuousMultilinearMap.compContinuousLinearMap_apply]
change iteratedFDeriv β n f 0 (fun j => diagonalEquiv c hc (coordinate (Ο j))) = _
simp_rw [diagonalEquiv_coordinate]
rw [ContinuousMultilinearMap.map_smul_univ]
rfl
end BelowOne.MultiaffineDerivative
end
end
section
noncomputable section
open Finset SimpleGraph
open scoped Classical
namespace BelowOne.FKPressure
variable {V I : Type*} [Fintype V]
lemma percolationSitePolynomial_zero (ends : I β V Γ V) (E : Finset I)
(s : β) (v : I β β) (hv : β e β E, 0 β€ v e) :
percolationSitePolynomial ends E s v 0 = 1 := by
rw [percolationSitePolynomial_rescale ends E s v hv]
simp only [Pi.zero_apply,mul_zero]
exact unscaledSitePolynomial_zero ends E s v
lemma percolationSitePolynomial_log_derivative_nonpos {n : β} (hn : 0 < n)
(Ο : Fin n β V) (ends : I β V Γ V) (E : Finset I)
{u : β} (hu : 0 < u) (hu1 : u < 1) (v : I β β) (hv : β e β E, 0 β€ v e) :
iteratedFDeriv β n (Real.log β percolationSitePolynomial ends E (-u) v) 0
(MultiaffineDerivative.coordinate β Ο) β€ 0 := by
have heq : Real.log β percolationSitePolynomial ends E (-u) v =
fun x => (Real.log β unscaledSitePolynomial ends E (-u) v)
(fun i => incidentScale ends E v i * x i) := by
funext x
simp only [Function.comp_apply,percolationSitePolynomial_rescale ends E (-u) v hv]
rw [heq,MultiaffineDerivative.iteratedFDeriv_diagonal]
Β· apply mul_nonpos_of_nonneg_of_nonpos
Β· exact prod_nonneg (fun i _ => (inv_pos.mpr (incidentProduct_pos ends E v hv (Ο i))).le)
Β· exact unscaledSitePolynomial_log_derivative_nonpos hn Ο ends E hu hu1 v hv
Β· intro i
exact ne_of_gt (inv_pos.mpr (incidentProduct_pos ends E v hv i))
lemma componentProduct_pos (G : SimpleGraph V) {u : β} (hu : 0 β€ u)
(hu1 : u < 1) (x : V β β) (hx : β i, x i β Set.Icc 0 1) :
0 < componentProduct G (-u) x := by
unfold componentProduct
apply prod_pos
intro c hc
have hb : (β i β univ.filter (fun i => G.connectedComponentMk i = c), x i) β€ 1 :=
prod_le_oneβ (fun i _ => (hx i).1) (fun i _ => (hx i).2)
nlinarith
lemma percolationSitePolynomial_pos (ends : I β V Γ V) (E : Finset I)
{u : β} (hu : 0 β€ u) (hu1 : u < 1) (v : I β β) (hv : β e β E, 0 β€ v e)
(x : V β β) (hx : β i, x i β Set.Icc 0 1) :
0 < percolationSitePolynomial ends E (-u) v x := by
unfold percolationSitePolynomial
apply div_pos
Β· apply sum_pos'
Β· intro A hA
exact mul_nonneg (prod_nonneg (fun e he => hv e ((mem_powerset.mp hA) he)))
(componentProduct_pos _ hu hu1 x hx).le
Β· refine β¨β
,mem_powerset.mpr (empty_subset E),?_β©
simpa only [prod_empty,one_mul] using componentProduct_pos (graph β₯ ends β
) hu hu1 x hx
Β· exact prod_pos (fun e he => by linarith [hv e he])
end BelowOne.FKPressure
end
end
section
noncomputable section
open Finset
open scoped Classical
namespace BelowOne.PositiveMultilinear
open MultiaffineDerivative
variable {V : Type*} [Fintype V] {n : β}
lemma sum_coordinates (x : V β β) : β i, x i β’ coordinate i = x := by
ext j
simp [coordinate,Pi.single_apply]
lemma expansion (F : ContinuousMultilinearMap β (fun _ : Fin n => V β β) β)
(x : Fin n β V β β) :
F x = β Ο : Fin n β V, (β j, x j (Ο j)) * F (coordinate β Ο) := by
conv_lhs => rw [show x = fun j => β i, x j i β’ coordinate i by simp only [sum_coordinates]]
rw [F.map_sum]
apply sum_congr rfl
intro Ο hΟ
rw [F.map_smul_univ]
rfl
lemma nonneg (F : ContinuousMultilinearMap β (fun _ : Fin n => V β β) β)
(hF : β Ο : Fin n β V, 0 β€ F (coordinate β Ο)) (x : Fin n β V β β)
(hx : β j i, 0 β€ x j i) : 0 β€ F x := by
rw [expansion]
exact sum_nonneg (fun Ο _ => mul_nonneg (prod_nonneg (fun j _ => hx j (Ο j))) (hF Ο))
lemma ones_eq_sum (F : ContinuousMultilinearMap β (fun _ : Fin n => V β β) β) :
F (fun _ _ => 1) = β Ο : Fin n β V, F (coordinate β Ο) := by
rw [expansion]
simp only [prod_const_one,one_mul]
lemma norm_le_ones (F : ContinuousMultilinearMap β (fun _ : Fin n => V β β) β)
(hF : β Ο : Fin n β V, 0 β€ F (coordinate β Ο)) : βFβ β€ F (fun _ _ => 1) := by
apply F.opNorm_le_bound (nonneg F hF _ (fun _ _ => zero_le_one))
intro x
rw [expansion,ones_eq_sum,sum_mul]
refine (norm_sum_le _ _).trans (sum_le_sum ?_)
intro Ο hΟ
rw [norm_mul,Real.norm_of_nonneg (hF Ο),mul_comm]
apply mul_le_mul_of_nonneg_left _ (hF Ο)
rw [norm_prod]
apply prod_le_prodβ (fun j _ => norm_nonneg _) (fun j _ => ?_)
exact norm_le_pi_norm (x j) (Ο j)
end BelowOne.PositiveMultilinear
end
end
section
noncomputable section
open scoped Topology NNReal ENNReal
open Filter Set FormalMultilinearSeries
namespace BelowOne.PositiveSeries
lemma scalar_apply_nonneg (c : β β β) (hc : β n, 0 β€ c n)
(n : β) (v : Fin n β β) (hv : β i, 0 β€ v i) :
0 β€ ofScalars β c n v := by
simp only [ofScalars, _root_.smul_apply,
ContinuousMultilinearMap.mkPiAlgebraFin_apply, smul_eq_mul, List.prod_ofFn]
exact mul_nonneg (hc n) (Finset.prod_nonneg (fun i _ => hv i))
lemma summable_add_of_shift (c : β β β) (hc : β n, 0 β€ c n)
{x y : β} (hx : 0 β€ x) (hy : 0 β€ y)
(hxr : (βxββ : ββ₯0β) < (ofScalars β c).radius)
(hshift : Summable fun k => (ofScalars β c).changeOrigin x k (fun _ => y)) :
Summable fun n => ofScalars β c n (fun _ => x+y) := by
let p := ofScalars β c
let f : (Ξ£ k l : β, {s : Finset (Fin (k+l)) // s.card = l}) β β :=
fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) (fun _ => y)
have fnonneg : β s, 0 β€ f s := by
intro s
dsimp [f]
rw [changeOriginSeriesTerm_apply]
apply scalar_apply_nonneg c hc
intro i
dsimp only [Finset.piecewise]
split_ifs <;> assumption
have hinner (k : β) : HasSum (fun s => f β¨k,sβ©) (p.changeOrigin x k (fun _ => y)) := by
apply ContinuousMultilinearMap.hasSum_eval
have ht := (p.hasFPowerSeriesOnBall_changeOrigin k hxr.pos).hasSum
(mem_eball_zero_iff.mpr hxr)
rw [zero_add] at ht
refine HasSum.sigma_of_hasSum ht (fun l => ?_) ?_
Β· simp only [changeOriginSeries, sum_apply]
exact hasSum_fintype _
Β· refine .of_nnnorm_bounded (p.changeOriginSeries_summable_auxβ hxr k) ?_
intro s
refine (ContinuousMultilinearMap.le_opNNNorm _ _).trans_eq ?_
simp
have hsf : Summable f := (summable_sigma_of_nonneg fnonneg).mpr
β¨fun k => (hinner k).summable, by simpa only [(hinner _).tsum_eq] using hshiftβ©
have hs := (changeOriginIndexEquiv.symm.summable_iff.mpr hsf).sigma
apply hs.congr
intro n
change (β' s : Finset (Fin n), f (changeOriginIndexEquiv.symm β¨n,sβ©)) =
p n (fun _ => x+y)
rw [tsum_fintype, β Pi.add_def, (p n).map_add_univ (fun _ => x) (fun _ => y)]
simp_rw [β changeOriginSeriesTerm_changeOriginIndexEquiv_symm]
rfl
lemma radius_add_le (c : β β β) (hc : β n, 0 β€ c n)
(x y : ββ₯0) (hx : (x : ββ₯0β) < (ofScalars β c).radius)
(hy : (y : ββ₯0β) < ((ofScalars β c).changeOrigin (x : β)).radius) :
((x+y : ββ₯0) : ββ₯0β) β€ (ofScalars β c).radius := by
have hs := summable_add_of_shift c hc x.coe_nonneg y.coe_nonneg
(by simpa using hx) (((ofScalars β c).changeOrigin (x : β)).summable
(by simpa only [mem_eball_zero_iff, enorm_eq_nnnorm, NNReal.nnnorm_eq] using hy))
apply (ofScalars β c).le_radius_of_summable (r := x+y)
simpa only [ofScalars_norm, Real.norm_eq_abs, abs_of_nonneg (hc _),
NNReal.coe_add, ofScalars_apply_eq, smul_eq_mul] using hs
theorem not_analytic_at_radius (c : β β β) (hc : β n, 0 β€ c n)
(R : ββ₯0) (hR : 0 < R) (hr : (ofScalars β c).radius = R)
(f : β β β) (heq : EqOn f (ofScalars β c).sum (Ioo 0 (R : β))) :
Β¬ AnalyticAt β f (R : β) := by
intro ha
obtain β¨q,r,hqβ© := ha
obtain β¨e,he0,heβ© := ENNReal.lt_iff_exists_nnreal_btwn.mp
(show (0 : ββ₯0β) < min (R : ββ₯0β) r from lt_min (by exact_mod_cast hR) hq.r_pos)
have hepos : 0 < e := by exact_mod_cast he0
have heR : e < R := by exact_mod_cast (lt_min_iff.mp he).1
have her : (e : ββ₯0β) < r := (lt_min_iff.mp he).2
let d : ββ₯0 := e/4
have hdpos : 0 < d := div_pos hepos (by norm_num)
have hdR : d < R := by dsimp [d]; linarith
have hde : 3*d < e := by dsimp [d]; linarith
have hd_le_e : d β€ e := by dsimp [d]; linarith
let x : ββ₯0 := R-d
have hdx : x+d=R := tsub_add_cancel_of_le hdR.le
have hxpos : 0 < x := tsub_pos_iff_lt.mpr hdR
have hxR : x < R := by linarith
have hxr : (x : ββ₯0β) < (ofScalars β c).radius := by rw [hr]; exact_mod_cast hxR
have hdr : (β-(d : β)ββ : ββ₯0β) < r := by
simpa using (show (d : ββ₯0β) < r from (show (d : ββ₯0β) β€ (e : ββ₯0β) by exact_mod_cast hd_le_e).trans_lt her)
have hsright := hq.changeOrigin hdr
have hcenter : (R : β) + -(d : β) = (x : β) := by
have hh : (x : β)+(d : β)=(R : β) := by exact_mod_cast hdx
linarith
rw [hcenter] at hsright
have hsleft := ((ofScalars β c).hasFPowerSeriesOnBall hxr.pos).changeOrigin
(show (β(x : β)ββ : ββ₯0β) < (ofScalars β c).radius by simpa using hxr)
rw [zero_add] at hsleft
have hloc : (ofScalars β c).sum =αΆ [π (x : β)] f := by
filter_upwards [Ioo_mem_nhds (by exact_mod_cast hxpos) (by exact_mod_cast hxR)] with z hz
exact (heq hz).symm
have hseries := (hsleft.hasFPowerSeriesAt.congr hloc).eq_formalMultilinearSeries
hsright.hasFPowerSeriesAt
have hy : ((2*d : ββ₯0) : ββ₯0β) < ((ofScalars β c).changeOrigin (x : β)).radius := by
rw [hseries]
apply lt_of_lt_of_le _ hsright.r_le
simp only [nnnorm_neg, NNReal.nnnorm_eq]
rw [lt_tsub_iff_right]
calc
((2*d : ββ₯0) : ββ₯0β) + (d : ββ₯0β) = ((3*d : ββ₯0) : ββ₯0β) := by push_cast; ring
_ < (e : ββ₯0β) := by exact_mod_cast hde
_ < r := her
have hh := radius_add_le c hc x (2*d) hxr hy
rw [hr] at hh
have hcast : x+2*d β€ R := by exact_mod_cast hh
linarith
theorem radius_gt_of_analytic_interval (c : β β β) (hc : β n, 0 β€ c n)
(B : ββ₯0) (f : β β β)
(hp : HasFPowerSeriesAt f (ofScalars β c) 0)
(hf : AnalyticOnNhd β f (Icc 0 (B : β))) :
(B : ββ₯0β) < (ofScalars β c).radius := by
by_contra hb
have hle : (ofScalars β c).radius β€ B := le_of_not_gt hb
have hfin : (ofScalars β c).radius β β€ := ne_top_of_le_ne_top ENNReal.coe_ne_top hle
let R := (ofScalars β c).radius.toNNReal
have hr : (ofScalars β c).radius = (R : ββ₯0β) := (ENNReal.coe_toNNReal hfin).symm
have hR : 0 < R := by
have hh := hp.radius_pos
rw [hr] at hh
exact_mod_cast hh
have hRB : R β€ B := by rw [hr] at hle; exact_mod_cast hle
have hloc : f =αΆ [π 0] (ofScalars β c).sum := by
filter_upwards [hp.eventually_hasSum] with z hz
simpa only [zero_add, FormalMultilinearSeries.sum] using hz.tsum_eq.symm
have hfs : AnalyticOnNhd β f (Ico 0 (R : β)) :=
hf.mono (fun z hz => β¨hz.1, hz.2.le.trans (by exact_mod_cast hRB)β©)
have hps : AnalyticOnNhd β (ofScalars β c).sum (Ico 0 (R : β)) := by
apply (ofScalars β c).analyticOnNhd.mono
intro z hz
rw [mem_eball_zero_iff, hr, enorm_eq_nnnorm, ENNReal.coe_lt_coe]
exact_mod_cast (show βzβ < (R : β) by simpa [Real.norm_eq_abs, abs_of_nonneg hz.1] using hz.2)
have heq := hfs.eqOn_of_preconnected_of_eventuallyEq hps isPreconnected_Ico
(show (0 : β) β Ico 0 (R : β) from β¨le_rfl, by exact_mod_cast hRβ©) hloc
exact not_analytic_at_radius c hc R hR hr f
(heq.mono Ioo_subset_Ico_self) (hf R β¨R.coe_nonneg, by exact_mod_cast hRBβ©)
end BelowOne.PositiveSeries
end
end
section
noncomputable section
open Finset Filter Set FormalMultilinearSeries
open scoped Topology NNReal ENNReal Classical
namespace BelowOne.PositiveAnalyticCube
open MultiaffineDerivative
variable {V : Type*} [Fintype V]
def cube : Set (V β β) := {x | β i, x i β Set.Icc 0 1}
def diagonal : β βL[β] (V β β) := ContinuousLinearMap.pi fun _ => ContinuousLinearMap.id β β
def taylor (f : (V β β) β β) : FormalMultilinearSeries β (V β β) β :=
fun n => (n.factorial : β)β»ΒΉ β’ iteratedFDeriv β n f 0
def diagonalCoefficient (f : (V β β) β β) (n : β) : β :=
taylor f n (fun _ _ => 1)
lemma taylor_diagonal_eq {f : (V β β) β β} {p : FormalMultilinearSeries β (V β β) β}
{r : ββ₯0β} (hp : HasFPowerSeriesOnBall f p 0 r) (x : V β β) (n : β) :
taylor f n (fun _ => x) = p n (fun _ => x) := by
have h := hp.factorial_smul x n
simp only [nsmul_eq_mul] at h
rw [taylor,_root_.smul_apply,smul_eq_mul,βh]
rw [βmul_assoc,inv_mul_cancelβ (Nat.cast_ne_zero.mpr n.factorial_ne_zero),one_mul]
lemma diagonal_hasFPowerSeriesAt {f : (V β β) β β} (hf : AnalyticAt β f 0) :
HasFPowerSeriesAt (f β diagonal) (ofScalars β (diagonalCoefficient f)) 0 := by
obtain β¨p,r,hpβ© := hf
have hs : HasFPowerSeriesAt (f β diagonal) (p.compContinuousLinearMap diagonal) 0 :=
(show HasFPowerSeriesAt f p (diagonal (V := V) 0) by simpa using hp.hasFPowerSeriesAt).compContinuousLinearMap
convert hs using 1
ext n
rw [FormalMultilinearSeries.apply_eq_prod_smul_coeff,FormalMultilinearSeries.apply_eq_prod_smul_coeff,
coeff_ofScalars]
congr 1
rw [diagonalCoefficient,taylor_diagonal_eq hp]
rfl
lemma taylor_coordinate_nonneg (f : (V β β) β β) (hf0 : 0 β€ f 0)
(hf : β n, 0 < n β β Ο : Fin n β V,
0 β€ iteratedFDeriv β n f 0 (coordinate β Ο)) (n : β) (Ο : Fin n β V) :
0 β€ taylor f n (coordinate β Ο) := by
rw [taylor,_root_.smul_apply,smul_eq_mul]
apply mul_nonneg (by positivity)
by_cases hn : n = 0
Β· subst n
simpa only [iteratedFDeriv_zero_apply] using hf0
Β· exact hf n (Nat.pos_of_ne_zero hn) Ο
lemma diagonalCoefficient_nonneg (f : (V β β) β β) (hf0 : 0 β€ f 0)
(hf : β n, 0 < n β β Ο : Fin n β V,
0 β€ iteratedFDeriv β n f 0 (coordinate β Ο)) (n : β) :
0 β€ diagonalCoefficient f n :=
PositiveMultilinear.nonneg _ (taylor_coordinate_nonneg f hf0 hf n) _ (fun _ _ => zero_le_one)
lemma radius_le_of_norm_le {E F : Type*} [NormedAddCommGroup E] [NormedSpace β E]
[NormedAddCommGroup F] [NormedSpace β F]
(p : FormalMultilinearSeries β E β) (q : FormalMultilinearSeries β F β)
(h : β n, βq nβ β€ βp nβ) : p.radius β€ q.radius := by
unfold FormalMultilinearSeries.radius
apply iSup_le
intro r
apply iSup_le
intro C
apply iSup_le
intro hC
apply q.le_radius_of_bound C
intro n
exact (mul_le_mul_of_nonneg_right (h n) (by positivity)).trans (hC n)
lemma taylor_radius_gt_one (f : (V β β) β β) (hf0 : 0 β€ f 0)
(hf : β n, 0 < n β β Ο : Fin n β V,
0 β€ iteratedFDeriv β n f 0 (coordinate β Ο))
(ha : AnalyticOnNhd β f cube) : 1 < (taylor f).radius := by
have ha0 : AnalyticAt β f 0 := ha 0 (fun i => by simp)
have hd : AnalyticOnNhd β (f β diagonal) (Set.Icc (0:β) 1) := by
intro x hx
exact (ha (diagonal x) (fun _ => hx)).compContinuousLinearMap
have hR := PositiveSeries.radius_gt_of_analytic_interval (diagonalCoefficient f)
(diagonalCoefficient_nonneg f hf0 hf) 1 (f β diagonal) (diagonal_hasFPowerSeriesAt ha0) hd
apply hR.trans_le
apply radius_le_of_norm_le
intro n
rw [ofScalars_norm,Real.norm_of_nonneg (diagonalCoefficient_nonneg f hf0 hf n)]
exact PositiveMultilinear.norm_le_ones _ (taylor_coordinate_nonneg f hf0 hf n)
lemma hasFPowerSeriesAt_taylor {f : (V β β) β β} (hf : AnalyticAt β f 0)
(hR : 0 < (taylor f).radius) : HasFPowerSeriesAt f (taylor f) 0 := by
obtain β¨p,r,hpβ© := hf
refine β¨min r (taylor f).radius, ?_β©
refine β¨min_le_right _ _,lt_min hp.r_pos hR,?_β©
intro x hx
have hx' : x β Metric.eball 0 r := by
exact mem_eball_zero_iff.mpr ((mem_eball_zero_iff.mp hx).trans_le (min_le_left _ _))
simpa only [taylor,_root_.smul_apply] using hp.hasSum_iteratedFDeriv hx'
omit [Fintype V] in
lemma cube_convex : Convex β (cube (V := V)) := by
have hc : cube (V := V) = Set.pi Set.univ (fun _ : V => Set.Icc (0:β) 1) := by
ext x
change (β i, x i β Set.Icc 0 1) β β i β Set.univ, x i β Set.Icc 0 1
simp only [Set.mem_univ, forall_true_left]
rw [hc]
exact convex_pi (fun _ _ => convex_Icc 0 1)
lemma cube_subset_eball {r : ββ₯0β} (hr : 1 < r) : cube (V := V) β Metric.eball 0 r := by
intro x hx
have hn : βxβ β€ 1 := by
apply (pi_norm_le_iff_of_nonneg zero_le_one).mpr
intro i
exact (Real.norm_of_nonneg (hx i).1).trans_le (hx i).2
apply mem_eball_zero_iff.mpr
exact (show βxββ β€ (1:ββ₯0β) by
rw [enorm_eq_nnnorm,β ENNReal.coe_one,ENNReal.coe_le_coe]
exact_mod_cast hn).trans_lt hr
lemma taylor_sum_eq_on_cube (f : (V β β) β β) (hf0 : 0 β€ f 0)
(hf : β n, 0 < n β β Ο : Fin n β V,
0 β€ iteratedFDeriv β n f 0 (coordinate β Ο))
(ha : AnalyticOnNhd β f cube) : Set.EqOn f (taylor f).sum cube := by
have hR := taylor_radius_gt_one f hf0 hf ha
have hp := hasFPowerSeriesAt_taylor (ha 0 (fun i => by simp)) (zero_lt_one.trans hR)
have heq : f =αΆ [π 0] (taylor f).sum := by
filter_upwards [hp.eventually_hasSum] with x hx
simpa only [zero_add,FormalMultilinearSeries.sum] using hx.tsum_eq.symm
exact ha.eqOn_of_preconnected_of_eventuallyEq
((taylor f).analyticOnNhd.mono (cube_subset_eball hR)) cube_convex.isPreconnected
(fun i => by simp) heq
end BelowOne.PositiveAnalyticCube
end
end
section
noncomputable section
open Finset Filter Set FormalMultilinearSeries
open scoped Topology NNReal ENNReal Classical
namespace BelowOne.FKPressure
variable {V I : Type*} [Fintype V]
def pressure (ends : I β V Γ V) (E : Finset I) (u : β) (v : I β β)
(x : V β β) : β := -Real.log (percolationSitePolynomial ends E (-u) v x)
lemma analyticAt_percolationSitePolynomial (ends : I β V Γ V) (E : Finset I)
(s : β) (v : I β β) (x : V β β) :
AnalyticAt β (percolationSitePolynomial ends E s v) x := by
rw [percolationSitePolynomial_eq]
unfold MultiaffineDerivative.polynomial
apply Finset.analyticAt_fun_sum
intro T hT
apply AnalyticAt.mul analyticAt_const
apply Finset.analyticAt_fun_prod
intro i hi
exact (ContinuousLinearMap.proj i : (V β β) βL[β] β).analyticAt x
lemma pressure_zero (ends : I β V Γ V) (E : Finset I)
(u : β) (v : I β β) (hv : β e β E, 0 β€ v e) : pressure ends E u v 0 = 0 := by
simp only [pressure,percolationSitePolynomial_zero ends E (-u) v hv,Real.log_one,neg_zero]
lemma pressure_derivative_nonneg (ends : I β V Γ V) (E : Finset I)
{u : β} (hu : 0 < u) (hu1 : u < 1) (v : I β β) (hv : β e β E, 0 β€ v e)
(n : β) (hn : 0 < n) (Ο : Fin n β V) :
0 β€ iteratedFDeriv β n (pressure ends E u v) 0
(MultiaffineDerivative.coordinate β Ο) := by
change 0 β€ iteratedFDeriv β n (-(fun x => Real.log (percolationSitePolynomial ends E (-u) v x))) 0
(MultiaffineDerivative.coordinate β Ο)
rw [iteratedFDeriv_neg_apply,_root_.neg_apply]
exact neg_nonneg.mpr (percolationSitePolynomial_log_derivative_nonpos hn Ο ends E hu hu1 v hv)
lemma pressure_analyticOn_cube (ends : I β V Γ V) (E : Finset I)
{u : β} (hu : 0 β€ u) (hu1 : u < 1) (v : I β β) (hv : β e β E, 0 β€ v e) :
AnalyticOnNhd β (pressure ends E u v) PositiveAnalyticCube.cube := by
intro x hx
exact ((analyticAt_log (percolationSitePolynomial_pos ends E hu hu1 v hv x hx)).comp
(analyticAt_percolationSitePolynomial ends E (-u) v x)).neg
theorem pressure_expansion (ends : I β V Γ V) (E : Finset I)
{u : β} (hu : 0 < u) (hu1 : u < 1) (v : I β β) (hv : β e β E, 0 β€ v e) :
let p := PositiveAnalyticCube.taylor (pressure ends E u v)
1 < p.radius β§
(β n (Ο : Fin n β V), 0 β€ p n (MultiaffineDerivative.coordinate β Ο)) β§
(β x β PositiveAnalyticCube.cube, HasSum (fun n => p n (fun _ => x)) (pressure ends E u v x)) := by
dsimp only
have hf0 : 0 β€ pressure ends E u v 0 := (pressure_zero ends E u v hv).ge
have hf := pressure_derivative_nonneg ends E hu hu1 v hv
have ha := pressure_analyticOn_cube ends E hu.le hu1 v hv
have hR := PositiveAnalyticCube.taylor_radius_gt_one _ hf0 hf ha
refine β¨hR,PositiveAnalyticCube.taylor_coordinate_nonneg _ hf0 hf,?_β©
intro x hx
rw [PositiveAnalyticCube.taylor_sum_eq_on_cube _ hf0 hf ha hx]
exact (PositiveAnalyticCube.taylor (pressure ends E u v)).summable
(PositiveAnalyticCube.cube_subset_eball hR hx) |>.hasSum
end BelowOne.FKPressure
end
end
end OAI
import Mathlib
namespace OAI
section
noncomputable section
open Set Filter MeasureTheory ProbabilityTheory
open scoped Topology ENNReal NNReal
namespace BelowOne
abbrev Time := Set.Icc (0 : β) 1
abbrev Curve := C(Time, β)
abbrev GridPoint := β€ Γ β€
instance : MeasurableSpace Curve := borel Curve
instance : BorelSpace Curve := β¨rflβ©
structure IncreasingReparam where
homeomorph : Time ββ Time
increasing : StrictMono homeomorph
instance : Inhabited IncreasingReparam :=
β¨β¨Homeomorph.refl _, fun _ _ h => hβ©β©
def curveDistance (Ξ± Ξ² : Curve) : β :=
sInf {r : β | β Ο Ο : IncreasingReparam,
r = sSup (Set.range fun t : Time => dist (Ξ± (Ο.homeomorph t)) (Ξ² (Ο.homeomorph t)))}
def IsCurveTest (f : Curve β β) : Prop :=
(β C : β, β Ξ±, |f Ξ±| β€ C) β§
β Ξ±, β Ξ΅ > 0, β r > 0, β Ξ², curveDistance Ξ± Ξ² < r β |f Ξ± - f Ξ²| < Ξ΅
def gridEmbed (Ξ΄ : β) (v : GridPoint) : β :=
β¨Ξ΄ * v.1, Ξ΄ * v.2β©
def gridNeighbor (v w : GridPoint) : Prop :=
(v.1 = w.1 β§ |v.2 - w.2| = 1) β¨
(v.2 = w.2 β§ |v.1 - w.1| = 1)
def interpolate (points : List β) (t : Time) : β :=
if (t : β) = 1 then points.getLast?.getD 0 else
let s := (t : β) * (points.length - 1)
let j := Nat.floor s
let ΞΈ : β := ((s - j : β) : β)
(1 - ΞΈ) * points[j]?.getD 0 + ΞΈ * points[j + 1]?.getD 0
def cycleNext {n : β} (hn : 0 < n) (i : Fin n) : Fin n :=
β¨(i.val + 1) % n, Nat.mod_lt _ hnβ©
def cyclePrev {n : β} (hn : 0 < n) (i : Fin n) : Fin n :=
β¨(i.val + n - 1) % n, Nat.mod_lt _ hnβ©
structure SmoothMarkedJordan where
domain : Set β
isOpen : IsOpen domain
isConnected : IsConnected domain
bounded : Bornology.IsBounded domain
boundary : β β β
smooth : ContDiff β (β(β€ : ββ)) boundary
periodic : Function.Periodic boundary 1
simple : Set.InjOn boundary (Set.Ico 0 1)
regular : β t, deriv boundary t β 0
frontier : frontier domain = boundary '' Set.Icc 0 1
positive_orientation :
0 < β« t in (0 : β)..1,
(boundary t).re * (deriv boundary t).im -
(boundary t).im * (deriv boundary t).re
secondMark : β
secondMark_pos : 0 < secondMark
secondMark_lt : secondMark < 1
def SmoothMarkedJordan.a (D : SmoothMarkedJordan) := D.boundary 0
def SmoothMarkedJordan.b (D : SmoothMarkedJordan) := D.boundary D.secondMark
structure LatticePolygon (Ξ΄ : β) where
domain : Set β
isOpen : IsOpen domain
isConnected : IsConnected domain
bounded : Bornology.IsBounded domain
nVertices : β
vertices : Fin nVertices β GridPoint
vertices_injective : Function.Injective vertices
all_vertices : β v : GridPoint,