File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -55,8 +55,8 @@ theorem isSome_min?_of_mem {l : List α} [Min α] {a : α} (h : a ∈ l) :
5555 l.min?.isSome := by
5656 cases l <;> simp_all [min?_cons']
5757
58- theorem isSome_min?_of_ne_nil [Min α] {l : List α} (hl : l ≠ []) : l.min?.isSome := by
59- rwa [isSome_min?_iff ]
58+ theorem isSome_min?_of_ne_nil [Min α] : {l : List α} → (hl : l ≠ []) → l.min?.isSome
59+ | x::xs, h => by simp [min?_cons' ]
6060
6161theorem min?_eq_head? {α : Type u} [Min α] {l : List α}
6262 (h : l.Pairwise (fun a b => min a b = a)) : l.min? = l.head? := by
@@ -250,8 +250,8 @@ theorem isSome_max?_of_mem {l : List α} [Max α] {a : α} (h : a ∈ l) :
250250 l.max?.isSome := by
251251 cases l <;> simp_all [max?_cons']
252252
253- theorem isSome_max?_of_ne_nil [Max α] {l : List α} (hl : l ≠ []) : l.max?.isSome := by
254- rwa [isSome_max?_iff ]
253+ theorem isSome_max?_of_ne_nil [Max α] : {l : List α} → (hl : l ≠ []) → l.max?.isSome
254+ | x::xs, h => by simp [max?_cons' ]
255255
256256theorem max?_eq_head? {α : Type u} [Max α] {l : List α}
257257 (h : l.Pairwise (fun a b => max a b = a)) : l.max? = l.head? := by
Original file line number Diff line number Diff line change @@ -104,6 +104,12 @@ theorem div_add_le_right {z : Nat} (h : 0 < z) (x y : Nat) :
104104 x / (y + z) ≤ x / z :=
105105 div_le_div_left (Nat.le_add_left z y) h
106106
107+ theorem div_add_div_le_add_div {x y z : Nat} : x / z + y / z ≤ (x + y) / z := by
108+ by_cases hc : z > 0
109+ · rw [Nat.le_div_iff_mul_le hc, Nat.add_mul]
110+ apply Nat.add_le_add <;> apply Nat.div_mul_le_self
111+ · simp_all
112+
107113theorem succ_div_of_dvd {a b : Nat} (h : b ∣ a + 1 ) :
108114 (a + 1 ) / b = a / b + 1 := by
109115 replace h := mod_eq_zero_of_dvd h
You can’t perform that action at this time.
0 commit comments