Documentation

Complexity.Foundations.Geometry.Orthogonal.Subdivision

Unit subdivision of finite orthogonal routes #

Main definitions #

Main results #

References #

The unit-walk construction and bounded enumeration are original.

The k+1 lattice points obtained by taking k copies of vector d from a.

Instances For
    @[simp]
    theorem Cslib.Orthogonal.walk_length (a d : Point) (k : ℕ) :
    List.length (walk a d k) = k + 1

    One more listed point than steps.

    @[simp]
    theorem Cslib.Orthogonal.walk_head (a d : Point) (k : ℕ) :
    List.head? (walk a d k) = some a

    The walk always starts at its prescribed first point.

    @[simp]
    theorem Cslib.Orthogonal.walk_last (a d : Point) (k : ℕ) :
    List.getLast? (walk a d k) = some (a + k • d)

    The walk ends after precisely k copies of the step vector.

    A step vector in one of the four cardinal unit directions.

    Instances For
      theorem Cslib.Orthogonal.support_walk (a d : Point) (k : ℕ) (hd : UnitVector d) :
      support (walk a d k) = segment a (a + k • d)

      Cardinal walks cover exactly the original continuous segment.

      theorem Cslib.Orthogonal.walk_step {a d : Point} {k : ℕ} {e : Point × Point} (he : e ∈ List.consecutivePairs (walk a d k)) :
      e.2 = e.1 + d

      Every consecutive pair in a repeated walk is exactly one prescribed step.

      theorem Cslib.Orthogonal.length_add_unit (a d : Point) (hd : UnitVector d) :
      length a (a + d) = 1

      Cardinal steps have Manhattan length one.

      theorem Cslib.Orthogonal.walk_unit {a d : Point} {k : ℕ} (hd : UnitVector d) {e : Point × Point} (he : e ∈ List.consecutivePairs (walk a d k)) :
      length e.1 e.2 = 1

      Every consecutive pair of a cardinal walk is unit-adjacent.

      theorem Cslib.Orthogonal.wireLength_walk (a d : Point) (k : ℕ) (hd : UnitVector d) :
      wireLength (walk a d k) = k

      A k-step cardinal walk has exactly k units of wire.

      Cardinal direction from a toward b; equal points use an arbitrary unit direction.

      Instances For

        The chosen direction is always a cardinal unit vector.

        theorem Cslib.Orthogonal.add_length_direction {a b : Point} (h : a.1 = b.1 ∨ a.2 = b.2) :
        a + length a b • direction a b = b

        An axis-aligned displacement is its Manhattan length times its chosen unit direction.

        Unit subdivision of one segment, including both endpoints.

        Instances For
          @[simp]

          Segment subdivision uses exactly one more point than its Manhattan length.

          @[simp]

          Segment subdivision preserves the first endpoint.

          theorem Cslib.Orthogonal.segmentWalk_last {a b : Point} (h : a.1 = b.1 ∨ a.2 = b.2) :

          Segment subdivision preserves the last endpoint of every axis-aligned segment.

          theorem Cslib.Orthogonal.support_segmentWalk {a b : Point} (h : a.1 = b.1 ∨ a.2 = b.2) :

          The subdivision covers the entire original real segment, without adding points.

          Each subdivided segment has unit Manhattan length.

          Segment subdivision preserves wire length exactly.

          Joining routes at a common endpoint, listing that endpoint once, concatenates their segment lists.

          Joining routes at their common endpoint takes the union of their full real supports.

          A route joined at a common endpoint has the last endpoint of the second route.

          Joining at a common endpoint adds the two Manhattan wire lengths.

          Replace each consecutive segment by its unit walk, retaining a shared endpoint once.

          Instances For
            @[simp]

            Subdivision preserves the first listed point, including the empty-route convention.

            The exact point count is wire length plus one for a nonempty route.

            Subdivision preserves the final endpoint of an orthogonal route.

            Subdivision preserves the complete real support of every orthogonal route.

            Every consecutive pair in the subdivided orthogonal route is a unit grid step.

            Unit subdivision preserves total Manhattan wire length exactly.

            Unit subdivision is itself a proper orthogonal route.

            theorem Cslib.Orthogonal.walk_eq_map_range (a d : Point) (k : ℕ) :
            walk a d k = List.map (fun (i : ℕ) => a + i • d) (List.range (k + 1))

            The recursive walk is also an explicit range enumeration.

            theorem Cslib.Orthogonal.walk_dropLast_eq_map_range (a d : Point) (k : ℕ) :
            List.dropLast (walk a d k) = List.map (fun (i : ℕ) => a + i • d) (List.range k)

            Omitting the final endpoint gives exactly the strict prefix of the range enumeration.

            A flat enumeration of the unit subdivision: emit each segment without its last point, then emit the route's final endpoint. This form supports bounded polynomial-time implementations.

            Enumerate at most budget strict unit-prefix points per listed segment, then the last endpoint. The result agrees with subdivide when every segment fits in the budget.

            Instances For
              theorem Cslib.Orthogonal.subdivideWithin_eq_subdivide {r : Route} (hr : IsOrthogonal r) {budget : ℕ} (hbudget : ∀ e ∈ List.consecutivePairs r, length e.1 e.2 ≤ budget) :

              A sufficient per-segment budget recovers the complete geometric subdivision.

              Bounded enumeration emits at most budget points per segment, plus the last endpoint.

              Each listed segment's length is bounded by the route's total wire length.

              theorem Cslib.Orthogonal.subdivideWithin_eq_of_wireLength_le {r : Route} (hr : IsOrthogonal r) {budget : ℕ} (hbudget : wireLength r ≤ budget) :

              A bound for the whole route's wire length is a sufficient subdivision budget.

              theorem Cslib.Orthogonal.walk_nodup (a d : Point) (k : ℕ) (hd : UnitVector d) :

              A cardinal walk never repeats a lattice point.

              The unit walk along one segment has no repeated listed point.

              theorem Cslib.Orthogonal.mem_support_segment {r : Route} (hlen : 2 ≤ List.length r) {p : ℝ × ℝ} (hp : p ∈ support r) :
              ∃ e ∈ List.consecutivePairs r, p ∈ segment e.1 e.2

              Every supported point of a route with at least two listed points belongs to one of its consecutive segments. In this case separate degenerate pieces for listed points are redundant.

              theorem Cslib.Orthogonal.first_segment_tail_contact {a b : Point} {r : Route} (hs : IsSimple (a :: b :: r)) {p : ℝ × ℝ} (hp : p ∈ segment a b) (hq : p ∈ support (b :: r)) :

              The first segment of a continuously simple route meets its tail only at their common listed endpoint.

              Unit subdivision of a continuously simple orthogonal route has no repeated lattice points. The proof uses the original segments' endpoint-contact certificates, not support equality alone.

              theorem Cslib.Orthogonal.subdivideWithin_nodup {r : Route} (hr : IsOrthogonal r) (hs : IsSimple r) {budget : ℕ} (hbudget : wireLength r ≤ budget) :

              A sufficient-budget native enumeration also has no repeated points on a simple route.