Proof Assistant Projects
Collection
Digesting proof assistant libraries for AI ingestion. • 103 items • Updated • 3
statement stringlengths 1 1.18k | proof stringlengths 0 4.83k | type stringclasses 10
values | symbolic_name stringlengths 1 75 | library stringclasses 35
values | filename stringclasses 136
values | imports listlengths 0 9 | deps listlengths 0 4 | docstring stringlengths 0 1.87k | source_url stringclasses 1
value | commit stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|
Function.id_def : @id α = fun x => x | rfl
/-! ## decidable -/
protected alias ⟨Decidable.exists_not_of_not_forall, _⟩ := Decidable.not_forall | theorem | Function.id_def | Root | Batteries/Logic.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
heq_iff_eq {a b : α} : a ≍ b ↔ a = b | ⟨eq_of_heq, heq_of_eq⟩ | theorem | heq_iff_eq | Root | Batteries/Logic.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
eq_rec_constant {α : Sort _} {a a' : α} {β : Sort _} (y : β) (h : a = a') :
(@Eq.rec α a (fun _ _ => β) y a' h) = y | by cases h; rfl | theorem | eq_rec_constant | Root | Batteries/Logic.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
congrArg₂ (f : α → β → γ) {x x' : α} {y y' : β}
(hx : x = x') (hy : y = y') : f x y = f x' y' | by subst hx hy; rfl | theorem | congrArg₂ | Root | Batteries/Logic.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
congrFun₂ {β : α → Sort _} {γ : ∀ a, β a → Sort _}
{f g : ∀ a b, γ a b} (h : f = g) (a : α) (b : β a) :
f a b = g a b | congrFun (congrFun h _) _ | theorem | congrFun₂ | Root | Batteries/Logic.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
congrFun₃ {β : α → Sort _} {γ : ∀ a, β a → Sort _} {δ : ∀ a b, γ a b → Sort _}
{f g : ∀ a b c, δ a b c} (h : f = g) (a : α) (b : β a) (c : γ a b) :
f a b c = g a b c | congrFun₂ (congrFun h _) _ _ | theorem | congrFun₃ | Root | Batteries/Logic.lean | [] | [
"congrFun₂"
] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
funext₂ {β : α → Sort _} {γ : ∀ a, β a → Sort _}
{f g : ∀ a b, γ a b} (h : ∀ a b, f a b = g a b) : f = g | funext fun _ => funext <| h _ | theorem | funext₂ | Root | Batteries/Logic.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
funext₃ {β : α → Sort _} {γ : ∀ a, β a → Sort _} {δ : ∀ a b, γ a b → Sort _}
{f g : ∀ a b c, δ a b c} (h : ∀ a b c, f a b c = g a b c) : f = g | funext fun _ => funext₂ <| h _ | theorem | funext₃ | Root | Batteries/Logic.lean | [] | [
"funext₂"
] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
Eq.congr (h₁ : x₁ = y₁) (h₂ : x₂ = y₂) : x₁ = x₂ ↔ y₁ = y₂ | by
subst h₁; subst h₂; rfl | theorem | Eq.congr | Root | Batteries/Logic.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
Eq.congr_left {x y z : α} (h : x = y) : x = z ↔ y = z | by rw [h] | theorem | Eq.congr_left | Root | Batteries/Logic.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
Eq.congr_right {x y z : α} (h : x = y) : z = x ↔ z = y | by rw [h]
alias congr_arg := congrArg
alias congr_arg₂ := congrArg₂
alias congr_fun := congrFun
alias congr_fun₂ := congrFun₂
alias congr_fun₃ := congrFun₃ | theorem | Eq.congr_right | Root | Batteries/Logic.lean | [] | [
"congrArg₂",
"congrFun₂",
"congrFun₃"
] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
heq_of_cast_eq : ∀ (e : α = β) (_ : cast e a = a'), a ≍ a' | | rfl, rfl => .rfl | theorem | heq_of_cast_eq | Root | Batteries/Logic.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
cast_eq_iff_heq : cast e a = a' ↔ a ≍ a' | ⟨heq_of_cast_eq _, fun h => by cases h; rfl⟩ | theorem | cast_eq_iff_heq | Root | Batteries/Logic.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
eqRec_eq_cast {α : Sort _} {a : α} {motive : (a' : α) → a = a' → Sort _}
(x : motive a rfl) {a' : α} (e : a = a') :
@Eq.rec α a motive x a' e = cast (e ▸ rfl) x | by
subst e; rfl | theorem | eqRec_eq_cast | Root | Batteries/Logic.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
eqRec_heq_self {α : Sort _} {a : α} {motive : (a' : α) → a = a' → Sort _}
(x : motive a rfl) {a' : α} (e : a = a') : @Eq.rec α a motive x a' e ≍ x | by
subst e; rfl | theorem | eqRec_heq_self | Root | Batteries/Logic.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
eqRec_heq_iff_heq {α : Sort _} {a : α} {motive : (a' : α) → a = a' → Sort _}
{x : motive a rfl} {a' : α} {e : a = a'} {β : Sort _} {y : β} :
@Eq.rec α a motive x a' e ≍ y ↔ x ≍ y | by
subst e; rfl | theorem | eqRec_heq_iff_heq | Root | Batteries/Logic.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
heq_eqRec_iff_heq {α : Sort _} {a : α} {motive : (a' : α) → a = a' → Sort _}
{x : motive a rfl} {a' : α} {e : a = a'} {β : Sort _} {y : β} :
y ≍ @Eq.rec α a motive x a' e ↔ y ≍ x | by
subst e; rfl | theorem | heq_eqRec_iff_heq | Root | Batteries/Logic.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
not_nonempty_empty : ¬Nonempty Empty | fun ⟨h⟩ => h.elim | theorem | not_nonempty_empty | Root | Batteries/Logic.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
not_nonempty_pempty : ¬Nonempty PEmpty | fun ⟨h⟩ => h.elim | theorem | not_nonempty_pempty | Root | Batteries/Logic.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
subsingleton_of_forall_eq (x : α) (h : ∀ y, y = x) : Subsingleton α | ⟨fun a b => h a ▸ h b ▸ rfl⟩ | theorem | subsingleton_of_forall_eq | Root | Batteries/Logic.lean | [] | [] | If all points are equal to a given point `x`, then `α` is a subsingleton. | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 |
subsingleton_iff_forall_eq (x : α) : Subsingleton α ↔ ∀ y, y = x | ⟨fun _ y => Subsingleton.elim y x, subsingleton_of_forall_eq x⟩ | theorem | subsingleton_iff_forall_eq | Root | Batteries/Logic.lean | [] | [
"subsingleton_of_forall_eq"
] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
congr_eqRec {β : α → Sort _} (f : (x : α) → β x → γ) (h : x = x') (y : β x) :
f x' (Eq.rec y h) = f x y | by cases h; rfl | theorem | congr_eqRec | Root | Batteries/Logic.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
OrientedCmp (cmp : α → α → Ordering) : Prop where
/-- The comparator operation is symmetric, in the sense that if `cmp x y` equals `.lt` then
`cmp y x = .gt` and vice versa. -/
symm (x y) : (cmp x y).swap = cmp y x | class | Batteries.OrientedCmp | Classes | Batteries/Classes/Deprecated.lean | [] | [] | `OrientedCmp cmp` asserts that `cmp` is determined by the relation `cmp x y = .lt`. | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
cmp_eq_gt [OrientedCmp cmp] : cmp x y = .gt ↔ cmp y x = .lt | by
rw [← Ordering.swap_inj, symm]; exact .rfl | theorem | Batteries.OrientedCmp.cmp_eq_gt | Classes | Batteries/Classes/Deprecated.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
cmp_ne_gt [OrientedCmp cmp] : cmp x y ≠ .gt ↔ cmp y x ≠ .lt | not_congr cmp_eq_gt | theorem | Batteries.OrientedCmp.cmp_ne_gt | Classes | Batteries/Classes/Deprecated.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
cmp_eq_eq_symm [OrientedCmp cmp] : cmp x y = .eq ↔ cmp y x = .eq | by
rw [← Ordering.swap_inj, symm]; exact .rfl | theorem | Batteries.OrientedCmp.cmp_eq_eq_symm | Classes | Batteries/Classes/Deprecated.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
cmp_refl [OrientedCmp cmp] : cmp x x = .eq | match e : cmp x x with
| .lt => nomatch e.symm.trans (cmp_eq_gt.2 e)
| .eq => rfl
| .gt => nomatch (cmp_eq_gt.1 e).symm.trans e | theorem | Batteries.OrientedCmp.cmp_refl | Classes | Batteries/Classes/Deprecated.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
lt_asymm [OrientedCmp cmp] (h : cmp x y = .lt) : cmp y x ≠ .lt | fun h' => nomatch h.symm.trans (cmp_eq_gt.2 h') | theorem | Batteries.OrientedCmp.lt_asymm | Classes | Batteries/Classes/Deprecated.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
gt_asymm [OrientedCmp cmp] (h : cmp x y = .gt) : cmp y x ≠ .gt | mt cmp_eq_gt.1 <| lt_asymm <| cmp_eq_gt.1 h | theorem | Batteries.OrientedCmp.gt_asymm | Classes | Batteries/Classes/Deprecated.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
TransCmp (cmp : α → α → Ordering) : Prop extends OrientedCmp cmp where
/-- The comparator operation is transitive. -/
le_trans : cmp x y ≠ .gt → cmp y z ≠ .gt → cmp x z ≠ .gt | class | Batteries.TransCmp | Classes | Batteries/Classes/Deprecated.lean | [] | [] | `TransCmp cmp` asserts that `cmp` induces a transitive relation. | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
ge_trans (h₁ : cmp x y ≠ .lt) (h₂ : cmp y z ≠ .lt) : cmp x z ≠ .lt | by
have := @TransCmp.le_trans _ cmp _ z y x
simp [cmp_eq_gt] at *; exact this h₂ h₁ | theorem | Batteries.TransCmp.ge_trans | Classes | Batteries/Classes/Deprecated.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
le_lt_trans (h₁ : cmp x y ≠ .gt) (h₂ : cmp y z = .lt) : cmp x z = .lt | byContradiction fun h₃ => ge_trans (mt cmp_eq_gt.2 h₁) h₃ h₂ | theorem | Batteries.TransCmp.le_lt_trans | Classes | Batteries/Classes/Deprecated.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
lt_le_trans (h₁ : cmp x y = .lt) (h₂ : cmp y z ≠ .gt) : cmp x z = .lt | byContradiction fun h₃ => ge_trans h₃ (mt cmp_eq_gt.2 h₂) h₁ | theorem | Batteries.TransCmp.lt_le_trans | Classes | Batteries/Classes/Deprecated.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
lt_trans (h₁ : cmp x y = .lt) (h₂ : cmp y z = .lt) : cmp x z = .lt | le_lt_trans (gt_asymm <| cmp_eq_gt.2 h₁) h₂ | theorem | Batteries.TransCmp.lt_trans | Classes | Batteries/Classes/Deprecated.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
gt_trans (h₁ : cmp x y = .gt) (h₂ : cmp y z = .gt) : cmp x z = .gt | by
rw [cmp_eq_gt] at h₁ h₂ ⊢; exact lt_trans h₂ h₁ | theorem | Batteries.TransCmp.gt_trans | Classes | Batteries/Classes/Deprecated.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
cmp_congr_left (xy : cmp x y = .eq) : cmp x z = cmp y z | match yz : cmp y z with
| .lt => byContradiction (ge_trans (nomatch ·.symm.trans (cmp_eq_eq_symm.1 xy)) · yz)
| .gt => byContradiction (le_trans (nomatch ·.symm.trans (cmp_eq_eq_symm.1 xy)) · yz)
| .eq => match xz : cmp x z with
| .lt => nomatch ge_trans (nomatch ·.symm.trans xy) (nomatch ·.symm.trans yz) xz
... | theorem | Batteries.TransCmp.cmp_congr_left | Classes | Batteries/Classes/Deprecated.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
cmp_congr_left' (xy : cmp x y = .eq) : cmp x = cmp y | funext fun _ => cmp_congr_left xy | theorem | Batteries.TransCmp.cmp_congr_left' | Classes | Batteries/Classes/Deprecated.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
cmp_congr_right (yz : cmp y z = .eq) : cmp x y = cmp x z | by
rw [← Ordering.swap_inj, symm, symm, cmp_congr_left yz] | theorem | Batteries.TransCmp.cmp_congr_right | Classes | Batteries/Classes/Deprecated.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
BEqCmp [BEq α] (cmp : α → α → Ordering) : Prop where
/-- `cmp x y = .eq` holds iff `x == y` is true. -/
cmp_iff_beq : cmp x y = .eq ↔ x == y | class | Batteries.BEqCmp | Classes | Batteries/Classes/Deprecated.lean | [] | [] | `BEqCmp cmp` asserts that `cmp x y = .eq` and `x == y` coincide. | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
BEqCmp.cmp_iff_eq [BEq α] [LawfulBEq α] [BEqCmp (α := α) cmp] : cmp x y = .eq ↔ x = y | by
simp [BEqCmp.cmp_iff_beq] | theorem | Batteries.BEqCmp.cmp_iff_eq | Classes | Batteries/Classes/Deprecated.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
LTCmp [LT α] (cmp : α → α → Ordering) : Prop extends OrientedCmp cmp where
/-- `cmp x y = .lt` holds iff `x < y` is true. -/
cmp_iff_lt : cmp x y = .lt ↔ x < y | class | Batteries.LTCmp | Classes | Batteries/Classes/Deprecated.lean | [] | [] | `LTCmp cmp` asserts that `cmp x y = .lt` and `x < y` coincide. | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
LTCmp.cmp_iff_gt [LT α] [LTCmp (α := α) cmp] : cmp x y = .gt ↔ y < x | by
rw [OrientedCmp.cmp_eq_gt, LTCmp.cmp_iff_lt] | theorem | Batteries.LTCmp.cmp_iff_gt | Classes | Batteries/Classes/Deprecated.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
LECmp [LE α] (cmp : α → α → Ordering) : Prop extends OrientedCmp cmp where
/-- `cmp x y ≠ .gt` holds iff `x ≤ y` is true. -/
cmp_iff_le : cmp x y ≠ .gt ↔ x ≤ y | class | Batteries.LECmp | Classes | Batteries/Classes/Deprecated.lean | [] | [] | `LECmp cmp` asserts that `cmp x y ≠ .gt` and `x ≤ y` coincide. | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
LECmp.cmp_iff_ge [LE α] [LECmp (α := α) cmp] : cmp x y ≠ .lt ↔ y ≤ x | by
rw [← OrientedCmp.cmp_ne_gt, LECmp.cmp_iff_le] | theorem | Batteries.LECmp.cmp_iff_ge | Classes | Batteries/Classes/Deprecated.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
LawfulCmp [LE α] [LT α] [BEq α] (cmp : α → α → Ordering) : Prop extends
TransCmp cmp, BEqCmp cmp, LTCmp cmp, LECmp cmp | class | Batteries.LawfulCmp | Classes | Batteries/Classes/Deprecated.lean | [] | [] | `LawfulCmp cmp` asserts that the `LE`, `LT`, `BEq` instances are all coherent with each other
and with `cmp`, describing a strict weak order (a linear order except for antisymmetry). | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
OrientedOrd (α) [Ord α] | OrientedCmp (α := α) compare | abbrev | Batteries.OrientedOrd | Classes | Batteries/Classes/Deprecated.lean | [] | [] | `OrientedOrd α` asserts that the `Ord` instance satisfies `OrientedCmp`. | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 |
TransOrd (α) [Ord α] | TransCmp (α := α) compare | abbrev | Batteries.TransOrd | Classes | Batteries/Classes/Deprecated.lean | [] | [] | `TransOrd α` asserts that the `Ord` instance satisfies `TransCmp`. | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 |
BEqOrd (α) [BEq α] [Ord α] | BEqCmp (α := α) compare | abbrev | Batteries.BEqOrd | Classes | Batteries/Classes/Deprecated.lean | [] | [] | `BEqOrd α` asserts that the `Ord` and `BEq` instances are coherent via `BEqCmp`. | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 |
LTOrd (α) [LT α] [Ord α] | LTCmp (α := α) compare | abbrev | Batteries.LTOrd | Classes | Batteries/Classes/Deprecated.lean | [] | [] | `LTOrd α` asserts that the `Ord` instance satisfies `LTCmp`. | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 |
LEOrd (α) [LE α] [Ord α] | LECmp (α := α) compare | abbrev | Batteries.LEOrd | Classes | Batteries/Classes/Deprecated.lean | [] | [] | `LEOrd α` asserts that the `Ord` instance satisfies `LECmp`. | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 |
LawfulOrd (α) [LE α] [LT α] [BEq α] [Ord α] | LawfulCmp (α := α) compare | abbrev | Batteries.LawfulOrd | Classes | Batteries/Classes/Deprecated.lean | [] | [] | `LawfulOrd α` asserts that the `Ord` instance satisfies `LawfulCmp`. | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 |
TransCmp.compareOfLessAndEq
[LT α] [DecidableRel (LT.lt (α := α))] [DecidableEq α]
(lt_irrefl : ∀ x : α, ¬x < x)
(lt_trans : ∀ {x y z : α}, x < y → y < z → x < z)
(lt_antisymm : ∀ {x y : α}, ¬x < y → ¬y < x → x = y) :
TransCmp (α := α) (compareOfLessAndEq · ·) | by
have : OrientedCmp (α := α) (compareOfLessAndEq · ·) := by
refine { symm := fun x y => ?_ }
simp [compareOfLessAndEq]; split <;> [rename_i xy; split <;> [subst y; rename_i xy ne]]
· rw [if_neg, if_neg]; rfl
· rintro rfl; exact lt_irrefl _ xy
· exact fun yx => lt_irrefl _ (lt_trans xy yx)
... | theorem | Batteries.TransCmp.compareOfLessAndEq | Classes | Batteries/Classes/Deprecated.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
TransCmp.compareOfLessAndEq_of_le
[LT α] [LE α] [DecidableRel (LT.lt (α := α))] [DecidableEq α]
(lt_irrefl : ∀ x : α, ¬x < x)
(lt_trans : ∀ {x y z : α}, x < y → y < z → x < z)
(not_lt : ∀ {x y : α}, ¬x < y → y ≤ x)
(le_antisymm : ∀ {x y : α}, x ≤ y → y ≤ x → x = y) :
TransCmp (α := α) (compareOf... | .compareOfLessAndEq lt_irrefl lt_trans fun xy yx => le_antisymm (not_lt yx) (not_lt xy) | theorem | Batteries.TransCmp.compareOfLessAndEq_of_le | Classes | Batteries/Classes/Deprecated.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
BEqCmp.compareOfLessAndEq
[LT α] [DecidableRel (LT.lt (α := α))] [DecidableEq α] [BEq α] [LawfulBEq α]
(lt_irrefl : ∀ x : α, ¬x < x) :
BEqCmp (α := α) (compareOfLessAndEq · ·) | where
cmp_iff_beq {x y} := by
simp [compareOfLessAndEq]
split <;> [skip; split] <;> simp [*]
rintro rfl; exact lt_irrefl _ ‹_› | theorem | Batteries.BEqCmp.compareOfLessAndEq | Classes | Batteries/Classes/Deprecated.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
LTCmp.compareOfLessAndEq
[LT α] [DecidableRel (LT.lt (α := α))] [DecidableEq α]
(lt_irrefl : ∀ x : α, ¬x < x)
(lt_trans : ∀ {x y z : α}, x < y → y < z → x < z)
(lt_antisymm : ∀ {x y : α}, ¬x < y → ¬y < x → x = y) :
LTCmp (α := α) (compareOfLessAndEq · ·) | { TransCmp.compareOfLessAndEq lt_irrefl lt_trans lt_antisymm with
cmp_iff_lt := compareOfLessAndEq_eq_lt } | theorem | Batteries.LTCmp.compareOfLessAndEq | Classes | Batteries/Classes/Deprecated.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
LTCmp.compareOfLessAndEq_of_le
[LT α] [DecidableRel (LT.lt (α := α))] [DecidableEq α] [LE α]
(lt_irrefl : ∀ x : α, ¬x < x)
(lt_trans : ∀ {x y z : α}, x < y → y < z → x < z)
(not_lt : ∀ {x y : α}, ¬x < y → y ≤ x)
(le_antisymm : ∀ {x y : α}, x ≤ y → y ≤ x → x = y) :
LTCmp (α := α) (compareOfLessAn... | { TransCmp.compareOfLessAndEq_of_le lt_irrefl lt_trans not_lt le_antisymm with
cmp_iff_lt := compareOfLessAndEq_eq_lt } | theorem | Batteries.LTCmp.compareOfLessAndEq_of_le | Classes | Batteries/Classes/Deprecated.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
LECmp.compareOfLessAndEq
[LT α] [DecidableRel (LT.lt (α := α))] [DecidableEq α] [LE α]
(lt_irrefl : ∀ x : α, ¬x < x)
(lt_trans : ∀ {x y z : α}, x < y → y < z → x < z)
(not_lt : ∀ {x y : α}, ¬x < y ↔ y ≤ x)
(le_antisymm : ∀ {x y : α}, x ≤ y → y ≤ x → x = y) :
LECmp (α := α) (compareOfLessAndEq · ... | have := TransCmp.compareOfLessAndEq_of_le lt_irrefl lt_trans not_lt.1 le_antisymm
{ this with
cmp_iff_le := (this.cmp_ne_gt).trans <| (not_congr compareOfLessAndEq_eq_lt).trans not_lt } | theorem | Batteries.LECmp.compareOfLessAndEq | Classes | Batteries/Classes/Deprecated.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
LawfulCmp.compareOfLessAndEq
[LT α] [DecidableRel (LT.lt (α := α))] [DecidableEq α] [BEq α] [LawfulBEq α] [LE α]
(lt_irrefl : ∀ x : α, ¬x < x)
(lt_trans : ∀ {x y z : α}, x < y → y < z → x < z)
(not_lt : ∀ {x y : α}, ¬x < y ↔ y ≤ x)
(le_antisymm : ∀ {x y : α}, x ≤ y → y ≤ x → x = y) :
LawfulCmp (... | { TransCmp.compareOfLessAndEq_of_le lt_irrefl lt_trans not_lt.1 le_antisymm,
LTCmp.compareOfLessAndEq_of_le lt_irrefl lt_trans not_lt.1 le_antisymm,
LECmp.compareOfLessAndEq lt_irrefl lt_trans not_lt le_antisymm,
BEqCmp.compareOfLessAndEq lt_irrefl with } | theorem | Batteries.LawfulCmp.compareOfLessAndEq | Classes | Batteries/Classes/Deprecated.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
LTCmp.eq_compareOfLessAndEq
[LT α] [DecidableEq α] [BEq α] [LawfulBEq α] [BEqCmp cmp] [LTCmp cmp]
(x y : α) [Decidable (x < y)] : cmp x y = compareOfLessAndEq x y | by
simp [compareOfLessAndEq]
split <;> rename_i h1 <;> [skip; split <;> rename_i h2]
· exact LTCmp.cmp_iff_lt.2 h1
· exact BEqCmp.cmp_iff_eq.2 h2
· cases e : cmp x y
· cases h1 (LTCmp.cmp_iff_lt.1 e)
· cases h2 (BEqCmp.cmp_iff_eq.1 e)
· rfl | theorem | Batteries.LTCmp.eq_compareOfLessAndEq | Classes | Batteries/Classes/Deprecated.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
OrientedOrd.instLexOrd [Ord α] [Ord β]
[OrientedOrd α] [OrientedOrd β] : @OrientedOrd (α × β) lexOrd | by
rw [OrientedOrd, lexOrd_def]; infer_instance | theorem | Batteries.OrientedOrd.instLexOrd | Classes | Batteries/Classes/Deprecated.lean | [] | [
"lexOrd_def"
] | Local instance for `OrientedOrd lexOrd`. | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 |
TransOrd.instLexOrd [Ord α] [Ord β]
[TransOrd α] [TransOrd β] : @TransOrd (α × β) lexOrd | by
rw [TransOrd, lexOrd_def]; infer_instance | theorem | Batteries.TransOrd.instLexOrd | Classes | Batteries/Classes/Deprecated.lean | [] | [
"lexOrd_def"
] | Local instance for `TransOrd lexOrd`. | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 |
OrientedOrd.instOpposite [ord : Ord α] [inst : OrientedOrd α] :
@OrientedOrd _ ord.opposite | where symm _ _ := inst.symm .. | theorem | Batteries.OrientedOrd.instOpposite | Classes | Batteries/Classes/Deprecated.lean | [] | [] | Local instance for `OrientedOrd ord.opposite`. | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 |
TransOrd.instOpposite [ord : Ord α] [inst : TransOrd α] : @TransOrd _ ord.opposite | { OrientedOrd.instOpposite with le_trans := fun h1 h2 => inst.le_trans h2 h1 } | theorem | Batteries.TransOrd.instOpposite | Classes | Batteries/Classes/Deprecated.lean | [] | [] | Local instance for `TransOrd ord.opposite`. | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 |
OrientedOrd.instOn [ord : Ord β] [OrientedOrd β] (f : α → β) : @OrientedOrd _ (ord.on f) | inferInstanceAs (@OrientedCmp _ (compareOn f)) | theorem | Batteries.OrientedOrd.instOn | Classes | Batteries/Classes/Deprecated.lean | [] | [] | Local instance for `OrientedOrd (ord.on f)`. | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 |
TransOrd.instOn [ord : Ord β] [TransOrd β] (f : α → β) : @TransOrd _ (ord.on f) | inferInstanceAs (@TransCmp _ (compareOn f)) | theorem | Batteries.TransOrd.instOn | Classes | Batteries/Classes/Deprecated.lean | [] | [] | Local instance for `TransOrd (ord.on f)`. | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 |
OrientedOrd.instOrdLex [oα : Ord α] [oβ : Ord β] [OrientedOrd α] [OrientedOrd β] :
@OrientedOrd _ (oα.lex oβ) | OrientedOrd.instLexOrd | theorem | Batteries.OrientedOrd.instOrdLex | Classes | Batteries/Classes/Deprecated.lean | [] | [] | Local instance for `OrientedOrd (oα.lex oβ)`. | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 |
TransOrd.instOrdLex [oα : Ord α] [oβ : Ord β] [TransOrd α] [TransOrd β] :
@TransOrd _ (oα.lex oβ) | TransOrd.instLexOrd | theorem | Batteries.TransOrd.instOrdLex | Classes | Batteries/Classes/Deprecated.lean | [] | [] | Local instance for `TransOrd (oα.lex oβ)`. | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 |
OrientedOrd.instOrdLex' (ord₁ ord₂ : Ord α) [@OrientedOrd _ ord₁] [@OrientedOrd _ ord₂] :
@OrientedOrd _ (ord₁.lex' ord₂) | inferInstanceAs (OrientedCmp (compareLex ord₁.compare ord₂.compare)) | theorem | Batteries.OrientedOrd.instOrdLex' | Classes | Batteries/Classes/Deprecated.lean | [] | [] | Local instance for `OrientedOrd (oα.lex' oβ)`. | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 |
TransOrd.instOrdLex' (ord₁ ord₂ : Ord α) [@TransOrd _ ord₁] [@TransOrd _ ord₂] :
@TransOrd _ (ord₁.lex' ord₂) | inferInstanceAs (TransCmp (compareLex ord₁.compare ord₂.compare)) | theorem | Batteries.TransOrd.instOrdLex' | Classes | Batteries/Classes/Deprecated.lean | [] | [] | Local instance for `TransOrd (oα.lex' oβ)`. | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 |
lexOrd_def [Ord α] [Ord β] :
(lexOrd : Ord (α × β)).compare = compareLex (compareOn (·.1)) (compareOn (·.2)) | rfl | theorem | lexOrd_def | Classes | Batteries/Classes/Order.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
Ordering.byKey (f : α → β) (cmp : β → β → Ordering) (a b : α) : Ordering | cmp (f a) (f b) | def | Ordering.byKey | Classes | Batteries/Classes/Order.lean | [] | [] | Pull back a comparator by a function `f`, by applying the comparator to both arguments. | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 |
TotalBLE (le : α → α → Bool) : Prop where
/-- `le` is total: either `le a b` or `le b a`. -/
total : le a b ∨ le b a | class | Batteries.TotalBLE | Classes | Batteries/Classes/Order.lean | [] | [] | `TotalBLE le` asserts that `le` has a total order, that is, `le a b ∨ le b a`. | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
compareOfLessAndEq_eq_lt {x y : α} [LT α] [Decidable (x < y)] [DecidableEq α] :
compareOfLessAndEq x y = .lt ↔ x < y | by
simp [compareOfLessAndEq]
split <;> simp | theorem | Batteries.compareOfLessAndEq_eq_lt | Classes | Batteries/Classes/Order.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
le_iff_ge : cmp x y ≠ .gt ↔ cmp y x ≠ .lt | not_congr OrientedCmp.gt_iff_lt | theorem | Std.OrientedCmp.le_iff_ge | Classes | Batteries/Classes/Order.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
le_trans : cmp x y ≠ .gt → cmp y z ≠ .gt → cmp x z ≠ .gt | by
simp only [ne_eq, ← Ordering.isLE_iff_ne_gt]; exact isLE_trans | theorem | Std.TransCmp.le_trans | Classes | Batteries/Classes/Order.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
lt_of_lt_of_le : cmp x y = .lt → cmp y z ≠ .gt → cmp x z = .lt | by
simp only [ne_eq, ← Ordering.isLE_iff_ne_gt]; exact lt_of_lt_of_isLE | theorem | Std.TransCmp.lt_of_lt_of_le | Classes | Batteries/Classes/Order.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
lt_of_le_of_lt : cmp x y ≠ .gt → cmp y z = .lt → cmp x z = .lt | by
simp only [ne_eq, ← Ordering.isLE_iff_ne_gt]; exact lt_of_isLE_of_lt | theorem | Std.TransCmp.lt_of_le_of_lt | Classes | Batteries/Classes/Order.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
ge_trans : cmp x y ≠ .lt → cmp y z ≠ .lt → cmp x z ≠ .lt | by
simp only [ne_eq, ← Ordering.isGE_iff_ne_lt]; exact isGE_trans | theorem | Std.TransCmp.ge_trans | Classes | Batteries/Classes/Order.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
gt_of_gt_of_ge : cmp x y = .gt → cmp y z ≠ .lt → cmp x z = .gt | by
simp only [ne_eq, ← Ordering.isGE_iff_ne_lt]; exact gt_of_gt_of_isGE | theorem | Std.TransCmp.gt_of_gt_of_ge | Classes | Batteries/Classes/Order.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
gt_of_ge_of_gt : cmp x y ≠ .lt → cmp y z = .gt → cmp x z = .gt | by
simp only [ne_eq, ← Ordering.isGE_iff_ne_lt]; exact gt_of_isGE_of_gt | theorem | Std.TransCmp.gt_of_ge_of_gt | Classes | Batteries/Classes/Order.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
LawfulLTCmp [LT α] (cmp : α → α → Ordering) : Prop extends OrientedCmp cmp where
/-- `cmp x y = .lt` holds iff `x < y` is true. -/
eq_lt_iff_lt : cmp x y = .lt ↔ x < y | class | Std.LawfulLTCmp | Classes | Batteries/Classes/Order.lean | [] | [] | `LawfulLTCmp cmp` asserts that `cmp x y = .lt` and `x < y` coincide. | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
LawfulLTCmp.eq_gt_iff_gt [LT α] [LawfulLTCmp (α := α) cmp] :
cmp x y = .gt ↔ y < x | by rw [OrientedCmp.gt_iff_lt, eq_lt_iff_lt] | theorem | Std.LawfulLTCmp.eq_gt_iff_gt | Classes | Batteries/Classes/Order.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
LawfulLECmp [LE α] (cmp : α → α → Ordering) : Prop extends OrientedCmp cmp where
/-- `cmp x y ≠ .gt` holds iff `x ≤ y` is true. -/
isLE_iff_le : (cmp x y).isLE ↔ x ≤ y | class | Std.LawfulLECmp | Classes | Batteries/Classes/Order.lean | [] | [] | `LawfulLECmp cmp` asserts that `(cmp x y).isLE` and `x ≤ y` coincide. | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
LawfulLECmp.isGE_iff_ge [LE α] [LawfulLECmp (α := α) cmp] :
(cmp x y).isGE ↔ y ≤ x | by rw [← Ordering.isLE_swap, ← OrientedCmp.eq_swap, isLE_iff_le] | theorem | Std.LawfulLECmp.isGE_iff_ge | Classes | Batteries/Classes/Order.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
LawfulLECmp.ne_gt_iff_le [LE α] [LawfulLECmp (α := α) cmp] :
cmp x y ≠ .gt ↔ x ≤ y | by rw [← isLE_iff_le (cmp := cmp), Ordering.isLE_iff_ne_gt] | theorem | Std.LawfulLECmp.ne_gt_iff_le | Classes | Batteries/Classes/Order.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
LawfulLECmp.ne_lt_iff_ge [LE α] [LawfulLECmp (α := α) cmp] :
cmp x y ≠ .lt ↔ y ≤ x | by rw [← isGE_iff_ge (cmp := cmp), Ordering.isGE_iff_ne_lt] | theorem | Std.LawfulLECmp.ne_lt_iff_ge | Classes | Batteries/Classes/Order.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
LawfulBCmp [LE α] [LT α] [BEq α] (cmp : α → α → Ordering) : Prop extends
TransCmp cmp, LawfulBEqCmp cmp, LawfulLTCmp cmp, LawfulLECmp cmp | class | Std.LawfulBCmp | Classes | Batteries/Classes/Order.lean | [] | [] | `LawfulBCmp cmp` asserts that the `LE`, `LT`, `BEq` are all coherent with each other
and with `cmp`, describing a strict weak order (a linear order except for antisymmetry). | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
LawfulCmp [LE α] [LT α] (cmp : α → α → Ordering) : Prop extends
TransCmp cmp, LawfulEqCmp cmp, LawfulLTCmp cmp, LawfulLECmp cmp | class | Std.LawfulCmp | Classes | Batteries/Classes/Order.lean | [] | [] | `LawfulBCmp cmp` asserts that the `LE`, `LT`, `Eq` are all coherent with each other
and with `cmp`, describing a linear order. | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
LawfulLTOrd (α) [LT α] [Ord α] | LawfulLTCmp (α := α) compare | abbrev | Std.LawfulLTOrd | Classes | Batteries/Classes/Order.lean | [] | [] | Class for types where the ordering function is compatible with the `LT`. | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 |
LawfulLEOrd (α) [LE α] [Ord α] | LawfulLECmp (α := α) compare | abbrev | Std.LawfulLEOrd | Classes | Batteries/Classes/Order.lean | [] | [] | Class for types where the ordering function is compatible with the `LE`. | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 |
LawfulBOrd (α) [LE α] [LT α] [BEq α] [Ord α] | LawfulBCmp (α := α) compare | abbrev | Std.LawfulBOrd | Classes | Batteries/Classes/Order.lean | [] | [] | Class for types where the ordering function is compatible with the `LE`, `LT` and `BEq`. | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 |
LawfulOrd (α) [LE α] [LT α] [Ord α] | LawfulCmp (α := α) compare | abbrev | Std.LawfulOrd | Classes | Batteries/Classes/Order.lean | [] | [] | Class for types where the ordering function is compatible with the `LE`, `LT` and `Eq`. | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 |
LawfulLTCmp.eq_compareOfLessAndEq
[LT α] [DecidableEq α] [LawfulEqCmp cmp] [LawfulLTCmp cmp]
(x y : α) [Decidable (x < y)] : cmp x y = compareOfLessAndEq x y | by
simp only [compareOfLessAndEq]
split <;> rename_i h1 <;> [skip; split <;> rename_i h2]
· exact LawfulLTCmp.eq_lt_iff_lt.2 h1
· exact LawfulEqCmp.compare_eq_iff_eq.2 h2
· cases e : cmp x y
· cases h1 (LawfulLTCmp.eq_lt_iff_lt.1 e)
· cases h2 (LawfulEqCmp.compare_eq_iff_eq.1 e)
· rfl | theorem | Std.LawfulLTCmp.eq_compareOfLessAndEq | Classes | Batteries/Classes/Order.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
ReflCmp.compareOfLessAndEq_of_lt_irrefl [LT α] [DecidableLT α] [DecidableEq α]
(lt_irrefl : ∀ x : α, ¬ x < x) :
ReflCmp (α := α) (compareOfLessAndEq · ·) | where
compare_self {x} := by simp [compareOfLessAndEq, if_neg (lt_irrefl x)] | theorem | Std.ReflCmp.compareOfLessAndEq_of_lt_irrefl | Classes | Batteries/Classes/Order.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
LawfulBEqCmp.compareOfLessAndEq_of_lt_irrefl
[LT α] [DecidableLT α] [DecidableEq α] [BEq α] [LawfulBEq α]
(lt_irrefl : ∀ x : α, ¬x < x) :
LawfulBEqCmp (α := α) (compareOfLessAndEq · ·) | where
compare_eq_iff_beq {x y} := by
simp [compareOfLessAndEq]
split <;> [skip; split] <;> simp [*]
rintro rfl; exact lt_irrefl _ ‹_› | theorem | Std.LawfulBEqCmp.compareOfLessAndEq_of_lt_irrefl | Classes | Batteries/Classes/Order.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
TransCmp.compareOfLessAndEq_of_irrefl_of_trans_of_antisymm
[LT α] [DecidableLT α] [DecidableEq α]
(lt_irrefl : ∀ x : α, ¬x < x)
(lt_trans : ∀ {x y z : α}, x < y → y < z → x < z)
(lt_antisymm : ∀ {x y : α}, ¬x < y → ¬y < x → x = y) :
TransCmp (α := α) (compareOfLessAndEq · ·) | TransOrd.compareOfLessAndEq_of_lt_trans_of_lt_iff lt_trans <| by
intros
constructor
· intro h₁
constructor
· intro h₂
apply lt_irrefl
exact lt_trans h₁ h₂
· intro | rfl => exact lt_irrefl _ h₁
· intro ⟨h₁, h₂⟩
by_contra h₃
apply h₂
exact lt_antisymm h₃... | theorem | Std.TransCmp.compareOfLessAndEq_of_irrefl_of_trans_of_antisymm | Classes | Batteries/Classes/Order.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
TransCmp.compareOfLessAndEq_of_irrefl_of_trans_of_not_lt_of_antisymm
[LT α] [LE α] [DecidableLT α] [DecidableEq α]
(lt_irrefl : ∀ x : α, ¬x < x)
(lt_trans : ∀ {x y z : α}, x < y → y < z → x < z)
(not_lt : ∀ {x y : α}, ¬x < y → y ≤ x)
(le_antisymm : ∀ {x y : α}, x ≤ y → y ≤ x → x = y) :
TransCmp ... | .compareOfLessAndEq_of_irrefl_of_trans_of_antisymm
lt_irrefl lt_trans fun xy yx => le_antisymm (not_lt yx) (not_lt xy) | theorem | Std.TransCmp.compareOfLessAndEq_of_irrefl_of_trans_of_not_lt_of_antisymm | Classes | Batteries/Classes/Order.lean | [] | [] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
LawfulLTCmp.compareOfLessAndEq_of_irrefl_of_trans_of_antisymm
[LT α] [DecidableLT α] [DecidableEq α]
(lt_irrefl : ∀ x : α, ¬x < x)
(lt_trans : ∀ {x y z : α}, x < y → y < z → x < z)
(lt_antisymm : ∀ {x y : α}, ¬x < y → ¬y < x → x = y) :
LawfulLTCmp (α := α) (compareOfLessAndEq · ·) | { TransCmp.compareOfLessAndEq_of_irrefl_of_trans_of_antisymm
lt_irrefl lt_trans lt_antisymm with
eq_lt_iff_lt := Batteries.compareOfLessAndEq_eq_lt } | theorem | Std.LawfulLTCmp.compareOfLessAndEq_of_irrefl_of_trans_of_antisymm | Classes | Batteries/Classes/Order.lean | [] | [
"Batteries.compareOfLessAndEq_eq_lt"
] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
LawfulLTCmp.compareOfLessAndEq_of_irrefl_of_trans_of_not_lt_of_antisymm
[LT α] [DecidableLT α] [DecidableEq α] [LE α]
(lt_irrefl : ∀ x : α, ¬x < x)
(lt_trans : ∀ {x y z : α}, x < y → y < z → x < z)
(not_lt : ∀ {x y : α}, ¬x < y → y ≤ x)
(le_antisymm : ∀ {x y : α}, x ≤ y → y ≤ x → x = y) :
Lawful... | { TransCmp.compareOfLessAndEq_of_irrefl_of_trans_of_not_lt_of_antisymm
lt_irrefl lt_trans not_lt le_antisymm with
eq_lt_iff_lt := Batteries.compareOfLessAndEq_eq_lt } | theorem | Std.LawfulLTCmp.compareOfLessAndEq_of_irrefl_of_trans_of_not_lt_of_antisymm | Classes | Batteries/Classes/Order.lean | [] | [
"Batteries.compareOfLessAndEq_eq_lt"
] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 | |
LawfulLECmp.compareOfLessAndEq_of_irrefl_of_trans_of_not_lt_of_antisymm
[LT α] [DecidableLT α] [DecidableEq α] [LE α]
(lt_irrefl : ∀ x : α, ¬x < x)
(lt_trans : ∀ {x y z : α}, x < y → y < z → x < z)
(not_lt : ∀ {x y : α}, ¬x < y ↔ y ≤ x)
(le_antisymm : ∀ {x y : α}, x ≤ y → y ≤ x → x = y) :
Lawful... | have := TransCmp.compareOfLessAndEq_of_irrefl_of_trans_of_not_lt_of_antisymm
lt_irrefl lt_trans not_lt.1 le_antisymm
{ this with
isLE_iff_le := by
intro x y
simp only [Ordering.isLE_iff_ne_gt, ← not_lt]
apply not_congr
rw [this.gt_iff_lt, Batteries.compareOfLessAndEq_eq_lt] } | theorem | Std.LawfulLECmp.compareOfLessAndEq_of_irrefl_of_trans_of_not_lt_of_antisymm | Classes | Batteries/Classes/Order.lean | [] | [
"Batteries.compareOfLessAndEq_eq_lt"
] | https://github.com/leanprover-community/batteries | 41680f5d84023c7406c841d08ef83bf15a9782a6 |
Structured dataset from Lean 4 Batteries - the community standard library extensions.
41680f5d84023c7406c841d08ef83bf15a9782a6| Column | Type | Description |
|---|---|---|
| statement | string | Declaration signature/claim with the leading keyword removed (verbatim slice); the full declaration minus its proof |
| proof | string | Verbatim proof/body, empty if the declaration has none |
| type | string | Declaration keyword |
| symbolic_name | string | Declaration identifier |
| library | string | Sub-library |
| filename | string | Repository-relative source path |
| imports | list[string] | File-level Require/Import modules |
| deps | list[string] | Intra-corpus identifiers referenced |
| docstring | string | Preceding documentation comment, empty if absent |
| source_url | string | Upstream repository |
| commit | string | Upstream commit extracted |
| Type | Count |
|---|---|
| theorem | 1,874 |
| def | 1,005 |
| abbrev | 48 |
| structure | 37 |
| elab | 30 |
| inductive | 24 |
| class | 22 |
| macro | 11 |
| instance | 9 |
| opaque | 1 |
Function.id_def : @id α = fun x => x
rfl
/-! ## decidable -/
protected alias ⟨Decidable.exists_not_of_not_forall, _⟩ := Decidable.not_forall
Function.id_def | Batteries/Logic.leanEach declaration is split into a statement (signature/claim) and a proof (body) that are disjoint
and together form the complete declaration, for proof modeling, autoformalization, retrieval, and
dependency analysis via deps.
@misc{lean4_batteries_dataset,
title = {Lean4-Batteries},
author = {Norton, Charles},
year = {2026},
note = {Extracted from https://github.com/leanprover-community/batteries, commit 41680f5d8402},
url = {https://huggingface.co/datasets/phanerozoic/Lean4-Batteries}
}