The non-dependent runtime image of a coloured graph, so elaboration-time
meta code can evaluate closed Colored n k terms without knowing n and
k at compile time.
- n : Nat
The number of vertices.
- k : Nat
The number of colours.
- rows : Array (Nauty.VSet self.n)
The packed adjacency rows.
The colour of each vertex.
Instances For
The logical limits of one graph_iso call.
- maxSearchNodes : Nat
Nodes the compiled search may visit per graph, both for the witness search and for the certificate producer.
- maxCertRecords : Nat
Certificate records per graph the kernel replays. Exceeding it abandons the certificate route, not the tactic.
- maxKernelSteps : Nat
Instances For
Elaborate the (field := value) limits of one graph_iso call.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Run the nauty-compatible canonical search on a runtime graph.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The untrusted elaboration-time search: compare canonical forms and
compose the two canonical labels into a forward transporter. Returns the
transporter, or none for non-isomorphic inputs, together with the total
node count.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Build of_decide_eq_true (Eq.refl true) : p without reducing
decide p in the elaborator: the kernel performs the one decisive
evaluation when it checks the ascribed Eq.refl. mkDecideProof
evaluates twice, once at elaboration and once at kernel checking, which
doubles the cost of every replay.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The flat Bool literal of a raw graph's adjacency matrix, in row-major order.
Equations
- Hex.GraphIso.Tactic.rawFlat r = List.flatMap (fun (i : Nat) => List.map (fun (j : Nat) => r.rows[i]!.mem j) (List.range r.n)) (List.range r.n)
Instances For
A List Bool literal expression.
Equations
- Hex.GraphIso.Tactic.boolListLit bs = Lean.Meta.mkListLit (Lean.mkConst `Bool) (List.map (fun (bb : Bool) => Lean.mkConst (if bb = true then `Bool.true else `Bool.false)) bs)
Instances For
The expression e.graph.adjMatrix.data.toList for a coloured
graph expression e: the left-hand side of the flat-literal
equality.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The expression Kernel.packRows n e.graph.adjMatrix.data.toList:
the left-hand side of the packed-rows equality the negative routes
replay.
Equations
- Hex.GraphIso.Tactic.matrixPackedSide n e = do let __do_lift ← Hex.GraphIso.Tactic.matrixListSide e Lean.Meta.mkAppM `Hex.GraphIso.Kernel.packRows #[Lean.mkNatLit n, __do_lift]
Instances For
The packed rows of a runtime graph, row v at bits
[n * v, n * (v + 1)): the right-hand side of the packed-rows
equality.
Equations
- Hex.GraphIso.Tactic.rawPackedRows r = List.foldr (fun (v acc : Nat) => r.rows[v]!.toNat + acc <<< r.n) 0 (List.range r.n)
Instances For
One side of a negative goal: the graph expression, its runtime image, the packed-rows literal, and the proof that the graph's adjacency packs to that literal. Both negative routes replay against these, so each side is evaluated once per call.
- expr : Lean.Expr
The coloured graph expression.
- raw : Raw
Its runtime image.
- tie : Lean.Expr
- lit : Lean.Expr
The packed-rows literal.
Instances For
Evaluate a coloured graph expression and prove its packed rows equal to a literal, in one kernel evaluation of the graph's adjacency.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Reify a certificate tree as a literal expression.
Reify a literal canonical key as an expression.
Equations
- Hex.GraphIso.Tactic.keyExpr K = Lean.mkApp2 (Lean.mkConst `Hex.GraphIso.Kernel.Key.mk) (Lean.toExpr K.codes) (Lean.toExpr K.rows)
Instances For
Match Isomorphic G H (returning (false, n, k, G, H)) or
¬ Isomorphic G H (returning true first). Other goals give
none.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Match the uncoloured Graph.Isomorphic G H (returning
(false, n, G, H)) or its negation (returning true first). Other
goals give none.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The root-separator leg of the negative path. When the two root refinement codes already differ (the typical case for irregular pairs) the kernel evaluates one refinement per graph, so this leg is tried first on every negative goal.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The certificate leg of the negative path. Compiled code produces one
budgeted certificate per side and compares the two canonical keys. The
kernel then replays two Boolean Kernel.checkKey calls and one
checkDiffL call. When a limit runs out the result names that limit.
When the two keys agree this throws, because the goal is then not
provable.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Produce a proof of ¬ Isomorphic G H for closed executable coloured
graphs: the root separator first, then certificate replay. The
certificates replay only because every declaration they reach is
exposed across module boundaries, which HexGraphIso.ModuleBoundaryTests
checks. Both the Colored negative branch and downstream extensions use
this: HexGraphIsoMathlib calls it on the encoded graphs.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The witness leg of the positive path: prove each side's adjacency,
its colouring and the transporter equal to literals, then check the
transporter on those literals. Returns the permutation expression and
the proof of IsIso G H p. The Colored branch wraps that proof as
Isomorphic, and downstream extensions decode it.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A graph_iso goal handler contributed by a downstream library.
A public meta def of this type tagged @[graph_iso_extension]
extends the same graph_iso syntax to that library's goal shapes.
- prove? : Config → Lean.Expr → Lean.MetaM (Option Lean.Expr)
Handle a goal, returning its proof term, or
nonewhen the goal shape is not this extension's.
Instances For
The registered graph_iso extensions, in declaration order.
All extensions present in the current environment, in lookup order.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Prove a graph_iso goal over executable uncoloured graphs: colour
every vertex alike, hand the pair to proveGraphIso, and transport the
conclusion back through Graph.isomorphic_singleColor_iff. Both
directions of that equivalence are proof terms, so the uncoloured route
costs the kernel nothing beyond the coloured goal's replay and the one
0 < n decision.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Close a closed Isomorphic or ¬ Isomorphic goal over executable
graphs, coloured (Colored n k) or uncoloured (Graph n).
Three logical limits are optional and may appear in any order:
graph_iso (maxSearchNodes := 200000) (maxCertRecords := 200000)
(maxKernelSteps := 10000000)
They default to 100000, 100000, and 5000000. Importing HexGraphIsoMathlib
extends this same tactic to Mathlib SimpleGraph goals. See the module
docstring for the proof routes.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Elaborator for graph_iso: parse the optional limits, then dispatch to
proveGraphIso on the core Colored goal shapes, proveGraphIsoUncolored
on the Graph shapes, and then each registered Extension in turn.
Equations
- One or more equations did not get rendered due to their size.