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

Subtractive reductions

Lax859101.SubtractiveReductions · concepts/Lax859101/SubtractiveReductions.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 strong subtractive reduction from CC to DD, after Durand, Hermann, and Kolaitis, presents DD as the witness count of a kernel and draws two instances of DD from an instance AA of CC by two first-order interpretations with the same tags and dimension, a subtrahend and a minuend, such that every witness at the subtrahend is a witness at the minuend and C(A)+D(Is(A))=D(Im(A))C(A) + D(I_s(A)) = D(I_m(A)). Subtractive reducibility is a finite chain of strong subtractive and relativized ordered parsimonious steps. A counting problem is hard for a class when every member of the class subtractively reduces to it, and complete when it is moreover a member.

    Concept map
    8 concepts; 13 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 Lax366625.CountingProblems
    20import Lax366625.WitnessCounting
    21import Lax904597.Interpretations
    22import Lax904597.SecondOrder
    23import Lax366625.CountingClasses
    24
    25/-!
    26---
    27title: Subtractive reductions
    28type: definition
    29---
    30A strong subtractive reduction from CC to DD, after Durand, Hermann, and
    31Kolaitis, presents DD as the witness count of a kernel and draws two
    32instances of DD from an instance AA of CC by two first-order
    33interpretations with the same tags and dimension, a subtrahend and a
    34minuend, such that every witness at the subtrahend is a witness at the
    35minuend and C(A)+D(Is(A))=D(Im(A))C(A) + D(I_s(A)) = D(I_m(A)). Subtractive reducibility is a
    36finite chain of strong subtractive and relativized ordered parsimonious
    37steps. A counting problem is hard for a class when every member of the class
    38subtractively reduces to it, and complete when it is moreover a member.
    39-/
    40
    41namespace Lax859101.SubtractiveReductions
    42
    43open Lax366625.CountingProblems Lax366625.WitnessCounting Lax904597.Interpretations
    44open Lax904597.SecondOrder
    45
    46open FirstOrder
    47
    48open Language Structure
    49
    50variable {L L' : Language.{0, 0}}
    51
    52open FirstOrder
    53
    54open Language Structure BoundedFormula
    55
    56section LexFormulas
    57
    58variable {L : Language.{0, 0}}
    59
    60/-- `x = y`, as a formula over the ordered expansion. -/
    61def oEqF {α : Type} (x y : α) : (L.sum Language.order).Formula α :=
    62 Term.equal (Term.var x) (Term.var y)
    63
    64/-- `x ≤ y`, as a formula over the ordered expansion. -/
    65def oLeF {α : Type} (x y : α) : (L.sum Language.order).Formula α :=
    66 Relations.formula₂ leSymb (Term.var x) (Term.var y)
    67
    68/-- `x < y`, as a formula over the ordered expansion. -/
    69def oLtF {α : Type} (x y : α) : (L.sum Language.order).Formula α :=
    70 oLeF x y ⊓ ∼(oEqF x y)
    71
    72variable {A : Type} [L.Structure A] [LinearOrder A] {α : Type} {v : α → A}
    73
    74variable (L) in
    75/-- Lexicographic comparison of two `d`-tuples (the two arguments of a binary
    76relation), as a formula over the ordered expansion. -/
    77noncomputable def lexTupleLeF (d : ℕ) : (L.sum Language.order).Formula (Fin 2 × Fin d) :=
    78 (Formula.iInf fun i : Fin d => oEqF (0, i) (1, i)) ⊔
    79 Formula.iSup fun j : Fin d =>
    80 (Formula.iInf fun i : {i : Fin d // i < j} => oEqF (0, i.1) (1, i.1)) ⊓
    81 oLtF (0, j) (1, j)
    82
    83open Classical in
    84variable (L) in
    85/-- The full lexicographic comparison of tagged tuples, as a formula over the
    86ordered expansion: the tags are compared statically. -/
    87noncomputable def lexLeF {Tag : Type} [LinearOrder Tag] (d : ℕ) (t₁ t₂ : Tag) :
    88 (L.sum Language.order).Formula (Fin 2 × Fin d) :=
    89 if t₁ = t₂ then lexTupleLeF L d else if t₁ < t₂ then ⊤ else ⊥
    90
    91end LexFormulas
    92
    93section OrdExtend
    94
    95variable {L₁ L₂ : Language.{0, 0}} [L₂.IsRelational]
    96
    97variable {T : Type} [LinearOrder T] {d : ℕ}
    98
    99/-- Extension of an interpretation over an ordered base to one whose target
    100carries the order vocabulary, interpreted by the lexicographic order on
    101tagged tuples. -/
    102noncomputable def FOInterpretation.ordExtend
    103 (I : FOInterpretation (L₁.sum Language.order) L₂ T d) :
    104 FOInterpretation (L₁.sum Language.order) (L₂.sum Language.order) T d where
    105 relFormula {n} R :=
    106 match n, R with
    107 | _, Sum.inl r => I.relFormula r
    108 | _, Sum.inr .le => fun t => lexLeF L₁ d (t 0) (t 1)
    109
    110end OrdExtend
    111
    112section WitAt
    113
    114variable [L'.IsRelational] {Tag : Type} [LinearOrder Tag] {dim : ℕ}
    115
    116/-- The assignment `ρ` is a witness of the kernel `φ` at the instance drawn by
    117the interpretation `I`, ordered lexicographically. The universe of that
    118instance is `Tag × A ^ dim` whatever `I` is, so the witnesses at two
    119interpretations with the same tags and dimension are comparable. -/
    120def FOInterpretation.WitAt (I : FOInterpretation (L.sum Language.order) L' Tag dim)
    121 (B : SOBlock) (φ : ((L'.sum Language.order).sum B.lang).Sentence) (A : Type)
    122 [L.Structure A] [LinearOrder A] (ρ : B.Assignment (Tag × (Fin dim → A))) : Prop :=
    123 @Sentence.Realize ((L'.sum Language.order).sum B.lang) ((FOInterpretation.ordExtend I).Map A)
    124 (@sumStructure (L'.sum Language.order) B.lang ((FOInterpretation.ordExtend I).Map A)
    125 (FOInterpretation.mapStructure (FOInterpretation.ordExtend I) A)
    126 (B.structure ρ)) φ
    127
    128end WitAt
    129
    130/-- A **strong subtractive reduction**: the target is presented as the witness
    131count of a kernel, two interpretations with the same tags and dimension draw a
    132subtrahend and a minuend, every witness at the first is a witness at the
    133second, and the count of the source is the difference of the two counts. -/
    134structure StrongSubtractiveReduction [L.IsRelational] [L'.IsRelational]
    135 (C : CountingProblem L) (D : CountingProblem L') where
    136 /-- The tags used by the two interpretations. -/
    137 Tag : Type
    138 /-- Tags are finite, so that finite structures map to finite structures. -/
    139 [tagFinite : Finite Tag]
    140 /-- Tags are nonempty, so that nonempty structures map to nonempty ones. -/
    141 [tagNonempty : Nonempty Tag]
    142 /-- Tags are linearly ordered: the order of the drawn instances is the
    143 lexicographic one. -/
    144 [tagOrder : LinearOrder Tag]
    145 /-- The dimension of the two interpretations. -/
    146 dim : ℕ
    147 /-- The second-order block of the presentation of the target. -/
    148 block : SOBlock
    149 /-- The first-order kernel of the presentation of the target. -/
    150 kernel : ((L'.sum Language.order).sum block.lang).Sentence
    151 /-- The target counts the witnesses of its presentation, whatever the linear
    152 order. -/
    153 present : ∀ (A : Type) [L'.Structure A] [LinearOrder A] [Finite A] [Nonempty A],
    154 D A = witnessCount block kernel A
    155 /-- The interpretation drawing the subtrahend. -/
    156 subtrahend : FOInterpretation (L.sum Language.order) L' Tag dim
    157 /-- The interpretation drawing the minuend. -/
    158 minuend : FOInterpretation (L.sum Language.order) L' Tag dim
    159 /-- Every witness at the subtrahend is a witness at the minuend. -/
    160 witness_le : ∀ (A : Type) [L.Structure A] [LinearOrder A] [Finite A] [Nonempty A]
    161 (ρ : block.Assignment (Tag × (Fin dim → A))),
    162 FOInterpretation.WitAt subtrahend block kernel A ρ →
    163 FOInterpretation.WitAt minuend block kernel A ρ
    164 /-- The count of the source and the count at the subtrahend add up to the
    165 count at the minuend. -/
    166 correct : ∀ (A : Type) [L.Structure A] [LinearOrder A] [Finite A] [Nonempty A],
    167 C A + D (subtrahend.Map A) = D (minuend.Map A)
    168
    169/-- **Subtractive reducibility**, `C ≤ˢ D`: a finite chain of steps, each a
    170strong subtractive reduction or a relativized ordered parsimonious
    171reduction. -/
    172inductive SubtractiveReducible : ∀ {L L' : Language.{0, 0}} [L.IsRelational] [L'.IsRelational],
    173 CountingProblem L → CountingProblem L' → Prop
    174 /-- The empty chain. -/
    175 | refl {L : Language.{0, 0}} [L.IsRelational] (C : CountingProblem L) :
    176 SubtractiveReducible C C
    177 /-- A strong subtractive step, then a chain. -/
    178 | strong {L₁ L₂ L₃ : Language.{0, 0}} [L₁.IsRelational] [L₂.IsRelational]
    179 [L₃.IsRelational] {C : CountingProblem L₁} {D : CountingProblem L₂}
    180 {E : CountingProblem L₃} (f : StrongSubtractiveReduction C D)
    181 (h : SubtractiveReducible D E) : SubtractiveReducible C E
    182 /-- A parsimonious step, then a chain. -/
    183 | parsimonious {L₁ L₂ L₃ : Language.{0, 0}} [L₁.IsRelational] [L₂.IsRelational]
    184 [L₃.IsRelational] {C : CountingProblem L₁} {D : CountingProblem L₂}
    185 {E : CountingProblem L₃} (f : RelOrderedParsimoniousReduction C D)
    186 (h : SubtractiveReducible D E) : SubtractiveReducible C E
    187
    188open Lax366625.CountingProblems Lax366625.CountingClasses
    189
    190/-- A counting problem is **hard** for a class when every problem of the class
    191reduces to it by a subtractive reduction. -/
    192def SubtractiveHard (K : CountingClass) {L : Language.{0, 0}} [L.IsRelational]
    193 (C : CountingProblem L) : Prop :=
    194 ∀ {L'' : Language.{0, 0}} [L''.IsRelational] (D : CountingProblem L''),
    195 K.Mem D → SubtractiveReducible D C
    196
    197/-- A counting problem is **complete** for a class when it belongs to it and is
    198hard for it, under subtractive reductions. -/
    199def SubtractiveComplete (K : CountingClass) {L : Language.{0, 0}} [L.IsRelational]
    200 (C : CountingProblem L) : Prop :=
    201 K.Mem C ∧ SubtractiveHard K C
    202
    203end Lax859101.SubtractiveReductions
    204

    Discussion

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

    Loading discussion…