Draft — mutable and not usable as a dependency; its citation marks the draft state.

Lax17.Grid

Square grid graphs

concepts/Lax17/Grid.lean · lax-17

definition

Loading review…

Sign in with ORCID

Community review

Flags

Each flag is tied to a public ORCID identity and explains why this concept may be incorrect.

No flags have been submitted.

    Community review

    Flag this concept

    State precisely what appears incorrect. This explanation will be public under your ORCID name.

    No source line selected.

    Concept map

    Proven claimDefinitionThis conceptRelated conceptA → B: B builds on A

    Definition

    The square grid of order gg has vertex set {0,,g1}×{0,,g1}\{0,\ldots,g-1\}\times\{0,\ldots,g-1\}. Two vertices are adjacent when they agree in one coordinate and are consecutive in the other.

    The definition is the Cartesian box product of two copies of mathlib's finite path graph. Thus order zero gives the empty graph and order one gives a single isolated vertex.

    Lean source view on GitHub

    1import Mathlib.Combinatorics.SimpleGraph.Hasse
    2import Mathlib.Combinatorics.SimpleGraph.Prod
    3
    4/-!
    5---
    6title: Square grid graphs
    7type: definition
    8---
    9The square grid of order \(g\) has vertex set
    10\(\{0,\ldots,g-1\}\times\{0,\ldots,g-1\}\). Two vertices are adjacent when
    11they agree in one coordinate and are consecutive in the other.
    12
    13The definition is the Cartesian box product of two copies of mathlib's
    14finite path graph. Thus order zero gives the empty graph and order one gives
    15a single isolated vertex.
    16-/
    17
    18namespace Lax17.Grid
    19
    20/-- The canonical `g × g` square grid. -/
    21def squareGrid (g : ℕ) : SimpleGraph (Fin g × Fin g) :=
    22 SimpleGraph.pathGraph g □ SimpleGraph.pathGraph g
    23
    24end Lax17.Grid
    25

    Community review

    Discussion

    Ask a question or add context. Endorsements and structured flags are kept in the review panel above; your ORCID profile must share a public name.

    0 comments

    Loading discussion…