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

Commit 81f97bd

Browse files
jcommelinbryangingechengebner
committed
chore(*): move to lean-3.11.0 (#2632)
Related Zulip thread: https://leanprover.zulipchat.com/#narrow/stream/144837-PR-reviews/topic/lean.23211.20don't.20unfold.20irred.20defs Co-authored-by: Bryan Gin-ge Chen <bryangingechen@gmail.com> Co-authored-by: Gabriel Ebner <gebner@gebner.org>
1 parent a584d52 commit 81f97bd

File tree

15 files changed

+65
-50
lines changed

15 files changed

+65
-50
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.10.0"
4+
lean_version = "leanprover-community/lean:3.11.0"
55
path = "src"
66

77
[dependencies]

src/algebra/opposites.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ instance [zero_ne_one_class α] : zero_ne_one_class (opposite α) :=
113113
.. opposite.has_zero α, .. opposite.has_one α }
114114

115115
instance [integral_domain α] : integral_domain (opposite α) :=
116-
{ eq_zero_or_eq_zero_of_mul_eq_zero := λ x y (H : op _ = op (0:α)),
116+
{ eq_zero_or_eq_zero_of_mul_eq_zero := λ x y (H : op (_ * _) = op (0:α)),
117117
or.cases_on (eq_zero_or_eq_zero_of_mul_eq_zero $ op_inj H)
118118
(λ hy, or.inr $ unop_inj $ hy) (λ hx, or.inl $ unop_inj $ hx),
119119
.. opposite.comm_ring α, .. opposite.zero_ne_one_class α }

src/category_theory/limits/shapes/constructions/limits_of_products_and_equalizers.lean

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ the original diagram `F`. -/
7373
simpa only [limit.lift_π, fan.mk_π_app, category.assoc, category.id_comp] using t,
7474
end }, }.
7575

76+
local attribute [semireducible] op unop opposite
77+
7678
/-- The morphism from cones over the original diagram `F` to cones over the walking pair diagram
7779
`diagram F`. -/
7880
@[simp] def cones_inv : F.cones ⟶ (diagram F).cones :=

src/category_theory/opposites.lean

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,8 @@ variables {D : Type u₂} [category.{v₂} D]
181181
section
182182
variables {F G : C ⥤ D}
183183

184+
local attribute [semireducible] has_hom.opposite
185+
184186
@[simps] protected definition op (α : F ⟶ G) : G.op ⟶ F.op :=
185187
{ app := λ X, (α.app (unop X)).op,
186188
naturality' := begin tidy, erw α.naturality, refl, end }
@@ -189,7 +191,14 @@ variables {F G : C ⥤ D}
189191

190192
@[simps] protected definition unop (α : F.op ⟶ G.op) : G ⟶ F :=
191193
{ app := λ X, (α.app (op X)).unop,
192-
naturality' := begin tidy, erw α.naturality, refl, end }
194+
naturality' :=
195+
begin
196+
intros X Y f,
197+
have := congr_arg has_hom.hom.op (α.naturality f.op),
198+
dsimp at this,
199+
erw this,
200+
refl,
201+
end }
193202

194203
@[simp] lemma unop_id (F : C ⥤ D) : nat_trans.unop (𝟙 F.op) = 𝟙 F := rfl
195204

@@ -198,6 +207,8 @@ end
198207
section
199208
variables {F G : C ⥤ Dᵒᵖ}
200209

210+
local attribute [semireducible] has_hom.opposite
211+
201212
protected definition left_op (α : F ⟶ G) : G.left_op ⟶ F.left_op :=
202213
{ app := λ X, (α.app (unop X)).unop,
203214
naturality' := begin tidy, erw α.naturality, refl, end }
@@ -208,7 +219,13 @@ rfl
208219

209220
protected definition right_op (α : F.left_op ⟶ G.left_op) : G ⟶ F :=
210221
{ app := λ X, (α.app (op X)).op,
211-
naturality' := begin tidy, erw α.naturality, refl, end }
222+
naturality' :=
223+
begin
224+
intros X Y f,
225+
have := congr_arg has_hom.hom.op (α.naturality f.op),
226+
dsimp at this,
227+
erw this
228+
end }
212229

213230
@[simp] lemma right_op_app (α : F.left_op ⟶ G.left_op) (X) :
214231
(nat_trans.right_op α).app X = (α.app (op X)).op :=

src/category_theory/yoneda.lean

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ by obviously
4747

4848
@[simp] lemma naturality {X Y : C} (α : yoneda.obj X ⟶ yoneda.obj Y)
4949
{Z Z' : C} (f : Z ⟶ Z') (h : Z' ⟶ X) : f ≫ α.app (op Z') h = α.app (op Z) (f ≫ h) :=
50-
begin erw [functor_to_types.naturality], refl end
50+
(functor_to_types.naturality _ _ α f.op h).symm
5151

5252
instance yoneda_full : full (@yoneda C _) :=
5353
{ preimage := λ X Y f, (f.app (op X)) (𝟙 X) }
@@ -144,11 +144,8 @@ def yoneda_lemma : yoneda_pairing C ≅ yoneda_evaluation C :=
144144
naturality' :=
145145
begin
146146
intros X Y f, ext, dsimp,
147-
erw [category.id_comp,
148-
←functor_to_types.naturality,
149-
obj_map_id,
150-
functor_to_types.naturality,
151-
functor_to_types.map_id_apply]
147+
erw [category.id_comp, ←functor_to_types.naturality],
148+
simp only [category.comp_id, yoneda_obj_map],
152149
end },
153150
inv :=
154151
{ app := λ F x,
@@ -167,10 +164,9 @@ def yoneda_lemma : yoneda_pairing C ≅ yoneda_evaluation C :=
167164
begin
168165
ext, dsimp,
169166
erw [←functor_to_types.naturality,
170-
obj_map_id,
171-
functor_to_types.naturality,
172-
functor_to_types.map_id_apply],
173-
refl,
167+
obj_map_id],
168+
simp only [yoneda_map_app, has_hom.hom.unop_op],
169+
erw [category.id_comp],
174170
end,
175171
inv_hom_id' :=
176172
begin

src/data/array/lemmas.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ heq_of_heq_of_eq
191191
d_array.ext $ λ ⟨i, h⟩, to_list_nth_le i h _
192192

193193
@[simp] theorem to_array_to_list (l : list α) : l.to_array.to_list = l :=
194-
list.ext_le (to_list_length _) $ λ n h1 h2, to_list_nth_le _ _ _
194+
list.ext_le (to_list_length _) $ λ n h1 h2, to_list_nth_le _ h2 _
195195

196196
end to_array
197197

src/data/complex/basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ by simpa using @conj_inj z 0
133133

134134
lemma eq_conj_iff_real {z : ℂ} : conj z = z ↔ ∃ r : ℝ, z = r :=
135135
⟨λ h, ⟨z.re, ext rfl $ eq_zero_of_neg_eq (congr_arg im h)⟩,
136-
λ ⟨h, e⟩, e.symm ▸ rfl
136+
λ ⟨h, e⟩, by rw [e, conj_of_real]
137137

138138
lemma eq_conj_iff_re {z : ℂ} : conj z = z ↔ (z.re : ℂ) = z :=
139139
eq_conj_iff_real.trans ⟨by rintro ⟨r, rfl⟩; simp, λ h, ⟨_, h.symm⟩⟩

src/data/padics/padic_norm.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ by simp [hq, padic_norm]
276276
The p-adic norm is nonnegative.
277277
-/
278278
protected lemma nonneg (q : ℚ) : 0 ≤ padic_norm p q :=
279-
if hq : q = 0 then by simp [hq]
279+
if hq : q = 0 then by simp [hq, padic_norm]
280280
else
281281
begin
282282
unfold padic_norm; split_ifs,
@@ -356,7 +356,7 @@ eq_div_of_mul_eq _ _ (padic_norm.nonzero _ hr) (by rw [←padic_norm.mul, div_mu
356356
The p-adic norm of an integer is at most 1.
357357
-/
358358
protected theorem of_int (z : ℤ) : padic_norm p ↑z ≤ 1 :=
359-
if hz : z = 0 then by simp [hz] else
359+
if hz : z = 0 then by simp [hz, zero_le_one] else
360360
begin
361361
unfold padic_norm,
362362
rw [if_neg _],

src/data/pfun.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ eq_some_iff.2 $ mem_map f $ mem_some _
203203

204204
theorem mem_assert {p : Prop} {f : p → roption α}
205205
: ∀ {a} (h : p), a ∈ f h → a ∈ assert p f
206-
| _ _ ⟨h, rfl⟩ := ⟨⟨_, _⟩, rfl⟩
206+
| _ x ⟨h, rfl⟩ := ⟨⟨x, h⟩, rfl⟩
207207

208208
@[simp] theorem mem_assert_iff {p : Prop} {f : p → roption α} {a} :
209209
a ∈ assert p f ↔ ∃ h : p, a ∈ f h :=
@@ -212,7 +212,7 @@ theorem mem_assert {p : Prop} {f : p → roption α}
212212

213213
theorem mem_bind {f : roption α} {g : α → roption β} :
214214
∀ {a b}, a ∈ f → b ∈ g a → b ∈ f.bind g
215-
| _ _ ⟨h, rfl⟩ ⟨h₂, rfl⟩ := ⟨⟨_, _⟩, rfl⟩
215+
| _ _ ⟨h, rfl⟩ ⟨h₂, rfl⟩ := ⟨⟨h, h₂⟩, rfl⟩
216216

217217
@[simp] theorem mem_bind_iff {f : roption α} {g : α → roption β} {b} :
218218
b ∈ f.bind g ↔ ∃ a ∈ f, b ∈ g a :=

src/data/polynomial.lean

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1835,7 +1835,7 @@ begin
18351835
exact multiplicity.is_greatest'
18361836
(multiplicity_finite_of_degree_pos_of_monic
18371837
(show (0 : with_bot ℕ) < degree (X - C a),
1838-
by rw degree_X_sub_C; exact dec_trivial) _ hp)
1838+
by rw degree_X_sub_C; exact dec_trivial) (monic_X_sub_C _) hp)
18391839
(nat.lt_succ_self _) (dvd_of_mul_right_eq _ this)
18401840
end
18411841

@@ -2524,7 +2524,7 @@ begin
25242524
{ symmetry, apply finsupp.sum_mul }
25252525
end
25262526

2527-
def pow_sub_pow_factor (x y : R) : Π {i : ℕ},{z : R // x^i - y^i = z*(x - y)}
2527+
def pow_sub_pow_factor (x y : R) : Π (i : ℕ), {z : R // x^i - y^i = z * (x - y)}
25282528
| 0 := ⟨0, by simp⟩
25292529
| 1 := ⟨1, by simp⟩
25302530
| (k+2) :=
@@ -2538,18 +2538,15 @@ def pow_sub_pow_factor (x y : R) : Π {i : ℕ},{z : R // x^i - y^i = z*(x - y)}
25382538
end
25392539

25402540
def eval_sub_factor (f : polynomial R) (x y : R) :
2541-
{z : R // f.eval x - f.eval y = z*(x - y)} :=
2541+
{z : R // f.eval x - f.eval y = z * (x - y)} :=
25422542
begin
2543-
existsi f.sum (λ a b, b * (pow_sub_pow_factor x y).val),
2544-
unfold eval eval₂,
2545-
rw [←finsupp.sum_sub],
2546-
have : finsupp.sum f (λ (a : ℕ) (b : R), b * (pow_sub_pow_factor x y).val) * (x - y) =
2547-
finsupp.sum f (λ (a : ℕ) (b : R), b * (pow_sub_pow_factor x y).val * (x - y)),
2548-
{ apply finsupp.sum_mul },
2549-
rw this,
2550-
congr, ext e a,
2551-
rw [mul_assoc, ←(pow_sub_pow_factor x y).property],
2552-
simp [mul_sub]
2543+
refine ⟨f.sum (λ i r, r * (pow_sub_pow_factor x y i).val), _⟩,
2544+
delta eval eval₂,
2545+
rw ← finsupp.sum_sub,
2546+
rw finsupp.sum_mul,
2547+
delta finsupp.sum,
2548+
congr, ext i r, dsimp,
2549+
rw [mul_assoc, ←(pow_sub_pow_factor x y _).property, mul_sub],
25532550
end
25542551

25552552
end identities

0 commit comments

Comments
 (0)