The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V30. Combinatorics

Mathlib.Combinatorics.Optimization.ValuedCSP

27 declarations. Mathlib docs · Source

General-Valued Constraint Satisfaction Problems

General-Valued CSP is a very broad class of problems in discrete optimization. General-Valued CSP subsumes Min-Cost-Hom (including 3-SAT for example) and Finite-Valued CSP.

Main definitions

  • ValuedCSP: A VCSP template; fixes a domain, a codomain, and allowed cost functions.
  • ValuedCSP.Term: One summand in a VCSP instance; calls a concrete function from given template.
  • ValuedCSP.Term.evalSolution: An evaluation of the VCSP term for given solution.
  • ValuedCSP.Instance: An instance of a VCSP problem over given template.
  • ValuedCSP.Instance.evalSolution: An evaluation of the VCSP instance for given solution.
  • ValuedCSP.Instance.IsOptimumSolution: Is given solution a minimum of the VCSP instance?
  • Function.HasMaxCutProperty: Can given binary function express the Max-Cut problem?
  • FractionalOperation: Multiset of operations on given domain of the same arity.
  • FractionalOperation.IsSymmetricFractionalPolymorphismFor: Is given fractional operation a symmetric fractional polymorphism for given VCSP template?

References

  • [D. A. Cohen, M. C. Cooper, P. Creed, P. G. Jeavons, S. Živný, An Algebraic Theory of Complexity for Discrete Optimisation][cohen2012]

def ValuedCSP.Term.ctorIdx E1 #

{D : Type u_1} →
  {C : Type u_2} →
    {inst : AddCommMonoid C} →
      {inst_1 : PartialOrder C} → {inst_2 : IsOrderedAddMonoid C} → {Γ : ValuedCSP D C} → {ι : Type u_3} → Γ.Term ι → ℕ

theorem ValuedCSP.Term.mk.inj E1 #

∀ {D : Type u_1} {C : Type u_2} {inst : AddCommMonoid C} {inst_1 : PartialOrder C} {inst_2 : IsOrderedAddMonoid C}
  {Γ : ValuedCSP D C} {ι : Type u_3} {n : ℕ} {f : (Fin n → D) → C} {inΓ : ⟨n, f⟩ ∈ Γ} {app : Fin n → ι} {n_1 : ℕ}
  {f_1 : (Fin n_1 → D) → C} {inΓ_1 : ⟨n_1, f_1⟩ ∈ Γ} {app_1 : Fin n_1 → ι},
  { n := n, f := f, inΓ := inΓ, app := app } = { n := n_1, f := f_1, inΓ := inΓ_1, app := app_1 } →
    n = n_1 ∧ f ≍ f_1 ∧ app ≍ app_1

theorem ValuedCSP.Term.mk.injEq E0 #

∀ {D : Type u_1} {C : Type u_2} [inst : AddCommMonoid C] [inst_1 : PartialOrder C] [inst_2 : IsOrderedAddMonoid C]
  {Γ : ValuedCSP D C} {ι : Type u_3} (n : ℕ) (f : (Fin n → D) → C) (inΓ : ⟨n, f⟩ ∈ Γ) (app : Fin n → ι) (n_1 : ℕ)
  (f_1 : (Fin n_1 → D) → C) (inΓ_1 : ⟨n_1, f_1⟩ ∈ Γ) (app_1 : Fin n_1 → ι),
  ({ n := n, f := f, inΓ := inΓ, app := app } = { n := n_1, f := f_1, inΓ := inΓ_1, app := app_1 }) =
    (n = n_1 ∧ f ≍ f_1 ∧ app ≍ app_1)

abbrev ValuedCSP E3 #

Type u_1 →
  (C : Type u_2) → [inst : AddCommMonoid C] → [inst_1 : PartialOrder C] → [IsOrderedAddMonoid C] → Type (max u_1 u_2)

A template for a valued CSP problem over a domain D with costs in C. Regarding C we want to support Bool, Nat, ENat, Int, Rat, NNRat, Real, NNReal, EReal, ENNReal, and tuples made of any of those types.

structure ValuedCSP.Term E3 #

{D : Type u_1} →
  {C : Type u_2} →
    [inst : AddCommMonoid C] →
      [inst_1 : PartialOrder C] →
        [inst_2 : IsOrderedAddMonoid C] → ValuedCSP D C → Type u_3 → Type (max (max u_1 u_2) u_3)

A term in a valued CSP instance over the template Γ.

ctor ValuedCSP.Term.mk E0 #

{D : Type u_1} →
  {C : Type u_2} →
    [inst : AddCommMonoid C] →
      [inst_1 : PartialOrder C] →
        [inst_2 : IsOrderedAddMonoid C] →
          {Γ : ValuedCSP D C} → {ι : Type u_3} → (n : ℕ) → (f : (Fin n → D) → C) → ⟨n, f⟩ ∈ Γ → (Fin n → ι) → Γ.Term ι

abbrev ValuedCSP.Term.n E1 #

{D : Type u_1} →
  {C : Type u_2} →
    [inst : AddCommMonoid C] →
      [inst_1 : PartialOrder C] → [inst_2 : IsOrderedAddMonoid C] → {Γ : ValuedCSP D C} → {ι : Type u_3} → Γ.Term ι → ℕ

Arity of the function

abbrev ValuedCSP.Term.f E1 #

{D : Type u_1} →
  {C : Type u_2} →
    [inst : AddCommMonoid C] →
      [inst_1 : PartialOrder C] →
        [inst_2 : IsOrderedAddMonoid C] →
          {Γ : ValuedCSP D C} → {ι : Type u_3} → (self : Γ.Term ι) → (Fin self.n → D) → C

Which cost function is instantiated

theorem ValuedCSP.Term.inΓ E1 #

∀ {D : Type u_1} {C : Type u_2} [inst : AddCommMonoid C] [inst_1 : PartialOrder C] [inst_2 : IsOrderedAddMonoid C]
  {Γ : ValuedCSP D C} {ι : Type u_3} (self : Γ.Term ι), ⟨self.n, self.f⟩ ∈ Γ

The cost function comes from the template

abbrev ValuedCSP.Term.app E1 #

{D : Type u_1} →
  {C : Type u_2} →
    [inst : AddCommMonoid C] →
      [inst_1 : PartialOrder C] →
        [inst_2 : IsOrderedAddMonoid C] → {Γ : ValuedCSP D C} → {ι : Type u_3} → (self : Γ.Term ι) → Fin self.n → ι

Which variables are plugged as arguments to the cost function

def ValuedCSP.Term.evalSolution E3 #

{D : Type u_1} →
  {C : Type u_2} →
    [inst : AddCommMonoid C] →
      [inst_1 : PartialOrder C] →
        [inst_2 : IsOrderedAddMonoid C] → {Γ : ValuedCSP D C} → {ι : Type u_3} → Γ.Term ι → (ι → D) → C

Evaluation of a Γ term t for given solution x.

abbrev ValuedCSP.Instance E3 #

{D : Type u_1} →
  {C : Type u_2} →
    [inst : AddCommMonoid C] →
      [inst_1 : PartialOrder C] →
        [inst_2 : IsOrderedAddMonoid C] → ValuedCSP D C → Type u_3 → Type (max (max u_1 u_2) u_3)

A valued CSP instance over the template Γ with variables indexed by ι.

def ValuedCSP.Instance.evalSolution E3 #

{D : Type u_1} →
  {C : Type u_2} →
    [inst : AddCommMonoid C] →
      [inst_1 : PartialOrder C] →
        [inst_2 : IsOrderedAddMonoid C] → {Γ : ValuedCSP D C} → {ι : Type u_3} → Γ.Instance ι → (ι → D) → C

Evaluation of a Γ instance I for given solution x.

def ValuedCSP.Instance.IsOptimumSolution E3 #

{D : Type u_1} →
  {C : Type u_2} →
    [inst : AddCommMonoid C] →
      [inst_1 : PartialOrder C] →
        [inst_2 : IsOrderedAddMonoid C] → {Γ : ValuedCSP D C} → {ι : Type u_3} → Γ.Instance ι → (ι → D) → Prop

Condition for x being an optimum solution (min) to given Γ instance I.

def Function.HasMaxCutPropertyAt E1 #

{D : Type u_1} → {C : Type u_2} → [PartialOrder C] → ((Fin 2 → D) → C) → D → D → Prop

Function f has Max-Cut property at labels a and b when argmin f is exactly { ![a, b], ![b, a] }.

def Function.HasMaxCutProperty E3 #

{D : Type u_1} → {C : Type u_2} → [PartialOrder C] → ((Fin 2 → D) → C) → Prop

Function f has Max-Cut property at some two non-identical labels.

abbrev FractionalOperation E3 #

Type u_3 → ℕ → Type u_3

Fractional operation is a finite unordered collection of D^m → D possibly with duplicates.

def FractionalOperation.size E1 #

{D : Type u_1} → {m : ℕ} → FractionalOperation D m → ℕ

Arity of the "output" of the fractional operation.

def FractionalOperation.IsValid E1 #

{D : Type u_1} → {m : ℕ} → FractionalOperation D m → Prop

Fractional operation is valid iff nonempty.

theorem FractionalOperation.IsValid.contains E1 #

∀ {D : Type u_1} {m : ℕ} {ω : FractionalOperation D m}, ω.IsValid → ∃ g, g ∈ ω

Valid fractional operation contains an operation.

def FractionalOperation.tt E1 #

{D : Type u_1} → {m : ℕ} → {ι : Type u_3} → FractionalOperation D m → (Fin m → ι → D) → Multiset (ι → D)

Fractional operation applied to a transposed table of values.

def Function.AdmitsFractional E1 #

{D : Type u_1} →
  {C : Type u_2} → [AddCommMonoid C] → [PartialOrder C] → {m n : ℕ} → ((Fin n → D) → C) → FractionalOperation D m → Prop

Cost function admits given fractional operation, i.e., ω improves f in the ≤ sense.

def FractionalOperation.IsFractionalPolymorphismFor E1 #

{D : Type u_1} →
  {C : Type u_2} →
    [inst : AddCommMonoid C] →
      [inst_1 : PartialOrder C] →
        [inst_2 : IsOrderedAddMonoid C] → {m : ℕ} → FractionalOperation D m → ValuedCSP D C → Prop

Fractional operation is a fractional polymorphism for given VCSP template.

def FractionalOperation.IsSymmetric E1 #

{D : Type u_1} → {m : ℕ} → FractionalOperation D m → Prop

Fractional operation is symmetric.

def FractionalOperation.IsSymmetricFractionalPolymorphismFor E3 #

{D : Type u_1} →
  {C : Type u_2} →
    [inst : AddCommMonoid C] →
      [inst_1 : PartialOrder C] →
        [inst_2 : IsOrderedAddMonoid C] → {m : ℕ} → FractionalOperation D m → ValuedCSP D C → Prop

Fractional operation is a symmetric fractional polymorphism for given VCSP template.

theorem Function.HasMaxCutPropertyAt.rows_lt_aux E0 #

∀ {D : Type u_1} {C : Type u_3} [inst : PartialOrder C] {f : (Fin 2 → D) → C} {a b : D},
  Function.HasMaxCutPropertyAt f a b →
    a ≠ b →
      ∀ {ω : FractionalOperation D 2}, ω.IsSymmetric → ∀ {r : Fin 2 → D}, r ∈ ω.tt ![![a, b], ![b, a]] → f ![a, b] < f r

theorem Function.HasMaxCutProperty.forbids_commutativeFractionalPolymorphism E1 #

∀ {D : Type u_1} {C : Type u_3} [inst : AddCommMonoid C] [inst_1 : PartialOrder C] [IsOrderedCancelAddMonoid C]
  {f : (Fin 2 → D) → C},
  Function.HasMaxCutProperty f →
    ∀ {ω : FractionalOperation D 2}, ω.IsValid → ω.IsSymmetric → ¬Function.AdmitsFractional f ω