cfahlgren1's picture
download
raw
21 kB
16
abbrev Center := ℤ × ℤ × Bool
18
def up (i j : ℤ) : Center := (i, j, true)
19
def down (i j : ℤ) : Center := (i, j, false)

Adjacency across a full triangular edge.

22
def Adj (v w : Center) : Prop :=
body · 8 lines
  if v.2.2 then
    w.2.2 = false ∧ ((w.1 = v.1 ∧ w.2.1 = v.2.1) ∨
      (w.1 = v.1 ∧ w.2.1 = v.2.1 - 1) ∨
      (w.1 = v.1 - 1 ∧ w.2.1 = v.2.1))
  else
    w.2.2 = true ∧ ((w.1 = v.1 ∧ w.2.1 = v.2.1) ∨
      (w.1 = v.1 ∧ w.2.1 = v.2.1 + 1) ∨
      (w.1 = v.1 + 1 ∧ w.2.1 = v.2.1))
32
noncomputable def rowSpacing : ℝ := Real.sqrt 3 / 2

The fixed Euclidean embedding in the unit triangular tiling.

35
noncomputable def centerPosition (v : Center) : ℝ × ℝ :=
body · 6 lines
  if v.2.2 then
    ((v.1 : ℝ) + (v.2.1 : ℝ) / 2 + 1 / 2,
      rowSpacing * ((v.2.1 : ℝ) + 1 / 3))
  else
    ((v.1 : ℝ) + (v.2.1 : ℝ) / 2 + 1,
      rowSpacing * ((v.2.1 : ℝ) + 2 / 3))

A midpoint port, oriented into the triangle domain.

44
structure Port (D : Set Center) where
body · 5 lines
  inside : Center
  outside : Center
  adjacent : Adj inside outside
  inside_mem : inside ∈ D
  outside_not_mem : outside ∉ D
51
noncomputable def Port.position {D : Set Center} (p : Port D) : ℝ × ℝ :=
body · 2 lines
  ((centerPosition p.inside).1 / 2 + (centerPosition p.outside).1 / 2,
    (centerPosition p.inside).2 / 2 + (centerPosition p.outside).2 / 2)

A simple center trace, with no premature boundary exit.

56
def IsTrace (D : Set Center) (p : List Center) : Prop :=
body · 1 line
  p.Nodup ∧ p.IsChain Adj ∧ ∀ v ∈ p, v ∈ D
59
def Chord (D : Set Center) (a b : Port D) :=
body · 2 lines
  {p : List Center // IsTrace D p ∧
    p.head? = some a.inside ∧ p.getLast? = some b.inside}
63
noncomputable def kappa : ℝ := (2 + Real.sqrt 2) ^ (-(1 : ℝ) / 2)

Length counts centers; the port half-edges contribute no factors.

66
noncomputable def weight (p : List Center) : ℝ≥0∞ :=
body · 1 line
  ENNReal.ofReal (kappa ^ p.length)
69
noncomputable def chordMass (D : Set Center) (a b : Port D) : ℝ≥0∞ :=
body · 1 line
  ∑' p : Chord D a b, weight p.val
78
lemma adj_symmetric : ∀ ⦃v w : Center⦄, CriticalHoneycomb.Adj v w → CriticalHoneycomb.Adj w v := by
proof · 2 lines
  rintro ⟨i,j,c⟩ ⟨k,l,d⟩ h
  cases c <;> cases d <;> simp_all [CriticalHoneycomb.Adj] <;> omega
82
lemma adj_irrefl (v : Center) : ¬ CriticalHoneycomb.Adj v v := by
proof · 2 lines
  rcases v with ⟨i,j,c⟩
  cases c <;> simp [CriticalHoneycomb.Adj]
86
abbrev Interior (D : Finset Center) := {v // v ∈ D}
87
abbrev Vertices (D : Finset Center) := Interior D ⊕ Bool
89
def portInside {D : Finset Center} (a : Port (D : Set Center)) : Interior D :=
body · 1 line
  ⟨a.inside,a.inside_mem⟩
92
def hardWallGraph (D : Finset Center) (a b : Port (D : Set Center)) :
    SimpleGraph (Vertices D) where
body · 18 lines
  Adj := portRel (fun x y : Interior D => CriticalHoneycomb.Adj x.val y.val)
    (portInside a) (portInside b)
  symm := ⟨by
    intro x y h
    cases x with
    | inl x =>
      cases y with
      | inl y => exact adj_symmetric h
      | inr q => cases q <;> exact h
    | inr q =>
      cases y with
      | inl y => cases q <;> exact h
      | inr r => cases q <;> cases r <;> exact h.elim⟩
  loopless := ⟨by
    intro v
    cases v with
    | inl v => exact adj_irrefl v.val
    | inr q => cases q <;> exact id⟩

All hard-wall, unoriented 0/2-degree configurations with the two specified ports occupied. This is finite graph data, not a probabilistic input.

115
structure Configuration (D : Finset Center) (a b : Port (D : Set Center)) where
body · 5 lines
  graph : SimpleGraph (Vertices D)
  allowed : graph ≤ hardWallGraph D a b
  port_degree : ∀ q : Bool, (graph.neighborSet (.inr q)).ncard = 1
  center_degree : ∀ v : Interior D,
    (graph.neighborSet (.inl v)).ncard = 0 ∨ (graph.neighborSet (.inl v)).ncard = 2

The unique open component supplied by a local physical configuration is an actual source center trace, with no other exit and with no repeated center. Only the additionally detached cycle graph remains.

125
theorem configuration_contains_chord {D : Finset Center} {a b : Port (D : Set Center)}
    (C : Configuration D a b) :
    ∃ (γ : Chord (D : Set Center) a b) (xs : List (Interior D))
      (p : C.graph.Walk (.inr false) (.inr true)),
      xs.map Subtype.val = γ.val ∧ p.IsPath ∧
      p.support = Sum.inr false :: (xs.map Sum.inl ++ [Sum.inr true]) ∧
      (C.graph \ p.toSubgraph.spanningCoe).IsCycles := by
proof · 29 lines
  classical
  have hp (q : Bool) : C.graph.degree (.inr q) = 1 := by
    rw [← PathComponents.ncard_neighbors]
    exact C.port_degree q
  have hc (v : Vertices D) (ha : v ≠ .inr false) (hb : v ≠ .inr true) :
      C.graph.degree v = 0 ∨ C.graph.degree v = 2 := by
    cases v with
    | inl v =>
      simpa only [PathComponents.ncard_neighbors] using C.center_degree v
    | inr q => cases q <;> contradiction
  obtain ⟨p,hp',hcycles,_⟩ := PathComponents.path_and_cycles C.graph
    (by simp : (Sum.inr false : Vertices D) ≠ .inr true) (hp false) (hp true) hc
  obtain ⟨xs,hxs,hn⟩ := support_decomposition p hp'
  have hch : p.support.IsChain (hardWallGraph D a b).Adj :=
    p.isChain_adj_support.imp (fun _ _ h => C.allowed h)
  rw [hxs] at hch
  have hch' := (chain_ports (fun x y : Interior D => CriticalHoneycomb.Adj x.val y.val)
    (portInside a) (portInside b) xs).mp hch
  let γ : Chord (D : Set Center) a b := ⟨xs.map Subtype.val, by
    refine ⟨⟨hn.map Subtype.val_injective,?_,?_⟩,?_,?_⟩
    · exact (List.isChain_map Subtype.val).mpr hch'.1
    · intro v hv
      obtain ⟨x,_,rfl⟩ := List.mem_map.mp hv
      exact x.property
    · rw [List.head?_map,hch'.2.1]
      rfl
    · rw [List.getLast?_map,hch'.2.2]
      rfl⟩
  exact ⟨γ,xs,p,rfl,hp',hxs,hcycles⟩

Conversely, every actual center chord determines a simple path in the hard-wall graph with the exact two specified boundary markers.

169
theorem chord_has_hardWall_path {D : Finset Center} {a b : Port (D : Set Center)}
    (γ : Chord (D : Set Center) a b) :
    ∃ (xs : List (Interior D))
      (p : (hardWallGraph D a b).Walk (.inr false) (.inr true)),
      xs.map Subtype.val = γ.val ∧ p.IsPath ∧
      p.support = Sum.inr false :: (xs.map Sum.inl ++ [Sum.inr true]) := by
proof · 31 lines
  let xs : List (Interior D) := γ.val.attach.map fun v =>
    ⟨v.val, γ.property.1.2.2 v.val v.property⟩
  have hmap : xs.map Subtype.val = γ.val := by
    simpa only [xs,List.map_map,Function.comp_def] using List.attach_map_subtype_val γ.val
  have hnd : xs.Nodup := List.Nodup.of_map _ (hmap.symm ▸ γ.property.1.1)
  have hchain : xs.IsChain (fun x y => CriticalHoneycomb.Adj x.val y.val) := by
    exact (List.isChain_map Subtype.val).mp (hmap.symm ▸ γ.property.1.2.1)
  have hhead : xs.head? = some (portInside a) := by
    apply Option.map_injective Subtype.val_injective
    change xs.head?.map Subtype.val = some a.inside
    rw [← List.head?_map,hmap]
    exact γ.property.2.1
  have hlast : xs.getLast? = some (portInside b) := by
    apply Option.map_injective Subtype.val_injective
    change xs.getLast?.map Subtype.val = some b.inside
    rw [← List.getLast?_map,hmap]
    exact γ.property.2.2
  let support : List (Vertices D) := Sum.inr false :: (xs.map Sum.inl ++ [Sum.inr true])
  have hne : support ≠ [] := List.cons_ne_nil _ _
  have hsc : support.IsChain (hardWallGraph D a b).Adj :=
    (chain_ports _ (portInside a) (portInside b) xs).mpr ⟨hchain,hhead,hlast⟩
  have hsh : support.head hne = .inr false := by rfl
  have hsl : support.getLast hne = .inr true := by simp [support]
  let p : (hardWallGraph D a b).Walk (.inr false) (.inr true) :=
    (Walk.ofSupport support hne hsc).copy hsh hsl
  have hps : p.support = support := by
    dsimp only [p]
    rw [Walk.support_copy,Walk.support_ofSupport]
  refine ⟨xs,p,hmap,?_,hps⟩
  rw [Walk.isPath_def,hps]
  simp [support,List.nodup_append,hnd.map Sum.inl_injective]

A full triangular edge indexed from its up-triangle side: middle, south, west. All tensor wires are actual edges, not abstract crossings.

211
abbrev Wire := ℤ × ℤ × Fin 3
213
def neighbor (v : Center) (k : Fin 3) : Center :=
body · 2 lines
  if v.2.2 then down (v.1 - if k=2 then 1 else 0) (v.2.1 - if k=1 then 1 else 0)
  else up (v.1 + if k=2 then 1 else 0) (v.2.1 + if k=1 then 1 else 0)
217
def incidentWire (v : Center) (k : Fin 3) : Wire :=
body · 2 lines
  if v.2.2 then (v.1,v.2.1,k)
  else (v.1 + if k=2 then 1 else 0,v.2.1 + if k=1 then 1 else 0,k)
221
lemma neighbor_neighbor (v : Center) (k : Fin 3) : neighbor (neighbor v k) k = v := by
proof · 2 lines
  rcases v with ⟨i,j,t⟩
  cases t <;> fin_cases k <;> simp [neighbor,up,down]
225
lemma neighbor_ne (v : Center) (k : Fin 3) : neighbor v k ≠ v := by
proof · 2 lines
  rcases v with ⟨i,j,t⟩
  cases t <;> simp [neighbor,up,down]
229
lemma neighbor_injective (v : Center) : Function.Injective (neighbor v) := by
proof · 3 lines
  rcases v with ⟨i,j,t⟩
  intro k l h
  cases t <;> fin_cases k <;> fin_cases l <;> simp_all [neighbor,up,down] <;> omega
234
lemma incidentWire_neighbor (v : Center) (k : Fin 3) :
    incidentWire (neighbor v k) k = incidentWire v k := by
proof · 2 lines
  rcases v with ⟨i,j,t⟩
  cases t <;> fin_cases k <;> simp [neighbor,incidentWire,up,down]
239
lemma incidentWire_injective (v : Center) : Function.Injective (incidentWire v) := by
proof · 3 lines
  intro k l h
  have hi := congrArg (fun w : Wire => w.2.2) h
  cases hv : v.2.2 <;> simpa [incidentWire,hv] using hi
244
lemma incidentWire_eq_iff (v w : Center) (k l : Fin 3) :
    incidentWire v k = incidentWire w l ↔ k=l ∧ (v=w ∨ neighbor v k=w) := by
proof · 4 lines
  rcases v with ⟨i,j,t⟩
  rcases w with ⟨i',j',t'⟩
  cases t <;> cases t' <;> fin_cases k <;> fin_cases l <;>
    simp [incidentWire,neighbor,up,down,Prod.mk.injEq] <;> omega
251
lemma adj_iff_neighbor (v w : Center) : Adj v w ↔ ∃ k : Fin 3, neighbor v k=w := by
proof · 3 lines
  rcases v with ⟨i,j,t⟩
  rcases w with ⟨i',j',t'⟩
  cases t <;> cases t' <;> simp [Adj,neighbor,up,down,Fin.exists_fin_succ] <;> omega
256
noncomputable def Port.side {D : Set Center} (p : Port D) : Fin 3 :=
body · 1 line
  ((adj_iff_neighbor p.inside p.outside).mp p.adjacent).choose
259
lemma Port.neighbor_side {D : Set Center} (p : Port D) :
    neighbor p.inside p.side = p.outside :=
proof · 1 line
  ((adj_iff_neighbor p.inside p.outside).mp p.adjacent).choose_spec
263
noncomputable def Port.wire {D : Set Center} (p : Port D) : Wire :=
body · 1 line
  incidentWire p.inside p.side

A selected exterior midpoint may become a prescribed boundary vertex only at its original inside center.

268
lemma Port.wire_eq_incident {D : Set Center} (p : Port D) {v : Center} (hv : v∈D)
    {k : Fin 3} (h : incidentWire v k=p.wire) : v=p.inside ∧ k=p.side := by
proof · 7 lines
  have he := (incidentWire_eq_iff v p.inside k p.side).mp h
  have hk := he.1
  refine ⟨?_,hk⟩
  rcases he.2 with he | he
  · exact he
  · have ho : neighbor p.inside p.side = v := by rw [←he,←hk,neighbor_neighbor]
    exact False.elim (p.outside_not_mem (by rw [←p.neighbor_side,ho]; exact hv))
278
lemma Port.wire_ext {D : Set Center} (a b : Port D) (h : a.wire=b.wire) : a=b := by
proof · 5 lines
  have he := b.wire_eq_incident a.inside_mem h
  have ho : a.outside=b.outside := by rw [←a.neighbor_side,←b.neighbor_side,he.1,he.2]
  cases a
  cases b
  simp_all
290
noncomputable def portAt {D : Finset Center} (a b : Port (D : Set Center))
    (q : Bool) : Port (D : Set Center) := if q then b else a

Occupied actual midpoint edges, with only the two prescribed exits.

294
def BoundarySelection {D : Finset Center} (a b : Port (D : Set Center))
    (s : Wire → Bool) : Prop :=
body · 3 lines
  s a.wire=true ∧ s b.wire=true ∧ ∀ v∈D, ∀ k : Fin 3,
    neighbor v k ∉ D → s (incidentWire v k)=true →
      incidentWire v k=a.wire ∨ incidentWire v k=b.wire
300
def selectedRel {D : Finset Center} (a b : Port (D : Set Center))
    (s : Wire → Bool) : Vertices D → Vertices D → Prop
body · 4 lines
  | .inl v,.inl w => ∃ k : Fin 3, neighbor v.val k=w.val ∧ s (incidentWire v.val k)=true
  | .inl v,.inr q => v.val=(portAt a b q).inside ∧ s (portAt a b q).wire=true
  | .inr q,.inl v => v.val=(portAt a b q).inside ∧ s (portAt a b q).wire=true
  | .inr _,.inr _ => False
307
lemma selectedRel_symm {D : Finset Center} (a b : Port (D : Set Center)) (s : Wire → Bool) :
    ∀ ⦃v w : Vertices D⦄, selectedRel a b s v w → selectedRel a b s w v := by
proof · 11 lines
  intro x y h
  cases x with
  | inl v =>
    cases y with
    | inl w =>
      obtain ⟨k,hk,hs⟩ := h
      refine ⟨k,?_,?_⟩
      · rw [←hk,neighbor_neighbor]
      · rw [←hk,incidentWire_neighbor]; exact hs
    | inr q => exact h
  | inr q => cases y <;> exact h
321
noncomputable def selectedGraph {D : Finset Center} (a b : Port (D : Set Center)) (s : Wire → Bool) :
    SimpleGraph (Vertices D) where
body · 7 lines
  Adj := selectedRel a b s
  symm := ⟨selectedRel_symm a b s⟩
  loopless := ⟨by
    intro x h
    cases x with
    | inl v => obtain ⟨k,hk,_⟩ := h; exact neighbor_ne v.val k hk
    | inr q => exact h⟩
331
lemma selectedGraph_allowed {D : Finset Center} (a b : Port (D : Set Center)) (s : Wire → Bool) :
    selectedGraph a b s ≤ hardWallGraph D a b := by
proof · 9 lines
  intro x y h
  cases x with
  | inl v => cases y with
    | inl w =>
      exact (adj_iff_neighbor v.val w.val).mpr ⟨h.choose,h.choose_spec.1⟩
    | inr q => cases q <;> exact Subtype.ext h.1
  | inr q => cases y with
    | inl v => cases q <;> exact Subtype.ext h.1
    | inr r => exact False.elim h
343
lemma selectedGraph_port_neighbors {D : Finset Center} (a b : Port (D : Set Center))
    (s : Wire → Bool) (hs : BoundarySelection a b s) (q : Bool) :
    (selectedGraph a b s).neighborSet (.inr q) = {.inl (portInside (portAt a b q))} := by
proof · 7 lines
  ext x
  cases x with
  | inl v =>
    change (v.val=(portAt a b q).inside ∧ _) ↔ _
    have hq : s (portAt a b q).wire=true := by cases q <;> simp_all [portAt,BoundarySelection]
    simp [hq,portInside,Subtype.ext_iff]
  | inr r => simp [SimpleGraph.neighborSet,selectedGraph,selectedRel]

The neighbor of a center represented by one of its three actual edges.

355
def sideNeighbor {D : Finset Center} (a b : Port (D : Set Center))
    (v : Interior D) (k : Fin 3) : Vertices D → Prop
body · 2 lines
  | .inl w => neighbor v.val k = w.val
  | .inr q => v.val=(portAt a b q).inside ∧ k=(portAt a b q).side
360
lemma sideNeighbor_side_unique {D : Finset Center} (a b : Port (D : Set Center))
    (v : Interior D) {k l : Fin 3} {w : Vertices D}
    (hk : sideNeighbor a b v k w) (hl : sideNeighbor a b v l w) : k=l := by
proof · 3 lines
  cases w with
  | inl w => exact neighbor_injective v.val (hk.trans hl.symm)
  | inr q => exact hk.2.trans hl.2.symm
367
lemma sideNeighbor_neighbor_unique {D : Finset Center} (a b : Port (D : Set Center))
    (hab : a≠b) (v : Interior D) (k : Fin 3) {x y : Vertices D}
    (hx : sideNeighbor a b v k x) (hy : sideNeighbor a b v k y) : x=y := by
proof · 15 lines
  cases x with
  | inl x => cases y with
    | inl y => exact congrArg Sum.inl (Subtype.ext (hx.symm.trans hy))
    | inr q =>
      have ho : x.val=(portAt a b q).outside := by rw [←hx,hy.1,hy.2,Port.neighbor_side]
      exact False.elim ((portAt a b q).outside_not_mem (ho ▸ x.property))
  | inr q => cases y with
    | inl y =>
      have ho : y.val=(portAt a b q).outside := by rw [←hy,hx.1,hx.2,Port.neighbor_side]
      exact False.elim ((portAt a b q).outside_not_mem (ho ▸ y.property))
    | inr r =>
      have he : (portAt a b q).wire=(portAt a b r).wire := by
        unfold Port.wire; rw [←hx.1,←hx.2,←hy.1,←hy.2]
      have hp := Port.wire_ext _ _ he
      cases q <;> cases r <;> simp_all [portAt]
386
lemma selected_side_has_neighbor {D : Finset Center} (a b : Port (D : Set Center))
    (s : Wire → Bool) (hs : BoundarySelection a b s)
    (v : Interior D) (k : Fin 3) (hk : s (incidentWire v.val k)=true) :
    ∃ w : Vertices D, sideNeighbor a b v k w := by
proof · 5 lines
  by_cases hi : neighbor v.val k ∈ D
  · exact ⟨.inl ⟨_,hi⟩,rfl⟩
  · rcases hs.2.2 v.val v.property k hi hk with ha | hb
    · exact ⟨.inr false,by simpa [sideNeighbor,portAt] using a.wire_eq_incident v.property ha⟩
    · exact ⟨.inr true,by simpa [sideNeighbor,portAt] using b.wire_eq_incident v.property hb⟩
396
lemma sideNeighbor_adj {D : Finset Center} (a b : Port (D : Set Center))
    (s : Wire → Bool) (v : Interior D) (k : Fin 3) (w : Vertices D)
    (hk : s (incidentWire v.val k)=true) (hw : sideNeighbor a b v k w) :
    (selectedGraph a b s).Adj (.inl v) w := by
proof · 5 lines
  cases w with
  | inl w => exact ⟨k,hw,hk⟩
  | inr q =>
    refine ⟨hw.1,?_⟩
    simpa [Port.wire,←hw.1,←hw.2] using hk
406
lemma adj_sideNeighbor {D : Finset Center} (a b : Port (D : Set Center))
    (s : Wire → Bool) (v : Interior D) (w : Vertices D)
    (h : (selectedGraph a b s).Adj (.inl v) w) :
    ∃ k : Fin 3, s (incidentWire v.val k)=true ∧ sideNeighbor a b v k w := by
proof · 5 lines
  cases w with
  | inl w => obtain ⟨k,hw,hk⟩ := h; exact ⟨k,hk,hw⟩
  | inr q =>
    refine ⟨(portAt a b q).side,?_,h.1,rfl⟩
    simpa [h.1,Port.wire] using h.2

Selected geometric sides and selected graph neighbors are in exact bijection; the hard-wall condition is used only for the missing exterior neighbors. Distinct ports may share an inside center.

424
noncomputable def centerNeighborEquiv {D : Finset Center} (a b : Port (D : Set Center))
    (hab : a≠b) (s : Wire → Bool) (hs : BoundarySelection a b s) (v : Interior D) :
    {k : Fin 3 // s (incidentWire v.val k)=true} ≃
      (selectedGraph a b s).neighborSet (.inl v) := by
body · 22 lines
  classical
  let f : {k : Fin 3 // s (incidentWire v.val k)=true} →
      (selectedGraph a b s).neighborSet (.inl v) := fun k =>
    ⟨(selected_side_has_neighbor a b s hs v k.val k.property).choose,
      sideNeighbor_adj a b s v k.val _ k.property
        (selected_side_has_neighbor a b s hs v k.val k.property).choose_spec⟩
  apply Equiv.ofBijective f
  constructor
  · intro k l h
    apply Subtype.ext
    apply sideNeighbor_side_unique a b v
      (selected_side_has_neighbor a b s hs v k.val k.property).choose_spec
    have hval := congrArg Subtype.val h
    change (selected_side_has_neighbor a b s hs v k.val k.property).choose =
      (selected_side_has_neighbor a b s hs v l.val l.property).choose at hval
    rw [hval]
    exact (selected_side_has_neighbor a b s hs v l.val l.property).choose_spec
  · intro w
    obtain ⟨k,hk,hw⟩ := adj_sideNeighbor a b s v w.val w.property
    refine ⟨⟨k,hk⟩,Subtype.ext ?_⟩
    exact sideNeighbor_neighbor_unique a b hab v k
      (selected_side_has_neighbor a b s hs v k hk).choose_spec hw
451
def selectedSideCount (s : Wire → Bool) (v : Center) : ℕ :=
body · 1 line
  (s (incidentWire v 0)).toNat+(s (incidentWire v 1)).toNat+(s (incidentWire v 2)).toNat
454
lemma selectedSideCount_eq_card (s : Wire → Bool) (v : Center) :
    selectedSideCount s v = Fintype.card {k : Fin 3 // s (incidentWire v k)=true} := by
proof · 5 lines
  classical
  rw [Fintype.card_subtype,Finset.card_filter,Fin.sum_univ_three]
  cases h0 : s (incidentWire v 0) <;> cases h1 : s (incidentWire v 1) <;>
    cases h2 : s (incidentWire v 2) <;>
    simp [selectedSideCount,h0,h1,h2]
462
lemma selectedGraph_center_degree {D : Finset Center} (a b : Port (D : Set Center))
    (hab : a≠b) (s : Wire → Bool) (hs : BoundarySelection a b s) (v : Interior D) :
    ((selectedGraph a b s).neighborSet (.inl v)).ncard = selectedSideCount s v.val := by
proof · 4 lines
  classical
  change Nat.card ((selectedGraph a b s).neighborSet (.inl v)) = _
  rw [Nat.card_eq_fintype_card,selectedSideCount_eq_card]
  exact (Fintype.card_congr (centerNeighborEquiv a b hab s hs v)).symm

The exact local 0/2 rule, rather than an assumed path partition, gives an admissible finite configuration on the actual honeycomb graph.

472
noncomputable def configurationOfSides {D : Finset Center} (a b : Port (D : Set Center))
    (hab : a≠b) (s : Wire → Bool) (hs : BoundarySelection a b s)
    (hdeg : ∀ v∈D, selectedSideCount s v=0 ∨ selectedSideCount s v=2) :
    Configuration D a b where
body · 7 lines
  graph := selectedGraph a b s
  allowed := selectedGraph_allowed a b s
  port_degree := by intro q; rw [selectedGraph_port_neighbors a b s hs q]; simp
  center_degree := by
    intro v
    rw [selectedGraph_center_degree a b hab s hs v]
    exact hdeg v.val v.property

Xet Storage Details

Size:
21 kB
·
Xet hash:
f3a23d7e9da2936a93edf2c3256f0d2c93712678620d47db895f2edd97c5f6b3

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.