Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 23eac53

Browse files
urkudbryangingechenVierkantor
committed
chore(*): upgrade to Lean 3.33.0c (#9165)
My main goal is to fix various diamonds with `sup`/`inf`, see leanprover-community/lean#609. I use lean-master + 1 fixup commit leanprover-community/lean#615. Co-authored-by: Bryan Gin-ge Chen <bryangingechen@gmail.com> Co-authored-by: Vierkantor <vierkantor@vierkantor.com>
1 parent 82dced6 commit 23eac53

File tree

25 files changed

+113
-129
lines changed

25 files changed

+113
-129
lines changed

leanpkg.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "mathlib"
33
version = "0.1"
4-
lean_version = "leanprover-community/lean:3.32.1"
4+
lean_version = "leanprover-community/lean:3.33.0"
55
path = "src"
66

77
[dependencies]

src/algebra/ordered_monoid.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,14 +176,14 @@ linear_order.lift coe units.ext
176176
@[simp, norm_cast, to_additive]
177177
theorem max_coe [monoid α] [linear_order α] {a b : units α} :
178178
(↑(max a b) : α) = max a b :=
179-
by by_cases b ≤ a; simp [max, h]
179+
by by_cases b ≤ a; simp [max_def, h]
180180

181181
attribute [norm_cast] add_units.max_coe
182182

183183
@[simp, norm_cast, to_additive]
184184
theorem min_coe [monoid α] [linear_order α] {a b : units α} :
185185
(↑(min a b) : α) = min a b :=
186-
by by_cases a ≤ b; simp [min, h]
186+
by by_cases a ≤ b; simp [min_def, h]
187187

188188
attribute [norm_cast] add_units.min_coe
189189

src/data/bool.lean

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,6 @@ lemma bxor_iff_ne : ∀ {x y : bool}, bxor x y = tt ↔ x ≠ y := dec_trivial
150150

151151
lemma bnot_inj : ∀ {a b : bool}, !a = !b → a = b := dec_trivial
152152

153-
end bool
154-
155153
instance : linear_order bool :=
156154
{ le := λ a b, a = ff ∨ b = tt,
157155
le_refl := dec_trivial,
@@ -160,9 +158,11 @@ instance : linear_order bool :=
160158
le_total := dec_trivial,
161159
decidable_le := infer_instance,
162160
decidable_eq := infer_instance,
163-
decidable_lt := infer_instance }
164-
165-
namespace bool
161+
decidable_lt := infer_instance,
162+
max := bor,
163+
max_def := by { funext x y, revert x y, exact dec_trivial },
164+
min := band,
165+
min_def := by { funext x y, revert x y, exact dec_trivial } }
166166

167167
@[simp] lemma ff_le {x : bool} : ff ≤ x := or.intro_left _ rfl
168168

src/data/finsupp/lattice.lean

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,7 @@ lemma support_inf {f g : α →₀ γ} : (f ⊓ g).support = f.support ∩ g.sup
3737
begin
3838
ext, simp only [inf_apply, mem_support_iff, ne.def,
3939
finset.mem_union, finset.mem_filter, finset.mem_inter],
40-
rw [← decidable.not_or_iff_and_not, ← not_congr],
41-
rw inf_eq_min, unfold min, split_ifs;
42-
{ try {apply or_iff_left_of_imp}, try {apply or_iff_right_of_imp}, intro con, rw con at h,
43-
revert h, simp, }
40+
simp only [inf_eq_min, ← nonpos_iff_eq_zero, min_le_iff, not_or_distrib]
4441
end
4542

4643
instance [semilattice_sup β] : semilattice_sup (α →₀ β) :=

src/data/list/func.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def sub {α : Type u} [has_zero α] [has_sub α] : list α → list α → list
8383
/- set -/
8484

8585
lemma length_set : ∀ {m : ℕ} {as : list α},
86-
(as {m ↦ a}).length = _root_.max as.length (m+1)
86+
(as {m ↦ a}).length = max as.length (m+1)
8787
| 0 [] := rfl
8888
| 0 (a::as) := by {rw max_eq_left, refl, simp [nat.le_add_right]}
8989
| (m+1) [] := by simp only [set, nat.zero_max, length, @length_set m]
@@ -278,7 +278,7 @@ lemma get_pointwise [inhabited γ] {f : α → β → γ} (h1 : f (default α) (
278278

279279
lemma length_pointwise {f : α → β → γ} :
280280
∀ {as : list α} {bs : list β},
281-
(pointwise f as bs).length = _root_.max as.length bs.length
281+
(pointwise f as bs).length = max as.length bs.length
282282
| [] [] := rfl
283283
| [] (b::bs) :=
284284
by simp only [pointwise, length, length_map,
@@ -301,7 +301,7 @@ by {apply get_pointwise, apply zero_add}
301301

302302
@[simp] lemma length_add {α : Type u}
303303
[has_zero α] [has_add α] {xs ys : list α} :
304-
(add xs ys).length = _root_.max xs.length ys.length :=
304+
(add xs ys).length = max xs.length ys.length :=
305305
@length_pointwise α α α ⟨0⟩ ⟨0⟩ _ _ _
306306

307307
@[simp] lemma nil_add {α : Type u} [add_monoid α]
@@ -349,7 +349,7 @@ end
349349
by {apply get_pointwise, apply sub_zero}
350350

351351
@[simp] lemma length_sub [has_zero α] [has_sub α] {xs ys : list α} :
352-
(sub xs ys).length = _root_.max xs.length ys.length :=
352+
(sub xs ys).length = max xs.length ys.length :=
353353
@length_pointwise α α α ⟨0⟩ ⟨0⟩ _ _ _
354354

355355
@[simp] lemma nil_sub {α : Type} [add_group α]

src/data/list/intervals.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ begin
160160
{ rw [eq_nil_of_le hml, filter_le_of_top_le hml] }
161161
end
162162

163-
@[simp] lemma filter_le (n m l : ℕ) : (Ico n m).filter (λ x, l ≤ x) = Ico (_root_.max n l) m :=
163+
@[simp] lemma filter_le (n m l : ℕ) : (Ico n m).filter (λ x, l ≤ x) = Ico (max n l) m :=
164164
begin
165165
cases le_total n l with hnl hln,
166166
{ rw [max_eq_right hnl, filter_le_of_le hnl] },

src/data/list/min_max.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ begin
242242
{ rw [max_eq_left], refl, exact bot_le },
243243
change (coe : α → with_bot α) with some,
244244
rw [max_comm],
245-
simp [max]
245+
simp [max_def]
246246
end
247247

248248
theorem minimum_concat (a : α) (l : list α) : minimum (l ++ [a]) = min (minimum l) a :=

src/data/nat/cast.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,11 @@ end
204204

205205
@[simp, norm_cast] theorem cast_min [linear_ordered_semiring α] {a b : ℕ} :
206206
(↑(min a b) : α) = min a b :=
207-
by by_cases a ≤ b; simp [h, min]
207+
(@mono_cast α _).map_min
208208

209209
@[simp, norm_cast] theorem cast_max [linear_ordered_semiring α] {a b : ℕ} :
210210
(↑(max a b) : α) = max a b :=
211-
by by_cases a ≤ b; simp [h, max]
211+
(@mono_cast α _).map_max
212212

213213
@[simp, norm_cast] theorem abs_cast [linear_ordered_ring α] (a : ℕ) :
214214
abs (a : α) = a :=

src/data/polynomial/degree/definitions.lean

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -442,9 +442,8 @@ lemma degree_le_zero_iff : degree p ≤ 0 ↔ p = C (coeff p 0) :=
442442

443443
lemma degree_add_le (p q : polynomial R) : degree (p + q) ≤ max (degree p) (degree q) :=
444444
calc degree (p + q) = ((p + q).support).sup some : rfl
445-
... ≤ (p.support ∪ q.support).sup some : by convert sup_mono support_add
446-
... = p.support.sup some ⊔ q.support.sup some : by convert sup_union
447-
... = _ : with_bot.sup_eq_max _ _
445+
... ≤ (p.support ∪ q.support).sup some : sup_mono support_add
446+
... = p.support.sup some ⊔ q.support.sup some : sup_union
448447

449448
lemma nat_degree_add_le (p q : polynomial R) :
450449
nat_degree (p + q) ≤ max (nat_degree p) (nat_degree q) :=
@@ -525,7 +524,7 @@ finset.induction_on s (by simp only [sum_empty, sup_empty, degree_zero, le_refl]
525524
assume a s has ih,
526525
calc degree (∑ i in insert a s, f i) ≤ max (degree (f a)) (degree (∑ i in s, f i)) :
527526
by rw sum_insert has; exact degree_add_le _ _
528-
... ≤ _ : by rw [sup_insert, with_bot.sup_eq_max]; exact max_le_max (le_refl _) ih
527+
... ≤ _ : by rw [sup_insert, sup_eq_max]; exact max_le_max le_rfl ih
529528

530529
lemma degree_mul_le (p q : polynomial R) : degree (p * q) ≤ degree p + degree q :=
531530
calc degree (p * q) ≤ (p.support).sup (λi, degree (sum q (λj a, C (coeff p i * a) * X ^ (i + j)))) :
@@ -851,8 +850,7 @@ begin
851850
haveI : is_associative (with_bot ℕ) max := ⟨max_assoc⟩,
852851
calc (∑ i, C (f i) * X ^ (i : ℕ)).degree
853852
≤ finset.univ.fold (⊔) ⊥ (λ i, (C (f i) * X ^ (i : ℕ)).degree) : degree_sum_le _ _
854-
... = finset.univ.fold max ⊥ (λ i, (C (f i) * X ^ (i : ℕ)).degree) :
855-
(@finset.fold_hom _ _ _ (⊔) _ _ _ ⊥ finset.univ _ _ _ id (with_bot.sup_eq_max)).symm
853+
... = finset.univ.fold max ⊥ (λ i, (C (f i) * X ^ (i : ℕ)).degree) : rfl
856854
... < n : (finset.fold_max_lt (n : with_bot ℕ)).mpr ⟨with_bot.bot_lt_coe _, _⟩,
857855

858856
rintros ⟨i, hi⟩ -,

src/data/rat/cast.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,11 +230,11 @@ by rw [← cast_zero, cast_lt]
230230

231231
@[simp, norm_cast] theorem cast_min [linear_ordered_field α] {a b : ℚ} :
232232
(↑(min a b) : α) = min a b :=
233-
by by_cases a ≤ b; simp [h, min]
233+
by by_cases a ≤ b; simp [h, min_def]
234234

235235
@[simp, norm_cast] theorem cast_max [linear_ordered_field α] {a b : ℚ} :
236236
(↑(max a b) : α) = max a b :=
237-
by by_cases b ≤ a; simp [h, max]
237+
by by_cases b ≤ a; simp [h, max_def]
238238

239239
@[simp, norm_cast] theorem cast_abs [linear_ordered_field α] {q : ℚ} :
240240
((abs q : ℚ) : α) = abs q :=

0 commit comments

Comments
 (0)