Index of theproofnetwork/open-problems@860a535/Prove2Me/Definitions/Def_opg169_planar_dichromatic.lean

qedmarket’s copy of theproofnetwork/open-problems@860a535, 1 Dec 2026original source ↗

79 lines · 3.3 kBraw
/-From Prove2Me, definition `opg169_planar_dichromatic` (https://prove2.me/definitions/9a392f52-f2de-40b9-91c2-1d4164458bfe). Apache-2.0 per Prove2Me's terms.-/import Mathlib.Combinatorics.SimpleGraph.Finiteimport Mathlib.Data.Real.Basicimport Mathlib.Logic.Relationimport Mathlib.Data.Set.Card namespace OPG169 universe u abbrev Digraph (V : Type u) := V → V → Propabbrev Point := ℝ × ℝ def pointOnSegment (a b : Point) (t : ℝ) : Point :=  ((1 - t) * a.1 + t * b.1, (1 - t) * a.2 + t * b.2) def closedSegment (a b : Point) : Set Point :=  {x | ∃ t : ℝ, 0 ≤ t ∧ t ≤ 1 ∧ x = pointOnSegment a b t} /-- A straight-line planar embedding of the underlying simple graph. -/def IsPlanar {V : Type u} (G : SimpleGraph V) : Prop :=  ∃ p : V → Point,    Function.Injective p ∧    (∀ ⦃a b v : V⦄, G.Adj a b → v ≠ a → v ≠ b → p v ∉ closedSegment (p a) (p b)) ∧    (∀ ⦃a b c d : V⦄, G.Adj a b → G.Adj c d →      a ≠ c → a ≠ d → b ≠ c → b ≠ d →      Disjoint (closedSegment (p a) (p b)) (closedSegment (p c) (p d))) /-- `D` chooses exactly one direction for every edge of `G` and no arcs fornonedges. -/def IsOrientationOf {V : Type u} (D : Digraph V) (G : SimpleGraph V) : Prop :=  (∀ v : V, ¬ D v v) ∧  (∀ ⦃u v : V⦄, D u v → G.Adj u v) ∧  ∀ ⦃u v : V⦄, G.Adj u v →    (D u v ∨ D v u) ∧ ¬ (D u v ∧ D v u) /-- A list of at least two distinct vertices joined cyclically by directedarcs. In an orientation of a simple graph such a cycle necessarily has atleast three vertices. -/def IsDirectedCycle {V : Type u} (D : Digraph V) (vs : List V) : Prop :=  ∃ x y : V, ∃ middle : List V,    vs = x :: (middle ++ [y]) ∧ 3 ≤ vs.length ∧    vs.Nodup ∧ vs.IsChain D ∧ D y x  -- ported: `List.Chain'` is `List.IsChain` now /-- The vertices of one color induce an acyclic digraph. -/def ColorClassAcyclic {V : Type u} (D : Digraph V)    (color : V → Fin 2) (k : Fin 2) : Prop :=  ¬ ∃ vs : List V,    IsDirectedCycle D vs ∧ ∀ v ∈ vs, color v = k /-- A two-coloring in which both full induced color classes are acyclic.Either color may be unused. -/def IsAcyclicTwoColoring {V : Type u} (D : Digraph V)    (color : V → Fin 2) : Prop :=  ∀ k : Fin 2, ColorClassAcyclic D color k def HasAcyclicTwoColoring {V : Type u} (D : Digraph V) : Prop :=  ∃ color : V → Fin 2, IsAcyclicTwoColoring D color /-- Nonempty strong connectivity under directed reachability. -/def IsStronglyConnected {V : Type u} (D : Digraph V) : Prop :=  Nonempty V ∧ ∀ u v : V, Relation.ReflTransGen D u v /-- A counterexample of least vertex order among all finite planarorientations in the same universe. -/def IsLeastOrderCounterexample {V : Type u} [Fintype V]    (G : SimpleGraph V) (D : Digraph V) : Prop :=  IsPlanar G ∧ IsOrientationOf D G ∧ ¬ HasAcyclicTwoColoring D ∧  ∀ (W : Type u) [Fintype W] (H : SimpleGraph W) (E : Digraph W),    IsPlanar H → IsOrientationOf E H →    Fintype.card W < Fintype.card V → HasAcyclicTwoColoring E /-- Every vertex of the underlying graph has degree at least three. -/def HasMinimumDegreeThree {V : Type u} (G : SimpleGraph V) : Prop :=  ∀ v : V, 3 ≤ (G.neighborSet v).encard end OPG169

download (.tar)