Documentation

Lean.Meta.Tactic.Grind.Arith.CommRing.RingM

  • ringId : Nat
  • checkCoeffDvd : Bool

    If checkCoeffDvd is true, then when using a polynomial k*m - p to simplify .. + k'*m*m_2 + ..., the substitution is performed IF

    • k divides k', OR
    • Ring implements NoNatZeroDivisors.

    We need this check when simplifying disequalities. In this case, if we perform the simplification anyway, we may end up with a proof that k * q = 0, but we cannot deduce q = 0 since the ring does not implement NoNatZeroDivisors See comment at PolyDerivation.

    We also need it when destructively simplifying equations, i.e., when replacing an equation with its simplified form (EqCnstr.simplify and EqCnstr.simplifyBasis): the rewrite multiplies the equation by k₁ = k/gcd k k', and the result is weaker than the original equation when k₁ ≠ ±1. See Note at EqCnstr.simplify.

Instances For
    @[reducible, inline]

    We don't want to keep carrying the RingId around.

    Instances For
      @[reducible, inline]
      abbrev Lean.Meta.Grind.Arith.CommRing.RingM.run {α : Type} (ringId : Nat) (x : RingM α) :
      Instances For
        @[reducible, inline]
        Instances For

          The Sym.Arith classification record of the current ring.

          Instances For

            The per-goal solver state of the current ring.

            Instances For
              @[reducible, inline]
              Instances For

                Returns some c if the current ring has a nonzero characteristic c.

                Instances For

                  Returns some (charInst, c) if the current ring has a nonzero characteristic c.

                  Instances For

                    Returns true if the current ring satisfies the property

                    ∀ (k : Nat) (a : α), k ≠ 0 → OfNat.ofNat (α := α) k * a = 0 → a = 0
                    
                    Instances For

                      Returns true if the current ring has a IsCharP instance.

                      Instances For

                        Returns the pair (charInst, c). If the ring does not have a IsCharP instance, then throws internal error.

                        Instances For
                          Instances
                            @[instance_reducible]

                            Every term reified by the ring solver has been internalized, together with its subterms, before reification: the internalize hook runs after the core has created the ENodes of a term and its arguments, and solver-built terms are internalized where they are built.

                            The numeral 1 of the current ring, internalized as a ring term of the current goal. The term is cached in the Sym.Arith record and thus shared by all goals, but internalization is per goal. The term may already be known to the core (e.g., as a subterm of a product) without having been registered by the ring solver, so the check is against the ring's own denote map.

                            Instances For