Documentation

Init.Omega.Constraint

A Constraint consists of an optional lower and upper bound (inclusive), constraining a value to a set of the form , {x}, [x, y], [x, ∞), (-∞, y], or (-∞, ∞).

@[inline, reducible]

An optional lower bound on a integer.

Equations
Instances For
    @[inline, reducible]

    An optional upper bound on a integer.

    Equations
    Instances For
      @[inline, reducible]

      A lower bound at x is satisfied at t if x ≤ t.

      Equations
      Instances For
        @[inline, reducible]

        A upper bound at y is satisfied at t if t ≤ y.

        Equations
        Instances For

          A Constraint consists of an optional lower and upper bound (inclusive), constraining a value to a set of the form , {x}, [x, y], [x, ∞), (-∞, y], or (-∞, ∞).

          Instances For
            Equations
            • One or more equations did not get rendered due to their size.

            A constraint is satisfied at t is both the lower bound and upper bound are satisfied.

            Equations
            Instances For

              Apply a function to both the lower bound and upper bound.

              Equations
              Instances For

                Flip a constraint. This operation is not useful by itself, but is used to implement neg and scale.

                Equations
                Instances For

                  Negate a constraint. [x, y] becomes [-y, -x].

                  Equations
                  Instances For

                    The trivial constraint, satisfied everywhere.

                    Equations
                    Instances For

                      The impossible constraint, unsatisfiable.

                      Equations
                      Instances For

                        An exact constraint.

                        Equations
                        Instances For

                          Check if a constraint is unsatisfiable.

                          Equations
                          Instances For

                            Check if a constraint requires an exact value.

                            Equations
                            Instances For

                              Scale a constraint by multiplying by an integer.

                              • If k = 0 this is either impossible, if the original constraint was impossible, or the = 0 exact constraint.
                              • If k is positive this takes [x, y] to [k * x, k * y]
                              • If k is negative this takes [x, y] to [k * y, k * x].
                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For

                                The sum of two constraints. [a, b] + [c, d] = [a + c, b + d].

                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  theorem Lean.Omega.Constraint.combo_sat {c₁ : Lean.Omega.Constraint} {c₂ : Lean.Omega.Constraint} {x₁ : Int} {x₂ : Int} (a : Int) (w₁ : Lean.Omega.Constraint.sat c₁ x₁ = true) (b : Int) (w₂ : Lean.Omega.Constraint.sat c₂ x₂ = true) :

                                  The conjunction of two constraints.

                                  Equations
                                  Instances For

                                    Dividing a constraint by a natural number, and tightened to integer bounds. Thus the lower bound is rounded up, and the upper bound is rounded down.

                                    Equations
                                    Instances For
                                      @[inline, reducible]

                                      It is convenient below to say that a constraint is satisfied at the dot product of two vectors, so we make an abbreviation sat' for this.

                                      Equations
                                      Instances For
                                        theorem Lean.Omega.Constraint.addInequality_sat {c : Int} {x : Lean.Omega.Coeffs} {y : Lean.Omega.Coeffs} (w : c + Lean.Omega.Coeffs.dot x y 0) :
                                        Lean.Omega.Constraint.sat' { lowerBound := some (-c), upperBound := none } x y = true
                                        theorem Lean.Omega.Constraint.addEquality_sat {c : Int} {x : Lean.Omega.Coeffs} {y : Lean.Omega.Coeffs} (w : c + Lean.Omega.Coeffs.dot x y = 0) :
                                        Lean.Omega.Constraint.sat' { lowerBound := some (-c), upperBound := some (-c) } x y = true

                                        Normalize a constraint, by dividing through by the GCD.

                                        Return none if there is nothing to do, to avoid adding unnecessary steps to the proof term.

                                        Equations
                                        • One or more equations did not get rendered due to their size.
                                        Instances For
                                          @[inline, reducible]

                                          Shorthand for the first component of normalize.

                                          Equations
                                          Instances For
                                            @[inline, reducible]

                                            Shorthand for the second component of normalize.

                                            Equations
                                            Instances For

                                              Multiply by -1 if the leading coefficient is negative, otherwise return none.

                                              Equations
                                              Instances For

                                                Multiply by -1 if the leading coefficient is negative, otherwise do nothing.

                                                Equations
                                                Instances For
                                                  @[inline, reducible]

                                                  Shorthand for the first component of positivize.

                                                  Equations
                                                  Instances For
                                                    @[inline, reducible]

                                                    Shorthand for the second component of positivize.

                                                    Equations
                                                    Instances For

                                                      positivize and normalize, returning none if neither does anything.

                                                      Equations
                                                      • One or more equations did not get rendered due to their size.
                                                      Instances For
                                                        @[inline, reducible]

                                                        Shorthand for the first component of tidy.

                                                        Equations
                                                        Instances For
                                                          @[inline, reducible]

                                                          Shorthand for the second component of tidy.

                                                          Equations
                                                          Instances For
                                                            @[inline, reducible]

                                                            The value of the new variable introduced when solving a hard equality.

                                                            Equations
                                                            Instances For

                                                              The coefficients of the new equation generated when solving a hard equality.

                                                              Equations
                                                              Instances For