While this submission is a draft, it cannot be used by other submissions.

Counting Hamilton circuits

Lax280166.CountingHamiltonCircuits · concepts/Lax280166/CountingHamiltonCircuits.lean · lax-280166

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.

    Natural Language Statement

    Definition

    On a finite directed graph, #Directed Hamilton Circuit counts the directed Hamilton circuits, each given by its successor relation: a relation along the arcs that is a single cycle through every vertex. #Hamilton Circuit counts the undirected Hamilton circuits of the symmetric closure, each given by its set of edges, so that a circuit and its reverse count once.

    Concept map
    10 concepts; 25 descendants hidden
    100%
    Proven claimDefinitionThis conceptRelated conceptA → B: B builds on A

    Lean source view on GitHub

    1import Mathlib.Tactic.FinCases
    2import Mathlib.Order.PiLex
    3import Mathlib.Data.Prod.Lex
    4import Mathlib.Data.Fintype.EquivFin
    5import Mathlib.ModelTheory.Order
    6import Mathlib.ModelTheory.Semantics
    7import Mathlib.ModelTheory.Complexity
    8import Mathlib.Logic.Equiv.Fin.Basic
    9import Mathlib.Data.Fintype.Lattice
    10import Mathlib.Data.Finite.Sigma
    11import Mathlib.Order.Lattice.Nat
    12import Mathlib.Data.Set.Card
    13import Mathlib.Data.Fintype.Pigeonhole
    14import Mathlib.Dynamics.FixedPoints.Basic
    15import Mathlib.ModelTheory.Syntax
    16import Mathlib.Algebra.Order.BigOperators.Group.Finset
    17import Mathlib.Data.Fintype.Card
    18import Mathlib.SetTheory.Cardinal.Finite
    19import Mathlib.Algebra.BigOperators.Finprod
    20import Mathlib.Data.Set.Finite.Lemmas
    21import Mathlib.Logic.Equiv.Prod
    22import Mathlib.Order.Fin.Basic
    23import Mathlib.Data.Fintype.Sort
    24import Mathlib.GroupTheory.Perm.Cycle.Basic
    25import Mathlib.GroupTheory.OrderOfElement
    26import Lax799700.Hamilton
    27import Lax904597.Machines
    28import Mathlib.SetTheory.Cardinal.Finite
    29import Lax366625.CountingProblems
    30
    31/-!
    32---
    33title: Counting Hamilton circuits
    34type: definition
    35---
    36On a finite directed graph, #Directed Hamilton Circuit counts the directed
    37Hamilton circuits, each given by its successor relation: a relation along
    38the arcs that is a single cycle through every vertex. #Hamilton Circuit
    39counts the undirected Hamilton circuits of the symmetric closure, each given
    40by its set of edges, so that a circuit and its reverse count once.
    41-/
    42
    43namespace Lax280166.CountingHamiltonCircuits
    44
    45open Lax799700.Hamilton Lax904597.Machines
    46
    47open FirstOrder
    48
    49open Language Structure
    50
    51section Circuit
    52
    53variable {A : Type}
    54
    55/-- `y` comes next after `x` on the circuit a linear order is a cut of: it is
    56the immediate successor of `x`, or `x` is the last element and `y` the
    57first. -/
    58def CycSucc (Le : A → A → Prop) (x y : A) : Prop :=
    59 SuccOf Le x y ∨ ((∀ z, Le z x) ∧ ∀ z, Le y z)
    60
    61/-- The relation `Nxt` is a Hamilton circuit of `R`: the cyclic successor
    62relation of a linear order of the universe, included in `R`. -/
    63def IsCircuit (R : A → A → Prop) (Nxt : A → A → Prop) : Prop :=
    64 ∃ Le : A → A → Prop, IsLinOrd Le ∧ (∀ x y, Nxt x y ↔ CycSucc Le x y) ∧
    65 ∀ x y, Nxt x y → R x y
    66
    67end Circuit
    68
    69section Problem
    70
    71variable (A : Type) [digraph.Structure A]
    72
    73/-- The relation `Nxt` is a Hamilton circuit of a finite digraph. -/
    74def DirCircuit (Nxt : A → A → Prop) : Prop :=
    75 Finite A ∧ IsCircuit (fun x y : A => DGArc x y) Nxt
    76
    77end Problem
    78
    79open FirstOrder
    80
    81open Language Structure
    82
    83section UCircuit
    84
    85variable {A : Type}
    86
    87/-- The relation `E` is the edge set of a Hamilton circuit of `R`: the
    88symmetric closure of a circuit of `R`. -/
    89def IsUCircuit (R : A → A → Prop) (E : A → A → Prop) : Prop :=
    90 ∃ Nxt : A → A → Prop, IsCircuit R Nxt ∧ ∀ x y, E x y ↔ (Nxt x y ∨ Nxt y x)
    91
    92end UCircuit
    93
    94section Problem
    95
    96variable (A : Type) [digraph.Structure A]
    97
    98/-- The relation `E` is the edge set of a Hamilton circuit of a finite
    99graph. -/
    100def UCircuit (E : A → A → Prop) : Prop :=
    101 Finite A ∧ IsUCircuit (fun x y : A => DGEdge x y) E
    102
    103end Problem
    104
    105open Lax366625.CountingProblems
    106
    107/-- **#Directed Hamilton Circuit**, as a counting problem. -/
    108noncomputable def SharpDirHamCircuit : CountingProblem Lax799700.Hamilton.digraph :=
    109 CountingProblem.ofFun fun A _ =>
    110 Nat.card {Nxt : A → A → Prop // DirCircuit A Nxt}
    111
    112/-- **#Hamilton Circuit**, as a counting problem. -/
    113noncomputable def SharpHamCircuit : CountingProblem Lax799700.Hamilton.digraph :=
    114 CountingProblem.ofFun fun A _ =>
    115 Nat.card {E : A → A → Prop // UCircuit A E}
    116
    117end Lax280166.CountingHamiltonCircuits
    118
    Builds on
    Used by
    From Mathlib

    Discussion

    Ask a question or add context. Endorsements and structured flags are kept in the review panel above.

    Loading discussion…