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

#BIS and #PP2DNF

Lax859101.CountingBipartite · concepts/Lax859101/CountingBipartite.lean · lax-859101

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

    A bipartite graph is given with its bipartition, a mark on the left side, and its edges, read from left to right. #BIS counts the independent sets: the sets of vertices with no edge from a left member to a right member. #PP2DNF counts the models of the partitioned positive 2-DNF formula of the graph, with one variable per vertex and one term x∧yx \wedge y per edge from xx to yy: the sets of vertices containing both ends of some edge.

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

    Lean source view on GitHub

    1import Mathlib.Data.Set.Card
    2import Mathlib.Algebra.BigOperators.Ring.Finset
    3import Mathlib.Algebra.Order.BigOperators.Group.Finset
    4import Mathlib.Data.Fintype.BigOperators
    5import Mathlib.SetTheory.Cardinal.Finite
    6import Mathlib.Algebra.Group.Action.Defs
    7import Mathlib.Tactic.Ring
    8import Mathlib.ModelTheory.Graph
    9import Mathlib.Order.PiLex
    10import Mathlib.Data.Prod.Lex
    11import Mathlib.Data.Fintype.EquivFin
    12import Mathlib.ModelTheory.Order
    13import Mathlib.ModelTheory.Semantics
    14import Mathlib.ModelTheory.Complexity
    15import Mathlib.Tactic.FinCases
    16import Mathlib.Logic.Equiv.Fin.Basic
    17import Mathlib.Data.Fintype.Lattice
    18import Mathlib.Data.Finite.Sigma
    19import Mathlib.Order.Lattice.Nat
    20import Mathlib.Data.Fintype.Pigeonhole
    21import Mathlib.Dynamics.FixedPoints.Basic
    22import Mathlib.ModelTheory.Syntax
    23import Mathlib.Data.Fintype.Card
    24import Mathlib.Logic.Equiv.Prod
    25import Mathlib.Data.Set.Finite.Lemmas
    26import Mathlib.Data.Fintype.Sort
    27import Mathlib.Order.Hom.Set
    28import Lax366625.CountingProblems
    29
    30/-!
    31---
    32title: #BIS and #PP2DNF
    33type: definition
    34---
    35A bipartite graph is given with its bipartition, a mark on the left side,
    36and its edges, read from left to right. #BIS counts the independent sets:
    37the sets of vertices with no edge from a left member to a right member.
    38#PP2DNF counts the models of the partitioned positive 2-DNF formula of the
    39graph, with one variable per vertex and one term x∧yx \wedge y per edge from
    40xx to yy: the sets of vertices containing both ends of some edge.
    41-/
    42
    43namespace Lax859101.CountingBipartite
    44
    45open FirstOrder
    46
    47open FirstOrder.Language
    48
    49/-- The relation symbols of the language. -/
    50inductive bipGraphRel : ℕ → Type where
    51/-- `left a`: the vertex `a` is on the left side. -/
    52 | left : bipGraphRel 1
    53/-- `edge a b`: there is an edge between `a` and `b`; read for `a` on the
    54 left and `b` on the right. -/
    55 | edge : bipGraphRel 2
    56 deriving DecidableEq
    57
    58/-- The relational language of bipartite graphs given with their bipartition. -/
    59def bipGraph : FirstOrder.Language :=
    60 ⟨fun _ => Empty, bipGraphRel⟩
    61
    62instance instIsRelationalBipGraph : FirstOrder.Language.IsRelational bipGraph := fun _ =>
    63 (inferInstance : IsEmpty Empty)
    64
    65/-- `left a`: the vertex `a` is on the left side. -/
    66abbrev bgLeft : bipGraph.Relations 1 :=
    67 .left
    68
    69/-- `edge a b`: there is an edge between `a` and `b`; read for `a` on the
    70 left and `b` on the right. -/
    71abbrev bgEdge : bipGraph.Relations 2 :=
    72 .edge
    73
    74open FirstOrder
    75
    76open Language Structure
    77
    78section Shorthands
    79
    80variable {A : Type} [bipGraph.Structure A]
    81
    82/-- `left a`: the vertex `a` is on the left side. -/
    83def BGLeft {A : Type} [bipGraph.Structure A] (a0 : A) : Prop :=
    84 FirstOrder.Language.Structure.RelMap bgLeft ![a0]
    85
    86/-- `edge a b`: there is an edge between `a` and `b`; read for `a` on the
    87left and `b` on the right. -/
    88def BGEdge {A : Type} [bipGraph.Structure A] (a0 : A) (a1 : A) : Prop :=
    89 FirstOrder.Language.Structure.RelMap bgEdge ![a0, a1]
    90
    91end Shorthands
    92
    93/-- The set `S` is independent in a bipartite graph: no edge goes from a left
    94member of `S` to a right member of `S`. -/
    95def BipIndep (A : Type) [bipGraph.Structure A] (S : A → Prop) : Prop :=
    96 ∀ x y : A, S x → S y → BGLeft x → ¬BGLeft y → ¬BGEdge x y
    97
    98/-- The set `S` of true variables satisfies the partitioned positive 2-DNF
    99formula of a bipartite graph – one variable per vertex, one term `x ∧ y` per
    100edge from a left vertex `x` to a right vertex `y`: some term has both its
    101variables true. -/
    102def Pp2dnfModel (A : Type) [bipGraph.Structure A] (S : A → Prop) : Prop :=
    103 ∃ x y : A, S x ∧ S y ∧ BGLeft x ∧ ¬BGLeft y ∧ BGEdge x y
    104
    105open Lax366625.CountingProblems
    106
    107/-- **#BIS**, as a counting problem. -/
    108noncomputable def SharpBIS : CountingProblem Lax859101.CountingBipartite.bipGraph :=
    109 CountingProblem.ofFun fun A _ =>
    110 Nat.card {S : A → Prop // BipIndep A S}
    111
    112/-- **#PP2DNF**, as a counting problem. -/
    113noncomputable def SharpPP2DNF : CountingProblem Lax859101.CountingBipartite.bipGraph :=
    114 CountingProblem.ofFun fun A _ =>
    115 Nat.card {S : A → Prop // Pp2dnfModel A S}
    116
    117end Lax859101.CountingBipartite
    118

    Discussion

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

    Loading discussion…