Note about Mathlib/Init/
#
The files in Mathlib/Init
are leftovers from the port from Mathlib3.
(They contain content moved from lean3 itself that Mathlib needed but was not moved to lean4.)
We intend to move all the content of these files out into the main Mathlib
directory structure.
Contributions assisting with this are appreciated.
(Yaël): The only things of interest in this file now are the unbundled algebra classes
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
IsTotalPreorder X r
means that the binary relation r
on X
is total and a preorder.
Instances
Every total pre-order is a pre-order.
Equations
- ⋯ = ⋯
IsIncompTrans X lt
means that for lt
a binary relation on X
, the incomparable relation
fun a b => ¬ lt a b ∧ ¬ lt b a
is transitive.
Instances
Equations
- ⋯ = ⋯
Equations
- ⋯ = ⋯
The equivalence relation induced by lt
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- ⋯ = ⋯
Equations
- ⋯ = ⋯