Commit 2022-08-18 18:40 3bfa4496

View on Github →

feat(Mathlib/Order/Basic): port most of data/order/basic.lean (#348) Ports most of data/order/basic.lean from mathlib3, leaving a few TODOs. This file lives near the base of the file-import dependency graph; having it ported should enable more experimentation with higher-level parts of the algebraic hierarchy. Some challenges that came up:

  • Lean 4 defines max and min in the prelude, while Lean 3 (as of https://github.com/leanprover-community/lean/pull/609) defines them differently as part of linear_order. We will need to figure out how to resolve this conflict.
  • In Lean 3, the lexicographic order on products uses a wrapper type lex α β. In Lean 4, the prelude instance instLTProd defines the lexicographic order directly on α × β. In this PR, I needed to verbosely disambiguate which instance to use.

Estimated changes

added theorem Eq.not_gt
added theorem Eq.not_lt
added theorem LE.le.le_iff_eq
added theorem LE.le.le_or_le
added theorem LE.le.le_or_lt
added theorem LE.le.lt_iff_ne
added theorem LE.le.lt_or_le
added theorem LT.lt.lt_or_lt
added theorem LT.lt.ne'
added theorem LinearOrder.ext
added def LinearOrder.lift
added theorem NE.le_iff_lt
added theorem NE.lt_of_le'
added theorem NE.lt_of_le
added def Order.preimage
added theorem PartialOrder.ext
added theorem Pi.compl_apply
added theorem Pi.compl_def
added theorem Pi.le_def
added theorem Pi.lt_def
added theorem Preorder.ext
added def Preorder.lift
added theorem Prod.le_def
added theorem Prod.lt_iff
added theorem Prod.mk_le_mk
added theorem Prod.mk_le_mk_iff_left
added theorem Prod.mk_lt_mk
added theorem Prod.mk_lt_mk_iff_left
added theorem Prod.swap_le_swap
added theorem Prod.swap_lt_swap
added theorem Subtype.coe_le_coe
added theorem Subtype.coe_lt_coe
added theorem Subtype.mk_le_mk
added theorem Subtype.mk_lt_mk
added theorem dense_or_discrete
added theorem eq_iff_le_not_lt
added theorem eq_of_forall_ge_iff
added theorem eq_of_forall_le_iff
added theorem eq_or_lt_of_le
added theorem exists_between
added theorem exists_ge_of_linear
added theorem forall_lt_iff_le'
added theorem forall_lt_iff_le
added theorem ge_antisymm
added theorem ge_iff_le
added theorem ge_of_eq
added theorem gt_iff_lt
added theorem le_iff_eq_or_lt
added theorem le_of_eq_of_le'
added theorem le_of_eq_of_le
added theorem le_of_forall_le'
added theorem le_of_forall_le
added theorem le_of_forall_lt'
added theorem le_of_forall_lt
added theorem le_of_le_of_eq'
added theorem le_of_le_of_eq
added theorem le_rfl
added theorem le_trans'
added theorem le_update_iff
added theorem lt_iff_le_and_ne
added theorem lt_iff_lt_of_le_iff_le
added theorem lt_iff_not_ge'
added theorem lt_imp_lt_of_le_imp_le
added theorem lt_of_eq_of_lt'
added theorem lt_of_eq_of_lt
added theorem lt_of_le_of_lt'
added theorem lt_of_le_of_ne'
added theorem lt_of_lt_of_eq'
added theorem lt_of_lt_of_eq
added theorem lt_of_lt_of_le'
added theorem lt_of_not_ge'
added theorem lt_self_iff_false
added theorem lt_trans'
added theorem ne.lt_or_lt
added theorem ne_iff_lt_iff_le
added theorem not_le_of_lt
added theorem not_lt_iff_eq_or_lt
added theorem not_lt_of_le
added def order_dual
added theorem update_le_iff
added theorem update_le_update_iff