Documentation

TauCeti.KnotTheory.Grid.Rectangle.Basic

Rectangles in grid diagrams #

The grid lives on a torus, so the basic one-dimensional ingredient of a rectangle is the circular interval in Fin n. A grid rectangle carries two finite coordinate sets built from such intervals: its interior, the product of two open intervals, records the grid points strictly inside and is what a grid state must avoid for the rectangle to be empty; its coveredSquares, the product of two half-open intervals, records the region the rectangle covers and is what must avoid the O and X markings.

The final section packages an oriented rectangle from one grid state to another: two columns where the states exchange rows, and agreement everywhere else. This is the shape counted by the grid differential; the IsEmptyFor and AvoidsMarkings predicates record the two finite-set disjointness conditions used for empty rectangles and marking-avoiding rectangles.

AvoidsMarkings tests coveredSquares, so a marking counts as covered exactly when its square lies under the rectangle: marking indices are the southwest corners of square-centred markings, the convention the Maslov and Alexander gradings use. Rectangle/Squares.lean develops the covered squares further for the gradings.

Main definitions #

Main results #

References #

The encoding follows the toroidal grid-diagram convention from Ozsváth--Stipsicz--Szabó, Grid Homology for Knots and Links, Chapter 3. Rectangles connecting two grid states, Rect(x, y), and the empty ones among them, Rect°(x, y) (Definition 4.2.1), are in Chapter 4, Section 4.2; the marking-avoidance condition defining the fully blocked complex is in Section 4.4.

structure TauCeti.GridRectangle (n : ℕ) :

A toroidal grid rectangle, represented by its oriented column and row sides.

The interior is the product of the clockwise open interval from left to right with the clockwise open interval from bottom to top. Degenerate side choices are allowed at this level; their interiors are empty in the degenerate direction.

  • left : Fin n

    The initial vertical side of the rectangle.

  • right : Fin n

    The terminal vertical side of the rectangle.

  • bottom : Fin n

    The initial horizontal side of the rectangle.

  • top : Fin n

    The terminal horizontal side of the rectangle.

Instances For
    theorem TauCeti.GridRectangle.ext {n : ℕ} {x y : GridRectangle n} (left : x.left = y.left) (right : x.right = y.right) (bottom : x.bottom = y.bottom) (top : x.top = y.top) :
    x = y
    noncomputable def TauCeti.GridRectangle.columnInterior {n : ℕ} (R : GridRectangle n) :

    The columns strictly inside a toroidal grid rectangle.

    Instances For
      noncomputable def TauCeti.GridRectangle.rowInterior {n : ℕ} (R : GridRectangle n) :

      The rows strictly inside a toroidal grid rectangle.

      Instances For
        @[simp]

        Membership in the interior columns is membership in the corresponding open-open circular interval.

        @[simp]

        Membership in the interior rows is membership in the corresponding open-open circular interval.

        The left side is not an interior column.

        The right side is not an interior column.

        The bottom side is not an interior row.

        The top side is not an interior row.

        noncomputable def TauCeti.GridRectangle.interior {n : ℕ} (R : GridRectangle n) :

        The finite set of grid points strictly inside a toroidal grid rectangle.

        Instances For
          @[simp]

          Membership in a rectangle interior is membership in both one-dimensional open intervals.

          theorem TauCeti.GridRectangle.notMem_interior_of_fst_eq_left {n : ℕ} (R : GridRectangle n) {p : Fin n × Fin n} (hp : p.1 = R.left) :
          p ∉ R.interior

          A point on the initial side column is not in the interior.

          theorem TauCeti.GridRectangle.notMem_interior_of_fst_eq_right {n : ℕ} (R : GridRectangle n) {p : Fin n × Fin n} (hp : p.1 = R.right) :
          p ∉ R.interior

          A point on the terminal side column is not in the interior.

          @[simp]

          A rectangle has empty interior if its two column sides coincide.

          @[simp]

          A rectangle has empty interior if its two row sides coincide.

          @[simp]

          The number of interior grid points is the product of the numbers of interior columns and interior rows.

          In a grid of size at most two, every toroidal rectangle has empty interior.

          noncomputable def TauCeti.GridRectangle.coveredColumns {n : ℕ} (R : GridRectangle n) :

          The columns of squares a toroidal grid rectangle covers: the clockwise half-open arc from the initial vertical side to the terminal one. For distinct sides this is the initial side together with the strictly interior columns, each column of squares named by its initial grid line; for coincident sides it is empty.

          Instances For

            The covered columns are the half-open cyclic interval between the vertical sides.

            noncomputable def TauCeti.GridRectangle.coveredRows {n : ℕ} (R : GridRectangle n) :

            The rows of squares a toroidal grid rectangle covers: the clockwise half-open arc from the initial horizontal side to the terminal one. For distinct sides this is the initial side together with the strictly interior rows, each row of squares named by its initial grid line; for coincident sides it is empty.

            Instances For

              The covered rows are the half-open cyclic interval between the horizontal sides.

              @[simp]

              Membership in the covered columns is membership in the corresponding half-open circular interval.

              @[simp]

              Membership in the covered rows is membership in the corresponding half-open circular interval.

              noncomputable def TauCeti.GridRectangle.coveredSquares {n : ℕ} (R : GridRectangle n) :

              The finite set of squares a toroidal grid rectangle covers, each square named by its lower-left grid point, following the marking-coordinate convention documented with GridDiagram.OSet and GridDiagram.XSet.

              Where interior records the grid points strictly inside the rectangle — what a grid state must avoid for the rectangle to be empty — coveredSquares records the region the rectangle covers, which is what contains or avoids the O and X markings placed in the squares of a grid diagram: a marking sits at the centre of its square, so it lies inside the rectangle exactly when its column and row indices lie in the two half-open arcs. If either pair of sides coincides, the covered set is empty.

              Instances For

                The covered squares are the product of the covered columns and rows.

                @[simp]

                Membership in the covered squares is membership in both one-dimensional half-open arcs.

                A rectangle is empty for a grid state when the state has no point in its interior.

                Instances For
                  theorem TauCeti.GridRectangle.isEmptyFor_iff {n : ℕ} (R : GridRectangle n) (x : GridState n) :
                  R.IsEmptyFor x ↔ ∀ p ∈ x.pointSet, p ∉ R.interior

                  A rectangle is empty for a grid state exactly when no point of the state lies in its interior.

                  A rectangle is empty for a grid state exactly when the state sends every column strictly between its two side columns to a row outside the open arc between its two side rows.

                  This is the one-dimensional form of emptiness that the rectangle-pairing arguments for the grid differential use: it quantifies over columns rather than over grid points.

                  A rectangle whose terminal side is the cyclic successor of its initial side is empty for every grid state: no column lies strictly between two cyclically consecutive ones.

                  In a grid of size at most two, every toroidal rectangle is empty for every grid state.

                  theorem TauCeti.GridRectangle.isEmptyFor_of_eq_away {n : ℕ} (R : GridRectangle n) {u v : GridState n} (a b : Fin n) (ha : (a, u.toPerm a) ∉ R.interior) (hb : (b, u.toPerm b) ∉ R.interior) (haway : ∀ (p : Fin n × Fin n), p.1 ≠ a → p.1 ≠ b → p ∈ u.pointSet → p ∈ v.pointSet) (hv : R.IsEmptyFor v) :

                  Emptiness transfers between two grid states that agree away from two columns, once the two points of the first state on those columns are known to lie outside the interior: every other point of the first state is a point of the second.

                  A rectangle avoids the markings of a grid diagram when none of the squares it covers carries an O or X marking.

                  Instances For

                    A marking-avoiding rectangle covers no square carrying an O marking.

                    A marking-avoiding rectangle covers no square carrying an X marking.

                    A rectangle avoids markings exactly when neither the O nor the X marking set meets the squares it covers.

                    A rectangle avoids markings exactly when, in each column of squares it covers, neither the O marking nor the X marking of that column lies in a covered row.

                    @[simp]

                    Marking avoidance is unchanged by swapping the O and X markings, since it only refers to the union of the two marking sets.

                    The diagonal reflection of a toroidal rectangle, exchanging the two vertical sides with the two horizontal sides.

                    Reflecting across the main diagonal turns columns into rows and rows into columns, so the interior is reflected by Prod.swap.

                    Instances For
                      @[simp]

                      Reflecting a toroidal rectangle twice gives the original rectangle.

                      The interior of the reflected rectangle is the diagonal reflection of the original interior.

                      The squares covered by the reflected rectangle are the diagonal reflections of the squares covered by the original rectangle.

                      @[simp]

                      The diagonal reflection preserves emptiness: the reflected rectangle is empty for the reflected state exactly when the rectangle is empty for the state.

                      @[simp]

                      The diagonal reflection preserves marking avoidance: the reflected rectangle avoids the markings of the reflected diagram exactly when the rectangle avoids those of the diagram.

                      structure TauCeti.GridRectangleBetween {n : ℕ} (x y : GridState n) :

                      An oriented toroidal rectangle from one grid state to another.

                      The two states agree outside the two side columns, and in those side columns they exchange the two rows. Swapping left and right gives the other oriented rectangle from x to y on the same side columns (GridRectangleBetween.swapSides). The two side columns determine the rectangle (GridRectangleBetween.ext).

                      • left : Fin n

                        The initial vertical side.

                      • right : Fin n

                        The terminal vertical side.

                      • left_ne_right : self.left ≠ self.right

                        The two side columns are distinct.

                      • map_left : y.toPerm self.left = x.toPerm self.right

                        At the initial side, y uses the row that x uses at the terminal side.

                      • map_right : y.toPerm self.right = x.toPerm self.left

                        At the terminal side, y uses the row that x uses at the initial side.

                      • map_of_ne (c : Fin n) : c ≠ self.left → c ≠ self.right → y.toPerm c = x.toPerm c

                        Away from the side columns, the two states agree.

                      Instances For
                        theorem TauCeti.GridRectangleBetween.ext_iff {n : ℕ} {x y : GridState n} {x✝ y✝ : GridRectangleBetween x y} :
                        x✝ = y✝ ↔ x✝.left = y✝.left ∧ x✝.right = y✝.right
                        theorem TauCeti.GridRectangleBetween.ext {n : ℕ} {x y : GridState n} {x✝ y✝ : GridRectangleBetween x y} (left : x✝.left = y✝.left) (right : x✝.right = y✝.right) :
                        x✝ = y✝

                        The unordered finite set of side columns of an oriented grid rectangle.

                        Instances For
                          @[simp]

                          Membership in the side-column set of an oriented grid rectangle.

                          @[simp]

                          An oriented grid rectangle has exactly two side columns.

                          A rectangle between two grid states is determined by its two side columns.

                          A rectangle between two fixed grid states is determined by its initial side column alone: the exchange condition y R.left = x R.right fixes the terminal one.

                          @[instance_reducible]

                          An oriented rectangle between two grid states has decidable equality: it is determined by its ordered pair of side columns, which has decidable equality.

                          @[instance_reducible]

                          For fixed source and target grid states, the oriented rectangles between them form a finite type: a rectangle is its ordered pair of side columns, and the pairs that occur form a decidable subset of Fin n × Fin n. The instance is computable, so decide can count rectangles on a concrete grid.

                          The row of x on the initial side.

                          Instances For

                            The row of x on the terminal side.

                            Instances For

                              The initial horizontal side is the row occupied by the source state in the initial column.

                              The terminal horizontal side is the row occupied by the source state in the terminal column.

                              The toroidal rectangle of an oriented rectangle: it has the same two side columns, and its bottom and top sides are the rows the source state occupies in the initial and terminal side columns.

                              Instances For
                                theorem TauCeti.GridRectangleBetween.toGridRectangle_eq {n : ℕ} {x y : GridState n} (R : GridRectangleBetween x y) :
                                R.toGridRectangle = { left := R.left, right := R.right, bottom := x.toPerm R.left, top := x.toPerm R.right }

                                The associated toroidal rectangle in terms of the two side columns: its two horizontal sides are the rows the source state assigns to them.

                                Membership in the covered columns of the rectangle underlying a rectangle between states is membership in the half-open cyclic interval between its side columns.

                                A rectangle between states whose terminal column lies strictly inside the cyclic interval from its initial column to the rotation of a covers only columns of that interval, and misses both a and its rotation.

                                Membership in the interior of an oriented rectangle is membership in the open cyclic intervals between its side columns and the corresponding source-state rows.

                                Membership in the covered squares of an oriented rectangle is membership in the half-open cyclic intervals between its side columns and the corresponding source-state rows.

                                The covered squares of an oriented rectangle, read through its target state: the rows it covers run from the target-state row at its terminal side to the target-state row at its initial side.

                                The two side rows of a rectangle between states are distinct.

                                A rectangle between grid states has distinct source and target states. A self-rectangle would force the source state's permutation to take the same value on the two distinct side columns.

                                There are no rectangles from a grid state to itself.

                                The initial lower corner is a point of the source state.

                                The associated rectangle covers its initial lower square.

                                The terminal upper corner is a point of the source state.

                                The initial upper corner is a point of the target state.

                                The terminal lower corner is a point of the target state.

                                theorem TauCeti.GridRectangleBetween.mem_target_pointSet_iff_of_ne {n : ℕ} {x y : GridState n} (R : GridRectangleBetween x y) {p : Fin n × Fin n} (hleft : p.1 ≠ R.left) (hright : p.1 ≠ R.right) :

                                Away from the two side columns, membership in the source and target states is identical.

                                The associated rectangle is empty for the source state when no source-state point lies in its interior.

                                Instances For

                                  Emptiness of an oriented rectangle is emptiness of its underlying toroidal rectangle for the source state.

                                  The finite set of empty oriented rectangles from x to y.

                                  Instances For
                                    @[simp]

                                    Membership in the finite set of empty rectangles is exactly the emptiness predicate.

                                    In grid size at most two, every oriented rectangle between grid states is empty.

                                    In grid size at most two, the empty rectangles are all oriented rectangles.

                                    @[simp]

                                    There are no empty rectangles from a grid state to itself.

                                    The source state has no point in the interior of an empty rectangle between states.

                                    A rectangle between states is empty exactly when no source-state point lies in its interior.

                                    A rectangle between states is empty exactly when the source state sends every column strictly between its two side columns to a row outside the open arc between its two side rows.

                                    This is the one-dimensional form of emptiness that the rectangle-pairing arguments for the grid differential use: it quantifies over columns rather than over grid points.

                                    A rectangle between states whose terminal side is the cyclic successor of its initial side is empty: no column lies strictly between two cyclically consecutive ones.

                                    A rectangle between states is empty exactly when no target-state point lies in its interior.

                                    The target state has no point in the interior of an empty rectangle between states.

                                    A rectangle between states is empty exactly when the target state sends every column strictly between its two side columns to a row outside the open arc between its two side rows, read through the target state: from its row at the terminal side to its row at the initial side.

                                    This is isEmpty_iff_forall_notMem_cIoo for rectangles into a distinguished target state.

                                    The associated rectangle avoids a grid diagram's markings when none of the squares it covers carries a marking.

                                    Instances For

                                      A rectangle between states avoids markings exactly when neither marking set meets the squares it covers.

                                      A marking-avoiding rectangle between states covers no square carrying an O marking.

                                      A marking-avoiding rectangle between states covers no square carrying an X marking.

                                      The diagonal reflection of an oriented rectangle from x to y, an oriented rectangle from x.transpose to y.transpose.

                                      Reflecting across the main diagonal exchanges the side columns with the side rows: the new side columns are the two rows x R.left and x R.right that R connects.

                                      Instances For
                                        @[simp]

                                        The reflected rectangle's initial side row is the original initial side column.

                                        @[simp]

                                        The reflected rectangle's terminal side row is the original terminal side column.

                                        @[simp]

                                        The associated toroidal rectangle of the reflected oriented rectangle is the reflection of the associated toroidal rectangle.

                                        The oriented rectangle from x to y obtained by exchanging the two side columns.

                                        It connects the same two states x and y -- the two states still exchange rows at the two side columns and agree elsewhere -- but runs along the complementary column arc and the complementary row arc. Cutting the torus along the two side columns and the two side rows, R and R.swapSides are diagonally opposite pieces; the other two pieces lie in neither. This is not the opposite rectangle symm, which runs from y back to x.

                                        Instances For
                                          @[simp]

                                          The side-swapped rectangle's initial side column is the original terminal side column.

                                          @[simp]

                                          The side-swapped rectangle's terminal side column is the original initial side column.

                                          @[simp]

                                          The side-swapped rectangle's bottom row is the original top row.

                                          @[simp]

                                          The side-swapped rectangle's top row is the original bottom row.

                                          @[simp]
                                          theorem TauCeti.GridRectangleBetween.swapSides_toGridRectangle {n : ℕ} {x y : GridState n} (R : GridRectangleBetween x y) :
                                          R.swapSides.toGridRectangle = { left := R.right, right := R.left, bottom := R.top, top := R.bottom }

                                          The toroidal rectangle of the side-swapped oriented rectangle, written out by its four sides.

                                          @[simp]

                                          Exchanging the two side columns twice gives the original rectangle.

                                          Exchanging the two side columns gives a genuinely different rectangle, since the two side columns are distinct.

                                          @[simp]

                                          Reflecting an oriented rectangle twice gives the original rectangle.

                                          The diagonal reflection as an equivalence between oriented rectangles from x to y and oriented rectangles from x.transpose to y.transpose. Since reflecting twice is the identity, transpose is its own inverse.

                                          Instances For
                                            @[simp]

                                            The transpose equivalence applies a rectangle by reflecting it.

                                            @[simp]

                                            The inverse of the transpose equivalence is again reflection.

                                            The diagonal reflection is injective on oriented rectangles.

                                            @[simp]

                                            Two oriented rectangles have equal diagonal reflections exactly when they are equal.

                                            @[simp]

                                            The diagonal reflection preserves emptiness of a rectangle between grid states.

                                            @[simp]

                                            The diagonal reflection preserves marking avoidance of a rectangle between grid states: the reflected rectangle avoids the markings of the reflected diagram exactly when the rectangle avoids those of the diagram.

                                            @[simp]

                                            Swapping the O and X markings preserves marking avoidance of a rectangle between grid states.