ring_nf tactic #
A tactic which uses ring to rewrite expressions. This can be used non-terminally to normalize
ring expressions in the goal such as ⊢ P (x + x + x) ~> ⊢ P (x * 3), as well as being able to
prove some equations that ring cannot because they involve ring reasoning inside a subterm,
such as sin (x + y) + sin (y + x) = 2 * sin (x + y).
True if this represents an atomic expression.
Instances For
True if this represents an atomic expression.
Instances For
True if this represents an atomic expression.
Equations
- (Mathlib.Tactic.Ring.ExSum.add va₁ Mathlib.Tactic.Ring.ExSum.zero).isAtom = va₁.isAtom
- (Mathlib.Tactic.Ring.ExSum.add va₁ va₂).isAtom = false
- x✝.isAtom = false
Instances For
Equations
- Mathlib.Tactic.RingNF.instBEqRingMode.beq x✝ y✝ = (x✝.ctorIdx == y✝.ctorIdx)
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Equations
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Function elaborating RingNF.Config.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Evaluates an expression e into a normalized representation as a polynomial.
This is a variant of Mathlib.Tactic.Ring.eval, the main driver of the ring tactic.
It differs in
- operating on
Expr(input) andSimp.Result(output), rather than typedQqversions of these; - throwing an error if the expression
eis an atom for theringtactic.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A cleanup routine, which simplifies normalized polynomials to a more human-friendly format.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Simplification tactic for expressions in the language of commutative (semi)rings, which rewrites all ring expressions into a normal form.
ring_nf!will use a more aggressive reducibility setting to identify atoms.ring_nf (config := cfg)allows for additional configuration:red: the reducibility setting (overridden by!)zetaDelta: if true, local let variables can be unfolded (overridden by!)recursive: if true,ring_nfwill also recurse into atoms
ring_nfworks as both a tactic and a conv tactic. In tactic mode,ring_nf at hcan be used to rewrite in a hypothesis.
This can be used non-terminally to normalize ring expressions in the goal such as
⊢ P (x + x + x) ~> ⊢ P (x * 3), as well as being able to prove some equations that
ring cannot because they involve ring reasoning inside a subterm, such as
sin (x + y) + sin (y + x) = 2 * sin (x + y).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Simplification tactic for expressions in the language of commutative (semi)rings, which rewrites all ring expressions into a normal form.
ring_nf!will use a more aggressive reducibility setting to identify atoms.ring_nf (config := cfg)allows for additional configuration:red: the reducibility setting (overridden by!)zetaDelta: if true, local let variables can be unfolded (overridden by!)recursive: if true,ring_nfwill also recurse into atoms
ring_nfworks as both a tactic and a conv tactic. In tactic mode,ring_nf at hcan be used to rewrite in a hypothesis.
This can be used non-terminally to normalize ring expressions in the goal such as
⊢ P (x + x + x) ~> ⊢ P (x * 3), as well as being able to prove some equations that
ring cannot because they involve ring reasoning inside a subterm, such as
sin (x + y) + sin (y + x) = 2 * sin (x + y).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Simplification tactic for expressions in the language of commutative (semi)rings, which rewrites all ring expressions into a normal form.
ring_nf!will use a more aggressive reducibility setting to identify atoms.ring_nf (config := cfg)allows for additional configuration:red: the reducibility setting (overridden by!)zetaDelta: if true, local let variables can be unfolded (overridden by!)recursive: if true,ring_nfwill also recurse into atoms
ring_nfworks as both a tactic and a conv tactic. In tactic mode,ring_nf at hcan be used to rewrite in a hypothesis.
This can be used non-terminally to normalize ring expressions in the goal such as
⊢ P (x + x + x) ~> ⊢ P (x * 3), as well as being able to prove some equations that
ring cannot because they involve ring reasoning inside a subterm, such as
sin (x + y) + sin (y + x) = 2 * sin (x + y).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Tactic for solving equations of commutative (semi)rings, allowing variables in the exponent.
- This version of
ring1usesring_nfto simplify in atoms. - The variant
ring1_nf!will use a more aggressive reducibility setting to determine equality of atoms.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Tactic for solving equations of commutative (semi)rings, allowing variables in the exponent.
- This version of
ring1usesring_nfto simplify in atoms. - The variant
ring1_nf!will use a more aggressive reducibility setting to determine equality of atoms.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Elaborator for the ring_nf tactic.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Simplification tactic for expressions in the language of commutative (semi)rings, which rewrites all ring expressions into a normal form.
ring_nf!will use a more aggressive reducibility setting to identify atoms.ring_nf (config := cfg)allows for additional configuration:red: the reducibility setting (overridden by!)zetaDelta: if true, local let variables can be unfolded (overridden by!)recursive: if true,ring_nfwill also recurse into atoms
ring_nfworks as both a tactic and a conv tactic. In tactic mode,ring_nf at hcan be used to rewrite in a hypothesis.
This can be used non-terminally to normalize ring expressions in the goal such as
⊢ P (x + x + x) ~> ⊢ P (x * 3), as well as being able to prove some equations that
ring cannot because they involve ring reasoning inside a subterm, such as
sin (x + y) + sin (y + x) = 2 * sin (x + y).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Tactic for evaluating expressions in commutative (semi)rings, allowing for variables in the
exponent. If the goal is not appropriate for ring (e.g. not an equality) ring_nf will be
suggested.
ring!will use a more aggressive reducibility setting to determine equality of atoms.ring1fails if the target is not an equality.
For example:
example (n : ℕ) (m : ℤ) : 2^(n+1) * m = 2 * 2^n * m := by ring
example (a b : ℤ) (n : ℕ) : (a + b)^(n + 2) = (a^2 + b^2 + a * b + b * a) * (a + b)^n := by ring
example (x y : ℕ) : x + id y = y + id x := by ring!
example (x : ℕ) (h : x * 2 > 5): x + x > 5 := by ring; assumption -- suggests ring_nf
Equations
- Mathlib.Tactic.RingNF.ring = Lean.ParserDescr.node `Mathlib.Tactic.RingNF.ring 1024 (Lean.ParserDescr.nonReservedSymbol "ring" false)
Instances For
Tactic for evaluating expressions in commutative (semi)rings, allowing for variables in the
exponent. If the goal is not appropriate for ring (e.g. not an equality) ring_nf will be
suggested.
ring!will use a more aggressive reducibility setting to determine equality of atoms.ring1fails if the target is not an equality.
For example:
example (n : ℕ) (m : ℤ) : 2^(n+1) * m = 2 * 2^n * m := by ring
example (a b : ℤ) (n : ℕ) : (a + b)^(n + 2) = (a^2 + b^2 + a * b + b * a) * (a + b)^n := by ring
example (x y : ℕ) : x + id y = y + id x := by ring!
example (x : ℕ) (h : x * 2 > 5): x + x > 5 := by ring; assumption -- suggests ring_nf
Equations
- Mathlib.Tactic.RingNF.tacticRing! = Lean.ParserDescr.node `Mathlib.Tactic.RingNF.tacticRing! 1024 (Lean.ParserDescr.nonReservedSymbol "ring!" false)
Instances For
The tactic ring evaluates expressions in commutative (semi)rings.
This is the conv tactic version, which rewrites a target which is a ring equality to True.
See also the ring tactic.
Equations
- Mathlib.Tactic.RingNF.ringConv = Lean.ParserDescr.node `Mathlib.Tactic.RingNF.ringConv 1024 (Lean.ParserDescr.nonReservedSymbol "ring" false)
Instances For
The tactic ring evaluates expressions in commutative (semi)rings.
This is the conv tactic version, which rewrites a target which is a ring equality to True.
See also the ring tactic.
Equations
- Mathlib.Tactic.RingNF.convRing! = Lean.ParserDescr.node `Mathlib.Tactic.RingNF.convRing! 1024 (Lean.ParserDescr.nonReservedSymbol "ring!" false)
Instances For
We register ring with the hint tactic.