Skip to content

Commit

Permalink
chore: backports for leanprover/lean4#4814 (#894)
Browse files Browse the repository at this point in the history
  • Loading branch information
kim-em authored Jul 31, 2024
1 parent 3dfb59c commit f96a8aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Batteries/Classes/Order.lean
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ theorem cmp_congr_left (xy : cmp x y = .eq) : cmp x z = cmp y z :=
theorem cmp_congr_left' (xy : cmp x y = .eq) : cmp x = cmp y :=
funext fun _ => cmp_congr_left xy

theorem cmp_congr_right [TransCmp cmp] (yz : cmp y z = .eq) : cmp x y = cmp x z := by
theorem 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]

end TransCmp
Expand Down
5 changes: 3 additions & 2 deletions Batteries/Data/List/Lemmas.lean
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@ section union

variable [BEq α]

theorem union_def [BEq α] (l₁ l₂ : List α) : l₁ ∪ l₂ = foldr .insert l₂ l₁ := rfl
theorem union_def (l₁ l₂ : List α) : l₁ ∪ l₂ = foldr .insert l₂ l₁ := rfl

@[simp] theorem nil_union (l : List α) : nil ∪ l = l := by simp [List.union_def, foldr]

Expand Down Expand Up @@ -977,10 +977,11 @@ theorem forIn_eq_bindList [Monad m] [LawfulMonad m]

section Diff
variable [BEq α]
variable [LawfulBEq α]

@[simp] theorem diff_nil (l : List α) : l.diff [] = l := rfl

variable [LawfulBEq α]

@[simp] theorem diff_cons (l₁ l₂ : List α) (a : α) : l₁.diff (a :: l₂) = (l₁.erase a).diff l₂ := by
simp_all [List.diff, erase_of_not_mem]

Expand Down

0 comments on commit f96a8aa

Please sign in to comment.