Tactic for evaluating equations in the language of additive, commutative monoids and groups.
abel and its variants work as both tactics and conv tactics.
abel1fails if the target is not an equality that is provable by the axioms of commutative monoids/groups.abel_nfrewrites all group expressions into a normal form.- In tactic mode,
abel_nf at hcan be used to rewrite in a hypothesis. abel_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,abel_nfwill also recurse into atoms
- In tactic mode,
abel!,abel1!,abel_nf!will use a more aggressive reducibility setting to identify atoms.
For example:
example [AddCommMonoid α] (a b : α) : a + (b + a) = a + a + b := by abel
example [AddCommGroup α] (a : α) : (3 : ℤ) • a = a + (2 : ℤ) • a := by abel
Future work #
- In mathlib 3,
abelaccepted additional optional arguments:
It is undecided whether these features should be restored eventually.syntax "abel" (&" raw" <|> &" term")? (location)? : tactic
Equations
Instances For
The Context for a call to abel.
Stores a few options for this call, and caches some common subexpressions
such as typeclass instances and 0 : α.
- α : Lean.Expr
The type of the ambient additive commutative group or monoid.
- univ : Lean.Level
The universe level for
α. - α0 : Lean.Expr
The expression representing
0 : α. - isGroup : Bool
Specify whether we are in an additive commutative group or an additive commutative monoid.
- inst : Lean.Expr
The
AddCommGroup αorAddCommMonoid αexpression.
Instances For
The monad for Abel contains, in addition to the AtomM state,
some information about the current type we are working over, so that we can consistently
use group lemmas or monoid lemmas as appropriate.
Equations
Instances For
Apply the function n : ∀ {α} [inst α], _ to the implicit parameters in the
context, and the given list of arguments.
Compared to context.app, this takes the name of the typeclass, rather than an
inferred typeclass instance.
Equations
Instances For
Add the letter "g" to the end of the name, e.g. turning term into termg.
This is used to choose between declarations taking AddCommMonoid and those
taking AddCommGroup instances.
Equations
Instances For
A type synonym used by abel to represent n • x + a in an additive commutative monoid.
Equations
Instances For
A type synonym used by abel to represent n • x + a in an additive commutative group.
Equations
Instances For
Evaluate a term with coefficient n, atom x and successor terms a.
Equations
Instances For
Interpret an integer as a coefficient to a term.
Equations
Instances For
A normal form for abel.
Expressions are represented as a list of terms of the form e = n • x,
where n : ℤ and x is an arbitrary element of the additive commutative monoid or group.
We explicitly track the Expr forms of e and n, even though they could be reconstructed,
for efficiency.
- zero (e : Lean.Expr) : NormalExpr
- nterm (e : Lean.Expr) (n : Lean.Expr × ℤ) (x : ℕ × Lean.Expr) (a : NormalExpr) : NormalExpr
Instances For
Extract the expression from a normal form.
Equations
Instances For
Construct the normal form representing a single term.
Equations
Instances For
Construct the normal form representing zero.
Equations
Instances For
Interpret the sum of two expressions in abel's normal form.
Normalize a term orig of the form smul e₁ e₂ or smulg e₁ e₂.
Normalized terms use smul for monoids and smulg for groups,
so there are actually four cases to handle:
- Using
smulin a monoid just simplifies the pieces usingsubst_into_smul - Using
smulgin a group just simplifies the pieces usingsubst_into_smulg - Using
smul a bin a group requires convertingafrom a nat to an int and then simplifyingsmulg ↑a busingsubst_into_smul_upcast - Using
smulgin a monoid is impossible (or at least out of scope), because you need a group argument to write asmulgterm
Equations
Instances For
Evaluate an expression into its abel normal form, by recursing into subexpressions.
Tactic for evaluating equations in the language of additive, commutative monoids and groups.
abel and its variants work as both tactics and conv tactics.
abel1fails if the target is not an equality that is provable by the axioms of commutative monoids/groups.abel_nfrewrites all group expressions into a normal form.- In tactic mode,
abel_nf at hcan be used to rewrite in a hypothesis. abel_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,abel_nfwill also recurse into atoms
- In tactic mode,
abel!,abel1!,abel_nf!will use a more aggressive reducibility setting to identify atoms.
For example:
example [AddCommMonoid α] (a b : α) : a + (b + a) = a + a + b := by abel
example [AddCommGroup α] (a : α) : (3 : ℤ) • a = a + (2 : ℤ) • a := by abel
Future work #
- In mathlib 3,
abelaccepted additional optional arguments:
It is undecided whether these features should be restored eventually.syntax "abel" (&" raw" <|> &" term")? (location)? : tactic
Equations
Instances For
Tactic for evaluating equations in the language of additive, commutative monoids and groups.
abel and its variants work as both tactics and conv tactics.
abel1fails if the target is not an equality that is provable by the axioms of commutative monoids/groups.abel_nfrewrites all group expressions into a normal form.- In tactic mode,
abel_nf at hcan be used to rewrite in a hypothesis. abel_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,abel_nfwill also recurse into atoms
- In tactic mode,
abel!,abel1!,abel_nf!will use a more aggressive reducibility setting to identify atoms.
For example:
example [AddCommMonoid α] (a b : α) : a + (b + a) = a + a + b := by abel
example [AddCommGroup α] (a : α) : (3 : ℤ) • a = a + (2 : ℤ) • a := by abel
Future work #
- In mathlib 3,
abelaccepted additional optional arguments:
It is undecided whether these features should be restored eventually.syntax "abel" (&" raw" <|> &" term")? (location)? : tactic
Equations
Instances For
A type synonym used by abel to represent n • x + a in an additive commutative group.
True if this represents an atomic expression.
Equations
Instances For
A cleanup routine, which simplifies expressions in abel normal form to a more human-friendly
format.
Equations
Instances For
Evaluate an expression into its abel normal form.
This is a variant of Mathlib.Tactic.Abel.eval, the main driver of the abel tactic.
It differs in
- outputting a
Simp.Result, rather than aNormalExpr × Expr; - throwing an error if the expression
eis an atom for theabeltactic.
Equations
Instances For
Use abel_nf to rewrite the main goal.
Equations
Instances For
Use abel_nf to rewrite hypothesis h.
Equations
Instances For
Tactic for evaluating equations in the language of additive, commutative monoids and groups.
abel and its variants work as both tactics and conv tactics.
abel1fails if the target is not an equality that is provable by the axioms of commutative monoids/groups.abel_nfrewrites all group expressions into a normal form.- In tactic mode,
abel_nf at hcan be used to rewrite in a hypothesis. abel_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,abel_nfwill also recurse into atoms
- In tactic mode,
abel!,abel1!,abel_nf!will use a more aggressive reducibility setting to identify atoms.
For example:
example [AddCommMonoid α] (a b : α) : a + (b + a) = a + a + b := by abel
example [AddCommGroup α] (a : α) : (3 : ℤ) • a = a + (2 : ℤ) • a := by abel
Future work #
- In mathlib 3,
abelaccepted additional optional arguments:
It is undecided whether these features should be restored eventually.syntax "abel" (&" raw" <|> &" term")? (location)? : tactic
Equations
Instances For
Tactic for evaluating equations in the language of additive, commutative monoids and groups.
abel and its variants work as both tactics and conv tactics.
abel1fails if the target is not an equality that is provable by the axioms of commutative monoids/groups.abel_nfrewrites all group expressions into a normal form.- In tactic mode,
abel_nf at hcan be used to rewrite in a hypothesis. abel_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,abel_nfwill also recurse into atoms
- In tactic mode,
abel!,abel1!,abel_nf!will use a more aggressive reducibility setting to identify atoms.
For example:
example [AddCommMonoid α] (a b : α) : a + (b + a) = a + a + b := by abel
example [AddCommGroup α] (a : α) : (3 : ℤ) • a = a + (2 : ℤ) • a := by abel
Future work #
- In mathlib 3,
abelaccepted additional optional arguments:
It is undecided whether these features should be restored eventually.syntax "abel" (&" raw" <|> &" term")? (location)? : tactic
Equations
Instances For
Tactic for evaluating equations in the language of additive, commutative monoids and groups.
abel and its variants work as both tactics and conv tactics.
abel1fails if the target is not an equality that is provable by the axioms of commutative monoids/groups.abel_nfrewrites all group expressions into a normal form.- In tactic mode,
abel_nf at hcan be used to rewrite in a hypothesis. abel_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,abel_nfwill also recurse into atoms
- In tactic mode,
abel!,abel1!,abel_nf!will use a more aggressive reducibility setting to identify atoms.
For example:
example [AddCommMonoid α] (a b : α) : a + (b + a) = a + a + b := by abel
example [AddCommGroup α] (a : α) : (3 : ℤ) • a = a + (2 : ℤ) • a := by abel
Future work #
- In mathlib 3,
abelaccepted additional optional arguments:
It is undecided whether these features should be restored eventually.syntax "abel" (&" raw" <|> &" term")? (location)? : tactic
Equations
Instances For
Elaborator for the abel_nf tactic.
Equations
Instances For
Tactic for evaluating equations in the language of additive, commutative monoids and groups.
abel and its variants work as both tactics and conv tactics.
abel1fails if the target is not an equality that is provable by the axioms of commutative monoids/groups.abel_nfrewrites all group expressions into a normal form.- In tactic mode,
abel_nf at hcan be used to rewrite in a hypothesis. abel_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,abel_nfwill also recurse into atoms
- In tactic mode,
abel!,abel1!,abel_nf!will use a more aggressive reducibility setting to identify atoms.
For example:
example [AddCommMonoid α] (a b : α) : a + (b + a) = a + a + b := by abel
example [AddCommGroup α] (a : α) : (3 : ℤ) • a = a + (2 : ℤ) • a := by abel
Future work #
- In mathlib 3,
abelaccepted additional optional arguments:
It is undecided whether these features should be restored eventually.syntax "abel" (&" raw" <|> &" term")? (location)? : tactic
Equations
Instances For
Tactic for evaluating equations in the language of additive, commutative monoids and groups.
abel and its variants work as both tactics and conv tactics.
abel1fails if the target is not an equality that is provable by the axioms of commutative monoids/groups.abel_nfrewrites all group expressions into a normal form.- In tactic mode,
abel_nf at hcan be used to rewrite in a hypothesis. abel_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,abel_nfwill also recurse into atoms
- In tactic mode,
abel!,abel1!,abel_nf!will use a more aggressive reducibility setting to identify atoms.
For example:
example [AddCommMonoid α] (a b : α) : a + (b + a) = a + a + b := by abel
example [AddCommGroup α] (a : α) : (3 : ℤ) • a = a + (2 : ℤ) • a := by abel
Future work #
- In mathlib 3,
abelaccepted additional optional arguments:
It is undecided whether these features should be restored eventually.syntax "abel" (&" raw" <|> &" term")? (location)? : tactic
Equations
Instances For
Tactic for evaluating equations in the language of additive, commutative monoids and groups.
abel and its variants work as both tactics and conv tactics.
abel1fails if the target is not an equality that is provable by the axioms of commutative monoids/groups.abel_nfrewrites all group expressions into a normal form.- In tactic mode,
abel_nf at hcan be used to rewrite in a hypothesis. abel_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,abel_nfwill also recurse into atoms
- In tactic mode,
abel!,abel1!,abel_nf!will use a more aggressive reducibility setting to identify atoms.
For example:
example [AddCommMonoid α] (a b : α) : a + (b + a) = a + a + b := by abel
example [AddCommGroup α] (a : α) : (3 : ℤ) • a = a + (2 : ℤ) • a := by abel
Future work #
- In mathlib 3,
abelaccepted additional optional arguments:
It is undecided whether these features should be restored eventually.syntax "abel" (&" raw" <|> &" term")? (location)? : tactic
Equations
Instances For
Tactic for evaluating equations in the language of additive, commutative monoids and groups.
abel and its variants work as both tactics and conv tactics.
abel1fails if the target is not an equality that is provable by the axioms of commutative monoids/groups.abel_nfrewrites all group expressions into a normal form.- In tactic mode,
abel_nf at hcan be used to rewrite in a hypothesis. abel_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,abel_nfwill also recurse into atoms
- In tactic mode,
abel!,abel1!,abel_nf!will use a more aggressive reducibility setting to identify atoms.
For example:
example [AddCommMonoid α] (a b : α) : a + (b + a) = a + a + b := by abel
example [AddCommGroup α] (a : α) : (3 : ℤ) • a = a + (2 : ℤ) • a := by abel
Future work #
- In mathlib 3,
abelaccepted additional optional arguments:
It is undecided whether these features should be restored eventually.syntax "abel" (&" raw" <|> &" term")? (location)? : tactic
Equations
Instances For
We register abel with the hint tactic.