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.
#align
statements without corresponding declarations
(i.e. because the declaration is in Batteries or Lean) can be left here.
These will be deleted soon so will not significantly delay deleting otherwise empty Init
files.
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
- symm_op : ∀ (a b : α), op a b = op b a
A commutative binary operation.
Equations
- IsCommutative α op = Std.Commutative op
Equations
- ⋯ = ⋯
An associative binary operation.
Equations
- IsAssociative α op = Std.Associative op
Equations
- IsIdempotent α op = Std.IdempotentOp op
IsRefl X r
means the binary relation r
on X
is reflexive.
- refl : ∀ (a : α), r a a
Instances
- AddCommute.instIsRefl
- AddCommute.on_isRefl
- Associated.instIsRefl
- Commute.instIsRefl
- Commute.on_isRefl
- Finset.instIsReflSubset
- IsIrrefl.compl
- IsTotal.to_isRefl
- List.SublistForall₂.is_refl
- Nat.ModEq.instIsRefl
- Order.Preimage.instIsRefl
- Prod.instIsReflLex
- Prod.instIsReflLex_1
- Relation.ReflGen.instIsRefl
- Relation.instIsReflReflTransGen
- Set.instIsReflSubset
- Subrel.instIsReflElem
- WCovBy.isRefl
- instIsReflDvd
- instIsReflGe
- instIsReflLe
- instIsReflPropIff
IsSymm X r
means the binary relation r
on X
is symmetric.
- symm : ∀ (a b : α), r a b → r b a
IsAntisymm X r
means the binary relation r
on X
is antisymmetric.
- antisymm : ∀ (a b : α), r a b → r b a → a = b
Equations
- ⋯ = ⋯
IsTrans X r
means the binary relation r
on X
is transitive.
- trans : ∀ (a b c : α), r a b → r b c → r a c
Instances
- Associated.instIsTrans
- Finset.instIsTransSSubset
- Finset.instIsTransSubset
- List.SublistForall₂.is_trans
- List.instIsTransSubset
- Order.Preimage.instIsTrans
- Prod.instIsTransLex
- Relation.instIsTransReflTransGen
- Relation.instIsTransTransGen
- Set.instIsTransSSubset
- Set.instIsTransSubset
- Subrel.instIsTransElem
- instIsTransDvd
- instIsTransGe
- instIsTransGt
- instIsTransLe
- instIsTransLt
- instIsTransOfIsWellOrder
- instIsTransOfTrans
- instIsTransPropIff
IsPreorder X r
means that the binary relation r
on X
is a pre-order, that is, reflexive
and transitive.
IsTotalPreorder X r
means that the binary relation r
on X
is total and a preorder.
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
.
IsLinearOrder X r
means that the binary relation r
on X
is a linear order, that is,
IsPartialOrder X r
and IsTotal X r
.
IsEquiv X r
means that the binary relation r
on X
is an equivalence relation, that
is, IsPreorder X r
and IsSymm X r
.
IsStrictOrder X r
means that the binary relation r
on X
is a strict order, that is,
IsIrrefl X r
and IsTrans X r
.
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
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
.
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
.
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
.
Equations
- StrictWeakOrder.Equiv a b = (¬r a b ∧ ¬r b a)
Instances For
Equations
- ⋯ = ⋯
The equivalence relation induced by lt
Equations
- One or more equations did not get rendered due to their size.