Unbundled algebra classes #
These classes are part of an incomplete refactor described here on the github Wiki. However a subset of them are widely used in mathlib3, and it has been tricky to clean this up as this file was in core Lean 3.
By themselves, these classes are not good replacements for the Monoid
/ Group
etc structures
provided by mathlib, as they are not discoverable by simp
unlike the current lemmas due to there
being little to index on. The Wiki page linked above describes an algebraic normalizer, but it was
never implemented in Lean 3.
Porting note: #
This file is ancient, and it would be good to replace it with a clean version that provides what mathlib4 actually needs.
I've omitted all the @[algebra]
attributes, as they are not used elsewhere.
The section StrictWeakOrder
has been omitted, but I've left the mathport output in place.
Please delete if cleaning up.
I've commented out some classes which we think are completely unused in mathlib.
I've added many of the declarations to nolints.json
.
If you clean up this file, please add documentation to classes that we are keeping.
Mario made the following analysis of uses in mathlib3:
is_symm_op
: unused except for some instancesis_commutative
: used a fair amount via some theorems about folds (also assumingis_associative
)is_associative
: ditto, also used innoncomm_fold
is_left_id
,is_right_id
: unused except in the mathlib classis_unital
and inmono
(which looks like it could useis_unital
)is_left_null
,is_right_null
: unusedis_left_cancel
,is_right_cancel
: unused except for instancesis_idempotent
: this one is actually used to prove things not directly aboutis_idempotent
is_left_distrib
,is_right_distrib
,is_left_inv
,is_right_inv
,is_cond_left_inv
,is_cond_right_inv
: unusedis_distinct
: unused (although we reinvented this one asnontrivial
)is_irrefl
,is_refl
,is_symm
,is_trans
: significant usageis_asymm
,is_antisymm
,is_total
,is_strict_order
: a lot of uses but all in order theory and it's unclear how much could not be transferred to another typeclassis_preorder
: unused except for instances (exceptantisymmetrization
, maybe it could be transferred)is_total_preorder
,is_partial_order
: unused except for instancesis_linear_order
: unused except for instancesis_equiv
: unused except for instances (most uses can useequivalence
instead)is_per
: unusedis_incomp_trans
: unusedis_strict_weak_order
: significant usage (most of it onrbmap
, could be transferred)is_trichotomous
: some usageis_strict_total_order
: looks like the only usage is inrbmap
again
A commutative binary operation.
Equations
- IsCommutative α op = Std.Commutative op
Instances For
Equations
- ⋯ = ⋯
An associative binary operation.
Equations
- IsAssociative α op = Std.Associative op
Instances For
Equations
- IsIdempotent α op = Std.IdempotentOp op
Instances For
IsAntisymm X r
means the binary relation r
on X
is antisymmetric.
- antisymm : ∀ (a b : α), r a b → r b a → a = b
Instances
Equations
- ⋯ = ⋯
IsPreorder X r
means that the binary relation r
on X
is a pre-order, that is, reflexive
and transitive.
Instances
Every total pre-order is a pre-order.
Equations
- ⋯ = ⋯
IsPartialOrder X r
means that the binary relation r
on X
is a partial order, that is,
IsPreorder X r
and IsAntisymm X r
.
Instances
IsLinearOrder X r
means that the binary relation r
on X
is a linear order, that is,
IsPartialOrder X r
and IsTotal X r
.
Instances
IsEquiv X r
means that the binary relation r
on X
is an equivalence relation, that
is, IsPreorder X r
and IsSymm X r
.
Instances
IsStrictOrder X r
means that the binary relation r
on X
is a strict order, that is,
IsIrrefl X r
and IsTrans X r
.
Instances
IsStrictWeakOrder X lt
means that the binary relation lt
on X
is a strict weak order,
that is, IsStrictOrder X lt
and IsIncompTrans X lt
.
Instances
IsTrichotomous X lt
means that the binary relation lt
on X
is trichotomous, that is,
either lt a b
or a = b
or lt b a
for any a
and b
.
Instances
IsStrictTotalOrder X lt
means that the binary relation lt
on X
is a strict total order,
that is, IsTrichotomous X lt
and IsStrictOrder X lt
.
Instances
Equations
- StrictWeakOrder.Equiv a b = (¬r a b ∧ ¬r b a)
Instances For
Equations
- ⋯ = ⋯
Equations
- One or more equations did not get rendered due to their size.