Documentation

Complexity.Tactic.FirstOrder

Automation for first-order interpretations and reductions #

A first-order reduction through an explicit interpretation is proved by syntactic side conditions and a semantic argument. The tactics of this file prove the former and unfold the latter, so that a new reduction costs only its semantic argument.

Relation symbols inside the formulas of an interpretation should be written as terms of their declared type L.Relations n, such as Mathlib's Language.adj, rather than as bare constructors such as .adj, whose type is the inductive type of symbols: simp cannot instantiate its lemmas at terms that are well typed only after unfolding the language. Patterns | .adj => … in the definition of the relations are unaffected.

Main definitions #

Implementation notes #

The simprocs unfold a projection of Interpretation or Projection only when its argument unfolds to a structure instance, and a relation definition only when the match on the relation symbol reduces, so they never expose auxiliary matchers; for quantifier-freeness, composites are unfolded too. Aesop's simplifier is disabled in fo_qf: the default simp set would rewrite the formulas whose shape the rules inspect. Relation symbols are split by a safe rule, as Aesop's normalisation rules may not produce several goals.

References #

The organization follows the polytime automation of Complexity.Tactic.PolyTime: an Aesop rule set declared in Complexity.Tactic.FirstOrder.Init and populated where lemmas are proved.

Unfold the domain formula of a concrete interpretation, other than a composite.

Instances For

    Unfold a relation definition of a concrete interpretation at a relation symbol, other than a composite.

    Instances For

      Unfold the numeric interpretation of a concrete projection, other than a composite.

      Instances For

        Unfold a relation definition of a concrete projection at a relation symbol, other than a composite.

        Instances For

          Quantifier-freeness #

          fo_qf proves that a formula, interpretation, projection formula or projection built from the usual constructors is quantifier-free, searching the Aesop rule set FirstOrder. It fails if it cannot close the goal.

          Instances For

            fo_iso_closed proves that a class of structures is closed under isomorphism from a lemma registered in the Aesop rule set FirstOrder or a hypothesis. It runs the same search as fo_qf and fails if it cannot close the goal.

            Instances For

              Realization #

              fo_simp simplifies with the simp set fo_realize, unfolding the realization of first-order formulas, projection formulas and the relations of interpreted structures, and the definitions of concrete interpretations and projections. fo_simp [h₁, h₂] at l adds simp lemmas and a location, as for simp only.

              Instances For

                Reductions #

                fo_reduction I proves a goal FO.QFReduces K K' or FO.Reduces K K' through the interpretation I, leaving the semantic statement, simplified by fo_simp:

                • ∀ M [Finite M], M ∈ K ↔ ⟨M, I.unitStructure M⟩ ∈ K', about the input universe itself, when I is one-dimensional, fo_simp proves that its domain formula holds of every element of every finite structure, and fo_iso_closed proves that K' is closed under isomorphism;
                • ∀ M [Finite M], M ∈ K ↔ ⟨ι → M, I.tupleStructure M⟩ ∈ K', about the full tuple domain, when I has coordinate type ι, fo_simp proves that its domain formula holds of every tuple of every finite structure, and fo_iso_closed proves that K' is closed under isomorphism;
                • ∀ M [Finite M], M ∈ K ↔ Bundled.of (I.Model M) ∈ K' otherwise.

                For FO.QFReduces, quantifier-freeness of I is proved by fo_qf, or left as a goal after the semantic one. fo_reduction I [h₁, h₂] passes simp lemmas, such as membership lemmas for K and K', to the simplification of the semantic goal; errors in them are reported, and a goal they do not change is left as it is. The interpretation is a single term; write fo_reduction (J.comp I) for a compound one. On a goal of another form, fo_reduction fails.

                Instances For