Documentation

Lightlike.Surfaces.Surgery

Checked surgery on closed surfaces #

Several steps of the classification cut a small region out of a closed surface and glue in a different one with the same boundary: removing a tube, capping a band, forming a connected sum. The region X and its replacement Y are concrete complexes on natural-number labels, placed in the surface K by an embedding f of the labels. This file proves once and for all that the result surg K f X Y = (K \ f(X)) ∪ f(Y) is again a closed connected surface, provided a finite, decidable list of conditions on X and Y holds (SurgOK, checked by decide +kernel) and the placement satisfies a few conditions in K (SurgCtx).

The template conditions are local:

Links in the result are then connected by a projection argument (connEdges_of_proj), and the Euler characteristic changes by χ(Y) − χ(X) (euler2_surg).

Reachability by a finite closure #

One closure step: add the edges of E that meet R.

Equations
Instances For

    The labels reached from a in n closure steps along the edges of E.

    Equations
    Instances For

      The labels reached from a along the edges of E (as many steps as E has vertices).

      Equations
      Instances For
        theorem Lightlike.Surfaces.reach_sound {E : Finset (Finset ℕ)} (hE : ∀ e ∈ E, e.card = 2) {a : ℕ} (n x : ℕ) :
        x ∈ reach E a n → Relation.ReflTransGen (fun (p q : ℕ) => {p, q} ∈ E) a x

        Soundness of reachability: every label reached from a is joined to a by a path of edges of E.

        theorem Lightlike.Surfaces.reachAll_sound {E : Finset (Finset ℕ)} (hE : ∀ e ∈ E, e.card = 2) {a x : ℕ} (hx : x ∈ reachAll E a) :
        Relation.ReflTransGen (fun (p q : ℕ) => {p, q} ∈ E) a x

        Soundness of reachAll.

        Connectivity by projection #

        theorem Lightlike.Surfaces.adj_symm {V : Type u_1} [DecidableEq V] {N : Finset (Finset V)} (a b : V) :
        {a, b} ∈ N → {b, a} ∈ N

        Adjacency through a pair in an edge set is symmetric.

        theorem Lightlike.Surfaces.connEdges_of_proj {V : Type u_1} [DecidableEq V] {S N : Finset (Finset V)} (k : V → Prop) {a : V} (hS : PR.IsConnEdges S) (ha : a ∈ PR.verts2 S) (h1 : ∀ (x y : V), {x, y} ∈ S → k x → k y → Relation.ReflTransGen (fun (p q : V) => {p, q} ∈ N) x y) (h2 : ∀ (x y : V), {x, y} ∈ S → k x → ¬k y → Relation.ReflTransGen (fun (p q : V) => {p, q} ∈ N) x a) (h3 : ∀ w ∈ PR.verts2 N, w ∈ PR.verts2 S ∧ k w ∨ Relation.ReflTransGen (fun (p q : V) => {p, q} ∈ N) w a) :

        Connectivity by projection. Let S be a connected edge set and N another one. Call the vertices satisfying k kept. If every edge of S between kept vertices is joined in N, every edge of S from a kept vertex to a removed one has its kept end joined in N to an anchor a of S, and every vertex of N is a kept vertex of S or joined in N to a, then N is connected. (Project each vertex of S to itself if kept, to a otherwise.)

        Counting triangles at an edge #

        def Lightlike.Surfaces.cnt {W : Type u_2} [DecidableEq W] (X : Finset (Finset W)) (e : Finset W) :

        The number of triangles of X containing e.

        Equations
        Instances For
          theorem Lightlike.Surfaces.mem_edges2_iff_cnt {V : Type u_1} [DecidableEq V] {M : Finset (Finset V)} {e : Finset V} (he : e.card = 2) :
          e ∈ PR.edges2 M ↔ 0 < cnt M e

          A pair is an edge exactly when some triangle contains it.

          theorem Lightlike.Surfaces.card_of_mem_edges2 {V : Type u_1} [DecidableEq V] {M : Finset (Finset V)} {e : Finset V} (he : e ∈ PR.edges2 M) :
          e.card = 2

          Edges have two vertices.

          theorem Lightlike.Surfaces.cnt_liftK {V : Type u_1} [DecidableEq V] {f : ℕ ↪ V} (Z : Finset (Finset ℕ)) (e : Finset ℕ) :
          cnt (liftK f Z) (Finset.map f e) = cnt Z e

          Relabelling preserves the number of triangles at an edge.

          theorem Lightlike.Surfaces.exists_label {V : Type u_1} [DecidableEq V] {f : ℕ ↪ V} {Z : Finset (Finset ℕ)} {s : Finset V} (hs : s ∈ liftK f Z) {x : V} (hx : x ∈ s) :
          ∃ m ∈ PR.verts2 Z, f m = x

          Every vertex of a relabelled complex is the image of a label.

          theorem Lightlike.Surfaces.lift_lk2_edge {V : Type u_1} [DecidableEq V] {f : ℕ ↪ V} {Z : Finset (Finset ℕ)} {M : Finset (Finset V)} (hZ : liftK f Z ⊆ M) {n p q : ℕ} (h : {p, q} ∈ PR.lk2 Z n) :
          {f p, f q} ∈ PR.lk2 M (f n)

          Relabelling carries link edges to link edges.

          theorem Lightlike.Surfaces.lift_reach {V : Type u_1} [DecidableEq V] {f : ℕ ↪ V} {Z : Finset (Finset ℕ)} {M : Finset (Finset V)} (hZ : liftK f Z ⊆ M) (hZ3 : ∀ t ∈ Z, t.card = 3) {n a x : ℕ} (hx : x ∈ reachAll (PR.lk2 Z n) a) :
          Relation.ReflTransGen (fun (p q : V) => {p, q} ∈ PR.lk2 M (f n)) (f a) (f x)

          Reachability in the link of n in Z lifts to the link of f n in any complex containing the image of Z.

          theorem Lightlike.Surfaces.lift_lk2 {V : Type u_1} [DecidableEq V] {f : ℕ ↪ V} {Z : Finset (Finset ℕ)} {M : Finset (Finset V)} (hZ : liftK f Z ⊆ M) {n : ℕ} {e : Finset ℕ} (h : e ∈ PR.lk2 Z n) :
          Finset.map f e ∈ PR.lk2 M (f n)

          Relabelling carries the link of n into the link of f n.

          The template conditions and the placement #

          The template conditions for replacing the region X by Y. Labels of X are boundary labels and must all occur in Y; labels of Y only are new. S lists pairs of boundary labels that span no triangle of the surrounding surface.

          • X and Y are nonempty and the triangles of Y have three labels;
          • each pair of labels of Y lies in as many triangles of X as of Y, or in two of X and none of Y, or in none of X and two of Y and is safe;
          • at each label n of Y there is an anchor a that every vertex of the link of n in Y reaches inside that link; at a boundary label the anchor is in the link of n in X, and so is reached by every vertex m of that link with nm in fewer or more than two triangles of X.
          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            structure Lightlike.Surfaces.SurgCtx {V : Type u_1} [DecidableEq V] (K : Finset (Finset V)) (f : ℕ ↪ V) (X Y : Finset (Finset ℕ)) (S : List (ℕ × ℕ)) :

            The placement conditions for the surgery in K through the labelling f: the region lies in K, new labels go to vertices outside K, the pairs of S span no triangle of K, and no triangle of the replacement is already in K.

            Instances For
              def Lightlike.Surfaces.surg {V : Type u_1} [DecidableEq V] (K : Finset (Finset V)) (f : ℕ ↪ V) (X Y : Finset (Finset ℕ)) :

              The result of the surgery: remove the image of X from K and add the image of Y.

              Equations
              Instances For
                theorem Lightlike.Surfaces.mem_surg {V : Type u_1} [DecidableEq V] {K : Finset (Finset V)} {f : ℕ ↪ V} {X Y : Finset (Finset ℕ)} {s : Finset V} :
                s ∈ surg K f X Y ↔ s ∈ K ∧ s ∉ liftK f X ∨ s ∈ liftK f Y

                Membership in the result of a surgery.

                theorem Lightlike.Surfaces.SurgCtx.disj_Y {V : Type u_1} [DecidableEq V] {K : Finset (Finset V)} {f : ℕ ↪ V} {X Y : Finset (Finset ℕ)} {S : List (ℕ × ℕ)} (hC : SurgCtx K f X Y S) :
                Disjoint K (liftK f Y)

                The replacement is disjoint from the surface.

                theorem Lightlike.Surfaces.SurgCtx.disj_X {V : Type u_1} [DecidableEq V] {K : Finset (Finset V)} {f : ℕ ↪ V} {X Y : Finset (Finset ℕ)} {S : List (ℕ × ℕ)} (hC : SurgCtx K f X Y S) :
                Disjoint (surg K f X Y) (liftK f X)

                The result is disjoint from the removed region.

                theorem Lightlike.Surfaces.SurgCtx.union_eq {V : Type u_1} [DecidableEq V] {K : Finset (Finset V)} {f : ℕ ↪ V} {X Y : Finset (Finset ℕ)} {S : List (ℕ × ℕ)} (hC : SurgCtx K f X Y S) :
                surg K f X Y ∪ liftK f X = K ∪ liftK f Y

                Result plus region equals surface plus replacement.

                theorem Lightlike.Surfaces.cnt_union {V : Type u_1} [DecidableEq V] {A B : Finset (Finset V)} (h : Disjoint A B) (e : Finset V) :
                cnt (A ∪ B) e = cnt A e + cnt B e

                Triangle counts add over a disjoint union.

                theorem Lightlike.Surfaces.cnt_mono {V : Type u_1} [DecidableEq V] {A B : Finset (Finset V)} (h : A ⊆ B) (e : Finset V) :
                cnt A e ≤ cnt B e

                Triangle counts grow with the complex.

                theorem Lightlike.Surfaces.SurgCtx.cnt_eq {V : Type u_1} [DecidableEq V] {K : Finset (Finset V)} {f : ℕ ↪ V} {X Y : Finset (Finset ℕ)} {S : List (ℕ × ℕ)} (hC : SurgCtx K f X Y S) (e : Finset V) :
                cnt (surg K f X Y) e + cnt (liftK f X) e = cnt K e + cnt (liftK f Y) e

                Triangle counts at an edge: result plus region equals surface plus replacement.

                theorem Lightlike.Surfaces.SurgCtx.card_eq {V : Type u_1} [DecidableEq V] {K : Finset (Finset V)} {f : ℕ ↪ V} {X Y : Finset (Finset ℕ)} {S : List (ℕ × ℕ)} (hC : SurgCtx K f X Y S) :
                (surg K f X Y).card + (liftK f X).card = K.card + (liftK f Y).card

                Triangle numbers: result plus region equals surface plus replacement.

                theorem Lightlike.Surfaces.cnt_zero_of_notMem {V : Type u_1} [DecidableEq V] {f : ℕ ↪ V} {Y Z : Finset (Finset ℕ)} (hZ : PR.verts2 Z ⊆ PR.verts2 Y) {x y : V} (h : (¬∃ p ∈ PR.verts2 Y, f p = x) ∨ ¬∃ q ∈ PR.verts2 Y, f q = y) :
                cnt (liftK f Z) {x, y} = 0

                An edge with an end outside the image of Y lies in no relabelled triangle of Z.

                theorem Lightlike.Surfaces.SurgCtx.cnt_class {V : Type u_1} [DecidableEq V] {K : Finset (Finset V)} {f : ℕ ↪ V} {X Y : Finset (Finset ℕ)} {S : List (ℕ × ℕ)} (hC : SurgCtx K f X Y S) (hok : SurgOK X Y S) {e : Finset V} (he : e.card = 2) :
                cnt (liftK f X) e = 0 ∧ cnt (liftK f Y) e = 0 ∨ cnt (liftK f X) e = cnt (liftK f Y) e ∨ cnt (liftK f X) e = 2 ∧ cnt (liftK f Y) e = 0 ∨ cnt (liftK f X) e = 0 ∧ cnt (liftK f Y) e = 2 ∧ cnt K e = 0

                The four ways an edge can meet the region and its replacement.

                theorem Lightlike.Surfaces.SurgCtx.isClosed2 {V : Type u_1} [DecidableEq V] {K : Finset (Finset V)} {f : ℕ ↪ V} {X Y : Finset (Finset ℕ)} {S : List (ℕ × ℕ)} (hC : SurgCtx K f X Y S) (hok : SurgOK X Y S) (hK : PR.IsClosed2 K) :
                PR.IsClosed2 (surg K f X Y)

                The result of a checked surgery on a closed complex is closed.

                theorem Lightlike.Surfaces.isTri2_surg {V : Type u_1} [DecidableEq V] {K : Finset (Finset V)} {f : ℕ ↪ V} {X Y : Finset (Finset ℕ)} (hK : PR.IsTri2 K) (hY3 : ∀ t ∈ Y, t.card = 3) :
                PR.IsTri2 (surg K f X Y)

                The result of a surgery has triangles only.

                theorem Lightlike.Surfaces.SurgCtx.isLinkConn {V : Type u_1} [DecidableEq V] {K : Finset (Finset V)} {f : ℕ ↪ V} {X Y : Finset (Finset ℕ)} {S : List (ℕ × ℕ)} (hC : SurgCtx K f X Y S) (hok : SurgOK X Y S) (hK : IsSurface K) :

                Links in the result of a checked surgery on a surface are connected.

                theorem Lightlike.Surfaces.rtg_pair_symm {V : Type u_1} [DecidableEq V] {M : Finset (Finset V)} {a b : V} (h : Relation.ReflTransGen (fun (x y : V) => {x, y} ∈ M) a b) :
                Relation.ReflTransGen (fun (x y : V) => {x, y} ∈ M) b a

                Paths along the edges of an edge set can be reversed.

                theorem Lightlike.Surfaces.SurgCtx.isConnected2 {V : Type u_1} [DecidableEq V] {K : Finset (Finset V)} {f : ℕ ↪ V} {X Y : Finset (Finset ℕ)} {S : List (ℕ × ℕ)} (hC : SurgCtx K f X Y S) (hok : SurgOK X Y S) (hK : IsSurface K) (hconn : ∀ m₁ ∈ PR.verts2 Y, ∀ m₂ ∈ PR.verts2 Y, Relation.ReflTransGen (fun (x y : V) => {x, y} ∈ PR.edges2 (surg K f X Y)) (f m₁) (f m₂)) :

                The result of a checked surgery on a surface is connected, provided the labels of Y are joined to each other in it.

                theorem Lightlike.Surfaces.IsSurface.surgery {V : Type u_1} [DecidableEq V] {K : Finset (Finset V)} {f : ℕ ↪ V} {X Y : Finset (Finset ℕ)} {S : List (ℕ × ℕ)} (hK : IsSurface K) (hC : SurgCtx K f X Y S) (hok : SurgOK X Y S) (hconn : ∀ m₁ ∈ PR.verts2 Y, ∀ m₂ ∈ PR.verts2 Y, Relation.ReflTransGen (fun (x y : V) => {x, y} ∈ PR.edges2 (surg K f X Y)) (f m₁) (f m₂)) :
                IsSurface (surg K f X Y)

                Checked surgery. Replacing a region X of a surface K by Y, under the template conditions SurgOK and the placement conditions SurgCtx, gives a surface, provided the labels of Y are joined to each other in the result.

                theorem Lightlike.Surfaces.hconn_of_reach {V : Type u_1} [DecidableEq V] {f : ℕ ↪ V} {Y : Finset (Finset ℕ)} {M : Finset (Finset V)} (hYM : liftK f Y ⊆ M) {a : ℕ} (h : ∀ m ∈ PR.verts2 Y, m ∈ reachAll (PR.edges2 Y) a) (m₁ : ℕ) :
                m₁ ∈ PR.verts2 Y → ∀ m₂ ∈ PR.verts2 Y, Relation.ReflTransGen (fun (x y : V) => {x, y} ∈ PR.edges2 M) (f m₁) (f m₂)

                The connectivity hypothesis of IsSurface.surgery holds when Y itself is connected (every label of Y is reached from one label along the edges of Y).

                The Euler characteristic #

                theorem Lightlike.Surfaces.verts2_mono {V : Type u_1} [DecidableEq V] {A B : Finset (Finset V)} (h : A ⊆ B) :

                Vertices grow with the complex.

                Edges of a union.

                Relabelling does not change the Euler characteristic.

                theorem Lightlike.Surfaces.SurgCtx.euler2_surg {V : Type u_1} [DecidableEq V] {K : Finset (Finset V)} {f : ℕ ↪ V} {X Y : Finset (Finset ℕ)} {S : List (ℕ × ℕ)} (hC : SurgCtx K f X Y S) (hok : SurgOK X Y S) (hK : PR.IsClosed2 K) :

                The Euler characteristic under checked surgery: χ(result) = χ(K) − χ(X) + χ(Y).