The areas / V34. The tactics of Mathlib
Mathlib.Tactic.Ring.Basic
62 declarations. Mathlib docs · Source
ring tactic
A tactic for solving equations in commutative (semi)rings, where the exponents can also contain variables. Based on http://www.cs.ru.nl/~freek/courses/tt-2014/read/10.1.1.61.3041.pdf .
More precisely, expressions of the following form are supported:
- constants (non-negative integers)
- variables
- coefficients (any rational number, embedded into the (semi)ring)
- addition of expressions
- multiplication of expressions (
a * b) - scalar multiplication of expressions (
n • a; the multiplier must have typeℕorℤ) - exponentiation of expressions (the exponent must have type
ℕ) - subtraction and negation of expressions (if the base is a full ring)
The extension to exponents means that something like 2 * 2^n * b = b * 2^(n+1) can be proved,
even though it is not strictly speaking an equation in the language of commutative rings.
Implementation notes
The basic approach to prove equalities is to normalise both sides and check for equality.
We use Mathlib.Tactic.Ring.Common to implement the normal forms and normalization procedure.
This file defines the evaluation of basic operations such as addition and multiplication of the
rational coefficients as embedded inside the (semi)ring. This is done using norm_num.
It further implements the core ring1 tactic.
Caveats and future work
The normalized form of an expression is the one that is useful for the tactic,
but not as nice to read. To remedy this, the user-facing normalization calls ringNFCore.
Subtraction cancels out identical terms, but division does not.
That is: a - a = 0 := by ring solves the goal,
but a / a := 1 by ring doesn't.
Note that 0 / 0 is generally defined to be 0,
so division cancelling out is not true in general.
Multiplication of powers can be simplified a little bit further:
2 ^ n * 2 ^ n = 4 ^ n := by ring could be implemented
in a similar way that 2 * a + 2 * a = 4 * a := by ring already works.
This feature wasn't needed yet, so it's not implemented yet.
Tags
ring, semiring, exponent, power
Scalar multiplication by ℕ
Scalar multiplication by ℤ
def Mathlib.Tactic.Ring.CSLift.ctorIdx E1 #
{α : Type u} → {β : outParam (Type u)} → Mathlib.Tactic.Ring.CSLift α β → ℕ
def Mathlib.Tactic.Ring.ExBase E1 #
{u : Lean.Level} → {α : Q(Type u)} → Q(CommSemiring «$α») → Q(«$α») → Type
ExBase BaseType sα e stores the structure of a normalized expression e, which appears
as the base of an exponent expression e^n. The sum constructor is only used when the exponent
n is not a constant.
def Mathlib.Tactic.Ring.ExProd E1 #
{u : Lean.Level} → {α : Q(Type u)} → Q(CommSemiring «$α») → Q(«$α») → Type
ExProd BaseType sα e stores the structure of a normalized monomial expression e.
A monomial here is a product of powers of ExBase expressions, terminated by a (nonzero) constant
coefficient. The data of the constant coefficient is stored in the BaseType.
def Mathlib.Tactic.Ring.ExSum E1 #
{u : Lean.Level} → {α : Q(Type u)} → Q(CommSemiring «$α») → Q(«$α») → Type
ExSum BaseType sα e stores the structure of a normalized polynomial expression e, which is
a sum of monomials.
theorem Mathlib.Tactic.Ring.cast_pos E1 #
∀ {R : Type u_1} [inst : CommSemiring R] {a : R} {n : ℕ}, Mathlib.Meta.NormNum.IsNat a n → a = n.rawCast + 0
theorem Mathlib.Tactic.Ring.cast_zero E1 #
∀ {R : Type u_1} [inst : CommSemiring R] {a : R}, Mathlib.Meta.NormNum.IsNat a 0 → a = 0
theorem Mathlib.Tactic.Ring.cast_neg E1 #
∀ {n : ℕ} {R : Type u_2} [inst : Ring R] {a : R},
Mathlib.Meta.NormNum.IsInt a (Int.negOfNat n) → a = (Int.negOfNat n).rawCast + 0
theorem Mathlib.Tactic.Ring.cast_nnrat E1 #
∀ {n d : ℕ} {R : Type u_2} [inst : DivisionSemiring R] {a : R},
Mathlib.Meta.NormNum.IsNNRat a n d → a = NNRat.rawCast n d + 0
theorem Mathlib.Tactic.Ring.cast_rat E1 #
∀ {n : ℤ} {d : ℕ} {R : Type u_2} [inst : DivisionRing R] {a : R},
Mathlib.Meta.NormNum.IsRat a n d → a = Rat.rawCast n d + 0
def Mathlib.Tactic.Ring.ExProd.mkNat E1 #
{u : Lean.Level} → {α : Q(Type u)} → (sα : Q(CommSemiring «$α»)) → ℕ → (e : Q(«$α»)) × Mathlib.Tactic.Ring.ExProd sα e
Constructs the expression corresponding to .const n.
(The .const constructor does not check that the expression is correct.)
def Mathlib.Tactic.Ring.ExProd.mkNegNat E1 #
{u : Lean.Level} →
{α : Q(Type u)} → (sα : Q(CommSemiring «$α»)) → Q(Ring «$α») → ℕ → (e : Q(«$α»)) × Mathlib.Tactic.Ring.ExProd sα e
Constructs the expression corresponding to .const (-n).
(The .const constructor does not check that the expression is correct.)
def Mathlib.Tactic.Ring.ExProd.mkNNRat E1 #
{u : Lean.Level} →
{α : Q(Type u)} →
(sα : Q(CommSemiring «$α»)) →
Q(DivisionSemiring «$α») → ℚ → Q(ℕ) → Q(ℕ) → Lean.Expr → (e : Q(«$α»)) × Mathlib.Tactic.Ring.ExProd sα e
Constructs the expression corresponding to .const q h for q = n / d
and h a proof that (d : α) ≠ 0.
(The .const constructor does not check that the expression is correct.)
def Mathlib.Tactic.Ring.ExProd.mkNegNNRat E1 #
{u : Lean.Level} →
{α : Q(Type u)} →
(sα : Q(CommSemiring «$α»)) →
Q(DivisionRing «$α») → ℚ → Q(ℕ) → Q(ℕ) → Lean.Expr → (e : Q(«$α»)) × Mathlib.Tactic.Ring.ExProd sα e
Constructs the expression corresponding to .const q h for q = -(n / d)
and h a proof that (d : α) ≠ 0.
(The .const constructor does not check that the expression is correct.)
def Mathlib.Tactic.Ring.evalCast E1 #
{u : Lean.Level} →
{α : Q(Type u)} →
(sα : Q(CommSemiring «$α»)) →
{e : Q(«$α»)} →
Mathlib.Meta.NormNum.Result e → Option (Mathlib.Tactic.Ring.Common.Result (Mathlib.Tactic.Ring.ExSum sα) e)
Converts a proof by norm_num that e is a numeral, into a normalization as a monomial:
e = 0ifnorm_numreturnsIsNat e 0e = Nat.rawCast n + 0ifnorm_numreturnsIsNat e ne = Int.rawCast n + 0ifnorm_numreturnsIsInt e ne = NNRat.rawCast n d + 0ifnorm_numreturnsIsNNRat e n de = Rat.rawCast n d + 0ifnorm_numreturnsIsRat e n d
theorem Mathlib.Tactic.Ring.natCast_nat E1 #
∀ {R : Type u_1} [inst : CommSemiring R] (n : ℕ), ↑n.rawCast = n.rawCast
theorem Mathlib.Tactic.Ring.natCast_mul E1 #
∀ {R : Type u_1} [inst : CommSemiring R] {b₁ b₃ : R} {a₁ a₃ : ℕ} (a₂ : ℕ),
↑a₁ = b₁ → ↑a₃ = b₃ → ↑(a₁ ^ a₂ * a₃) = b₁ ^ a₂ * b₃
theorem Mathlib.Tactic.Ring.natCast_zero E1 #
∀ {R : Type u_1} [inst : CommSemiring R], ↑0 = 0
theorem Mathlib.Tactic.Ring.natCast_add E1 #
∀ {R : Type u_1} [inst : CommSemiring R] {b₁ b₂ : R} {a₁ a₂ : ℕ}, ↑a₁ = b₁ → ↑a₂ = b₂ → ↑(a₁ + a₂) = b₁ + b₂
opaque Mathlib.Tactic.Ring.ExBase.evalNatCast E1 #
{u : Lean.Level} →
{α : Q(Type u)} →
(sα : Q(CommSemiring «$α»)) →
{v : Lean.Level} →
{β : Q(Type v)} →
(sβ : Q(CommSemiring «$β»)) →
{a : Q(ℕ)} →
Mathlib.Tactic.Ring.ExBase sβ a →
Mathlib.Tactic.AtomM (Mathlib.Tactic.Ring.Common.Result (Mathlib.Tactic.Ring.ExBase sα) q(↑«$a»))
Applies Nat.cast to a nat polynomial to produce a polynomial in α.
- An atom
ecauses↑eto be allocated as a new atom. - A sum delegates to
ExSum.evalNatCast.
opaque Mathlib.Tactic.Ring.ExProd.evalNatCast E1 #
{u : Lean.Level} →
{α : Q(Type u)} →
(sα : Q(CommSemiring «$α»)) →
{v : Lean.Level} →
{β : Q(Type v)} →
(sβ : Q(CommSemiring «$β»)) →
{a : Q(ℕ)} →
Mathlib.Tactic.Ring.ExProd sβ a →
Mathlib.Tactic.AtomM (Mathlib.Tactic.Ring.Common.Result (Mathlib.Tactic.Ring.ExProd sα) q(↑«$a»))
Applies Nat.cast to a nat monomial to produce a monomial in α.
↑c = cifcis a numeric literal↑(a ^ n * b) = ↑a ^ n * ↑b
opaque Mathlib.Tactic.Ring.ExSum.evalNatCast E1 #
{u : Lean.Level} →
{α : Q(Type u)} →
(sα : Q(CommSemiring «$α»)) →
{v : Lean.Level} →
{β : Q(Type v)} →
(sβ : Q(CommSemiring «$β»)) →
{a : Q(ℕ)} →
Mathlib.Tactic.Ring.ExSum sβ a →
Mathlib.Tactic.AtomM (Mathlib.Tactic.Ring.Common.Result (Mathlib.Tactic.Ring.ExSum sα) q(↑«$a»))
Applies Nat.cast to a nat polynomial to produce a polynomial in α.
↑0 = 0↑(a + b) = ↑a + ↑b
theorem Mathlib.Tactic.Ring.natCast_int E1 #
∀ {R : Type u_2} [inst : CommRing R] (n : ℕ), ↑n.rawCast = n.rawCast
theorem Mathlib.Tactic.Ring.intCast_negOfNat_Int E1 #
∀ {R : Type u_2} [inst : CommRing R] (n : ℕ), ↑(Int.negOfNat n).rawCast = (Int.negOfNat n).rawCast
theorem Mathlib.Tactic.Ring.intCast_mul E1 #
∀ {R : Type u_2} [inst : CommRing R] {b₁ b₃ : R} {a₁ a₃ : ℤ} (a₂ : ℕ),
↑a₁ = b₁ → ↑a₃ = b₃ → ↑(a₁ ^ a₂ * a₃) = b₁ ^ a₂ * b₃
theorem Mathlib.Tactic.Ring.intCast_zero E1 #
∀ {R : Type u_2} [inst : CommRing R], ↑0 = 0
theorem Mathlib.Tactic.Ring.intCast_add E1 #
∀ {R : Type u_2} [inst : CommRing R] {b₁ b₂ : R} {a₁ a₂ : ℤ}, ↑a₁ = b₁ → ↑a₂ = b₂ → ↑(a₁ + a₂) = b₁ + b₂
def Mathlib.Tactic.Ring.ExBase.evalIntCast E1 #
{u : Lean.Level} →
{α : Q(Type u)} →
(sα : Q(CommSemiring «$α»)) →
{v : Lean.Level} →
{β : Q(Type v)} →
(sβ : Q(CommSemiring «$β»)) →
{a : Q(ℤ)} →
(rα : Q(CommRing «$α»)) →
Mathlib.Tactic.Ring.ExBase sβ a →
Mathlib.Tactic.AtomM (Mathlib.Tactic.Ring.Common.Result (Mathlib.Tactic.Ring.ExBase sα) q(↑«$a»))
Applies Int.cast to an int polynomial to produce a polynomial in α.
- An atom
ecauses↑eto be allocated as a new atom. - A sum delegates to
ExSum.evalIntCast.
def Mathlib.Tactic.Ring.ExProd.evalIntCast E1 #
{u : Lean.Level} →
{α : Q(Type u)} →
(sα : Q(CommSemiring «$α»)) →
{v : Lean.Level} →
{β : Q(Type v)} →
(sβ : Q(CommSemiring «$β»)) →
{a : Q(ℤ)} →
(rα : Q(CommRing «$α»)) →
Mathlib.Tactic.Ring.ExProd sβ a →
Mathlib.Tactic.AtomM (Mathlib.Tactic.Ring.Common.Result (Mathlib.Tactic.Ring.ExProd sα) q(↑«$a»))
Applies Int.cast to an int monomial to produce a monomial in α.
↑c = cifcis a numeric literal↑(a ^ n * b) = ↑a ^ n * ↑b
def Mathlib.Tactic.Ring.ExSum.evalIntCast E1 #
{u : Lean.Level} →
{α : Q(Type u)} →
(sα : Q(CommSemiring «$α»)) →
{v : Lean.Level} →
{β : Q(Type v)} →
(sβ : Q(CommSemiring «$β»)) →
{a : Q(ℤ)} →
(rα : Q(CommRing «$α»)) →
Mathlib.Tactic.Ring.ExSum sβ a →
Mathlib.Tactic.AtomM (Mathlib.Tactic.Ring.Common.Result (Mathlib.Tactic.Ring.ExSum sα) q(↑«$a»))
Applies Int.cast to an int polynomial to produce a polynomial in α.
↑0 = 0↑(a + b) = ↑a + ↑b
def Mathlib.Tactic.Ring.ExBase.cast E1 #
{u : Lean.Level} →
{α : Q(Type u)} →
(sα : Q(CommSemiring «$α»)) →
{v : Lean.Level} →
{β : Q(Type v)} →
{sβ : Q(CommSemiring «$β»)} →
{a : Q(«$α»)} → Mathlib.Tactic.Ring.ExBase sα a → (a : Q(«$β»)) × Mathlib.Tactic.Ring.ExBase sβ a
Converts ExBase sα to ExBase sβ, assuming sα and sβ are defeq.
def Mathlib.Tactic.Ring.ExProd.cast E1 #
{u : Lean.Level} →
{α : Q(Type u)} →
(sα : Q(CommSemiring «$α»)) →
{v : Lean.Level} →
{β : Q(Type v)} →
{sβ : Q(CommSemiring «$β»)} →
{a : Q(«$α»)} → Mathlib.Tactic.Ring.ExProd sα a → (a : Q(«$β»)) × Mathlib.Tactic.Ring.ExProd sβ a
Converts ExProd sα to ExProd sβ, assuming sα and sβ are defeq.
def Mathlib.Tactic.Ring.ExSum.cast E1 #
{u : Lean.Level} →
{α : Q(Type u)} →
(sα : Q(CommSemiring «$α»)) →
{v : Lean.Level} →
{β : Q(Type v)} →
{sβ : Q(CommSemiring «$β»)} →
{a : Q(«$α»)} → Mathlib.Tactic.Ring.ExSum sα a → (a : Q(«$β»)) × Mathlib.Tactic.Ring.ExSum sβ a
Converts ExSum sα to ExSum sβ, assuming sα and sβ are defeq.
theorem Mathlib.Tactic.Ring.smul_eq_mul E1 #
∀ {α : Type u_2} [inst : Mul α] {a a' : α}, a = a' → ∀ (b : α), a • b = a' * b
theorem Mathlib.Tactic.Ring.Nat.smul_eq_mul E1 #
∀ {R : Type u_1} [inst : CommSemiring R] {n n' : ℕ} {r : R}, ↑n = r → n' = n → ∀ (a : R), n' • a = r * a
theorem Mathlib.Tactic.Ring.Int.smul_eq_mul E1 #
∀ {R : Type u_2} {n n' : ℤ} {r : R} [inst : CommRing R], ↑n = r → n' = n → ∀ (a : R), n' • a = r * a
def Mathlib.Tactic.Ring.RatCoeff.toResult E1 #
{u : Lean.Level} → {α : Q(Type u)} → {a : Q(«$α»)} → Mathlib.Tactic.Ring.RatCoeff a → Mathlib.Meta.NormNum.Result a
Turn coefficient data into a NormNum.Result.
def Mathlib.Tactic.Ring.RatCoeff.ofResult E1 #
{u : Lean.Level} →
{α : Q(Type u)} →
{a : Q(«$α»)} →
Mathlib.Meta.NormNum.Result a → Option (Mathlib.Tactic.Ring.Common.Result Mathlib.Tactic.Ring.RatCoeff a)
Turn a NormNum.Result into coefficient data.
def Mathlib.Tactic.Ring.RingCompute.add E1 #
{u : Lean.Level} →
{α : Q(Type u)} →
(sα : Q(CommSemiring «$α»)) →
{a b : Q(«$α»)} →
Mathlib.Tactic.Ring.RatCoeff a →
Mathlib.Tactic.Ring.RatCoeff b →
Lean.MetaM
(Mathlib.Tactic.Ring.Common.Result Mathlib.Tactic.Ring.RatCoeff q(«$a» + «$b») ×
Option Q(Mathlib.Meta.NormNum.IsNat («$a» + «$b») 0))
Add two rational number expressions. If the result is zero, returns a proof of this fact.
def Mathlib.Tactic.Ring.RingCompute.mul E1 #
{u : Lean.Level} →
{α : Q(Type u)} →
(sα : Q(CommSemiring «$α»)) →
{a b : Q(«$α»)} →
Mathlib.Tactic.Ring.RatCoeff a →
Mathlib.Tactic.Ring.RatCoeff b →
Lean.MetaM (Mathlib.Tactic.Ring.Common.Result Mathlib.Tactic.Ring.RatCoeff q(«$a» * «$b»))
Evaluate the product of two rational number expressions.
opaque Mathlib.Tactic.Ring.RingCompute.cast E1 #
{u : Lean.Level} →
{α : Q(Type u)} →
(sα : Q(CommSemiring «$α»)) →
Mathlib.Tactic.Ring.Common.Cache sα →
(v : Lean.Level) →
(β : Q(Type v)) →
Q(CommSemiring «$β») →
(_smul : Q(SMul «$β» «$α»)) →
(x : Q(«$β»)) →
Mathlib.Tactic.AtomM
((y : Q(«$α»)) ×
Mathlib.Tactic.Ring.Common.ExSum Mathlib.Tactic.Ring.RatCoeff sα q(«$y») ×
Q(∀ (a : «$α»), «$x» • a = «$y» * a))
Cast ℕ and ℤ normalized expressions ExSums into α, used to evaluate scalar multiplications.
def Mathlib.Tactic.Ring.RingCompute.neg E1 #
{u : Lean.Level} →
{α : Q(Type u)} →
{a : Q(«$α»)} →
(_crα : Q(CommRing «$α»)) →
Mathlib.Tactic.Ring.RatCoeff a →
Lean.MetaM (Mathlib.Tactic.Ring.Common.Result Mathlib.Tactic.Ring.RatCoeff q(-«$a»))
Negate rational number expressions.
def Mathlib.Tactic.Ring.RingCompute.pow E1 #
{u : Lean.Level} →
{α : Q(Type u)} →
(sα : Q(CommSemiring «$α»)) →
{a : Q(«$α»)} →
{b : Q(ℕ)} →
Mathlib.Tactic.Ring.RatCoeff a →
Mathlib.Tactic.Ring.Common.ExProdNat q(«$b») →
OptionT Lean.MetaM (Mathlib.Tactic.Ring.Common.Result Mathlib.Tactic.Ring.RatCoeff q(«$a» ^ «$b»))
Raise a rational number expression to the power of a natural number.
Fails if the exponent is not a literal.
def Mathlib.Tactic.Ring.RingCompute.inv E1 #
{u : Lean.Level} →
{α : Q(Type u)} →
(_sα : Q(CommSemiring «$α»)) →
{a : Q(«$α»)} →
Option Q(CharZero «$α») →
(_sfα : Q(Semifield «$α»)) →
Mathlib.Tactic.Ring.RatCoeff a →
Mathlib.Tactic.AtomM (Option (Mathlib.Tactic.Ring.Common.Result Mathlib.Tactic.Ring.RatCoeff q(«$a»⁻¹)))
Evaluate the inverse of a natural number expression.
def Mathlib.Tactic.Ring.RingCompute.derive E1 #
{u : Lean.Level} →
{α : Q(Type u)} →
(sα : Q(CommSemiring «$α»)) →
(x : Q(«$α»)) →
Lean.MetaM
(Mathlib.Tactic.Ring.Common.Result (Mathlib.Tactic.Ring.Common.ExSum Mathlib.Tactic.Ring.RatCoeff sα) q(«$x»))
Try to evaluate an expression as a rational constant using norm_num.
def Mathlib.Tactic.Ring.RingCompute.isOne E1 #
{u : Lean.Level} →
{α : Q(Type u)} →
(sα : Q(CommSemiring «$α»)) →
{x : Q(«$α»)} → Mathlib.Tactic.Ring.RatCoeff x → Option Q(Mathlib.Meta.NormNum.IsNat «$x» 1)
Decide if x is 1 and provide a proof if so.
def Mathlib.Tactic.Ring.ringCompare E1 #
{u : Lean.Level} → {α : Q(Type u)} → Mathlib.Tactic.Ring.Common.RingCompare Mathlib.Tactic.Ring.RatCoeff
The comparisons on the basetype used to compare normalized ring expressions.
opaque Mathlib.Tactic.Ring.ringCompute E1 #
{u : Lean.Level} →
{α : Q(Type u)} →
{sα : Q(CommSemiring «$α»)} →
Mathlib.Tactic.Ring.Common.Cache sα → Mathlib.Tactic.Ring.Common.RingCompute Mathlib.Tactic.Ring.RatCoeff sα
The data used by the ring tactic to normalize the constant coefficients.
def Mathlib.Tactic.Ring.rcℕ E1 #
Mathlib.Tactic.Ring.Common.RingCompute Mathlib.Tactic.Ring.Common.btℕ Mathlib.Tactic.Ring.Common.sℕ
The data used by ring-like tactics to normalize constant coefficients of natural number
expressions.
class Mathlib.Tactic.Ring.CSLift E1 #
Type u → outParam (Type u) → Type u
CSLift α β is a typeclass used by ring for lifting operations from α
(which is not a commutative semiring) into a commutative semiring β by using an injective map
lift : α → β.
ctor Mathlib.Tactic.Ring.CSLift.mk E0 #
{α : Type u} → {β : outParam (Type u)} → (lift : α → β) → Function.Injective lift → Mathlib.Tactic.Ring.CSLift α β
abbrev Mathlib.Tactic.Ring.CSLift.lift E1 #
{α : Type u} → {β : outParam (Type u)} → [self : Mathlib.Tactic.Ring.CSLift α β] → α → β
lift is the "canonical injection" from α to β
theorem Mathlib.Tactic.Ring.CSLift.inj E1 #
∀ {α : Type u} {β : outParam (Type u)} [self : Mathlib.Tactic.Ring.CSLift α β],
Function.Injective Mathlib.Tactic.Ring.CSLift.lift
lift is an injective function
class Mathlib.Tactic.Ring.CSLiftVal E1 #
{α : Type u} → {β : outParam (Type u)} → [Mathlib.Tactic.Ring.CSLift α β] → α → outParam β → Prop
CSLiftVal a b means that b = lift a. This is used by ring to construct an expression b
from the input expression a, and then run the usual ring algorithm on b.
ctor Mathlib.Tactic.Ring.CSLiftVal.mk E0 #
∀ {α : Type u} {β : outParam (Type u)} [inst : Mathlib.Tactic.Ring.CSLift α β] {a : α} {b : outParam β},
b = Mathlib.Tactic.Ring.CSLift.lift a → Mathlib.Tactic.Ring.CSLiftVal a b
theorem Mathlib.Tactic.Ring.CSLiftVal.eq E1 #
∀ {α : Type u} {β : outParam (Type u)} {inst : Mathlib.Tactic.Ring.CSLift α β} {a : α} {b : outParam β}
[self : Mathlib.Tactic.Ring.CSLiftVal a b], b = Mathlib.Tactic.Ring.CSLift.lift a
The output value b is equal to the lift of a. This can be supplied by the default
instance which sets b := lift a, but ring will treat this as an atom so it is more useful
when there are other instances which distribute addition or multiplication.
instance Mathlib.Tactic.Ring.instCSLiftValLift E0 #
∀ {α β : Type u_2} [inst : Mathlib.Tactic.Ring.CSLift α β] (a : α),
Mathlib.Tactic.Ring.CSLiftVal a (Mathlib.Tactic.Ring.CSLift.lift a)
theorem Mathlib.Tactic.Ring.of_lift E1 #
∀ {α β : Type u_2} [inst : Mathlib.Tactic.Ring.CSLift α β] {a b : α} {a' b' : β}
[h1 : Mathlib.Tactic.Ring.CSLiftVal a a'] [h2 : Mathlib.Tactic.Ring.CSLiftVal b b'], a' = b' → a = b
theorem Mathlib.Tactic.Ring.of_eq E0 #
∀ {α : Sort u_2} {a b c : α}, a = c → b = c → a = b
opaque Mathlib.Tactic.Ring.ringCleanupRef E1 #
IO.Ref (Lean.Expr → Lean.MetaM Lean.Expr)
This is a routine which is used to clean up the unsolved subgoal
of a failed ring1 application. It is overridden in Mathlib/Tactic/Ring/RingNF.lean
to apply the ring_nf simp set to the goal.
def Mathlib.Tactic.Ring.proveEq E1 #
Lean.MVarId → Mathlib.Tactic.AtomM Unit
Frontend of ring1: attempt to close a goal g, assuming it is an equation of semirings.
def Mathlib.Tactic.Ring.ring1 E1 #
Lean.ParserDescr
ring1 solves the goal when it is an equality in commutative (semi)rings,
allowing variables in the exponent.
This version of ring fails if the target is not an equality.
ring1!uses a more aggressive reducibility setting to determine equality of atoms.
Extensions:
-
ring1_nfadditionally usesring_nfto simplify in atoms.ring1_nf!will use a more aggressive reducibility setting to determine equality of atoms.
def Mathlib.Tactic.Ring.tacticRing1! E1 #
Lean.ParserDescr
ring1 solves the goal when it is an equality in commutative (semi)rings,
allowing variables in the exponent.
This version of ring fails if the target is not an equality.
ring1!uses a more aggressive reducibility setting to determine equality of atoms.
Extensions:
-
ring1_nfadditionally usesring_nfto simplify in atoms.ring1_nf!will use a more aggressive reducibility setting to determine equality of atoms.