-
Notifications
You must be signed in to change notification settings - Fork 297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Merged by Bors] - chore(*): update to lean 3.15.0 #2851
Conversation
It'd be nice to add tactic docs for all the new stuff in core like |
@@ -92,5 +92,5 @@ def conditionally_complete_lattice.copy (c : conditionally_complete_lattice α) | |||
conditionally_complete_lattice α := | |||
begin | |||
refine { le := le, sup := sup, inf := inf, Sup := Sup, Inf := Inf, ..}, | |||
all_goals { subst_vars, unfreezeI, cases c, assumption } | |||
all_goals { abstract { subst_vars, unfreezeI, cases c, assumption } } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me quickly explain the cause of this timeout before I forget it. With the new structure instances, terms contain the unreduced fields, e.g. (≤)
. In particular, these fields now contain a full copy of the structure as it is stated in the definition. For example antisymmetry is stated in terms of a preorder:
∀ (a b : α),
@has_le.le.{u} α
(@preorder.to_has_le.{u} α
(@preorder.mk.{u} α le (@lattice.lt._default.{u} α le)
(@conditionally_complete_lattice.copy._aux_1.{u} α c le eq_le sup eq_sup inf eq_inf Sup eq_Sup Inf eq_Inf)
(@conditionally_complete_lattice.copy._aux_2.{u} α c le eq_le sup eq_sup inf eq_inf Sup eq_Sup Inf eq_Inf)
(λ (a b : α), iff.refl (@has_lt.lt.{u} α (@has_lt.mk.{u} α (@lattice.lt._default.{u} α le)) a b))))
a
b →
@has_le.le.{u} α
(@preorder.to_has_le.{u} α
(@preorder.mk.{u} α le (@lattice.lt._default.{u} α le)
(@conditionally_complete_lattice.copy._aux_1.{u} α c le eq_le sup eq_sup inf eq_inf Sup eq_Sup Inf eq_Inf)
(@conditionally_complete_lattice.copy._aux_2.{u} α c le eq_le sup eq_sup inf eq_inf Sup eq_Sup Inf eq_Inf)
(λ (a b : α), iff.refl (@has_lt.lt.{u} α (@has_lt.mk.{u} α (@lattice.lt._default.{u} α le)) a b))))
b
a →
@eq.{u+1} α a b
The abstract
tactic introduces these *._aux*
definitions to abbreviate the generated proofs. Otherwise they would be expanded and we'd need to substitute (subst_vars
) the previous proofs in every goal, leading to horrible performance.
Linting failures are all due to missing docstrings. Unfortunately I don't understand what's going on well enough to add them. @digama0 do you mind adding docstrings for |
I've added docs for |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
bors merge |
The main effect for mathlib comes from leanprover-community/lean#282, which changes the elaboration strategy for structure instance literals (`{ foo := 42 }`). There are two points where we need to pay attention: 1. Avoid sourcing (`{ ..e }` where e.g. `e : euclidean_domain α`) for fields like `add`, `mul`, `zero`, etc. Instead write `{ add := (+), mul := (*), zero := 0, ..e }`. The reason is that `{ ..e }` is equivalent to `{ mul := euclidean_domain.mul, ..e }`. And `euclidean_domain.mul` should never be mentioned. I'm not completely sure if this issue remains visible once the structure literal has been elaborated, but this hasn't changed since 3.14. For now, my advice is: if you get weird errors like "cannot unify `a * b` and `?m_1 * ?m_2` in a structure literal, add `mul := (*)`. 2. `refine { le := (≤), .. }; simp` is slower. This is because references to `(≤)` are no longer reduced to `le` in the subgoals. If a subgoal like `a ≤ b → b ≤ a → a = b` was stated for preorders (because `partial_order` extends `preorder`), then the `(≤)` will contain a `preorder` subterm. This subterm also contains other subgoals (proofs of reflexivity and transitivity). Therefore the goals are larger than you might expect: ``` ∀ (a b : α), @has_le.le.{u} α (@preorder.to_has_le.{u} α (@preorder.mk.{u} α le (@lattice.lt._default.{u} α le) (@conditionally_complete_lattice.copy._aux_1.{u} α c le eq_le sup eq_sup inf eq_inf Sup eq_Sup Inf eq_Inf) (@conditionally_complete_lattice.copy._aux_2.{u} α c le eq_le sup eq_sup inf eq_inf Sup eq_Sup Inf eq_Inf) (λ (a b : α), iff.refl (@has_lt.lt.{u} α (@has_lt.mk.{u} α (@lattice.lt._default.{u} α le)) a b)))) a b → @has_le.le.{u} α (@preorder.to_has_le.{u} α (@preorder.mk.{u} α le (@lattice.lt._default.{u} α le) (@conditionally_complete_lattice.copy._aux_1.{u} α c le eq_le sup eq_sup inf eq_inf Sup eq_Sup Inf eq_Inf) (@conditionally_complete_lattice.copy._aux_2.{u} α c le eq_le sup eq_sup inf eq_inf Sup eq_Sup Inf eq_Inf) (λ (a b : α), iff.refl (@has_lt.lt.{u} α (@has_lt.mk.{u} α (@lattice.lt._default.{u} α le)) a b)))) b a → @eq.{u+1} α a b ``` Advice: in cases such as this, try `refine { le := (≤), .. }; abstract { simp }` to reduce the size of the (dependent) subgoals. Co-authored-by: Bryan Gin-ge Chen <bryangingechen@gmail.com> Co-authored-by: Scott Morrison <scott@tqft.net> Co-authored-by: E.W.Ayers <E.W.Ayers@maths.cam.ac.uk>
Build failed (retrying...): |
The main effect for mathlib comes from leanprover-community/lean#282, which changes the elaboration strategy for structure instance literals (`{ foo := 42 }`). There are two points where we need to pay attention: 1. Avoid sourcing (`{ ..e }` where e.g. `e : euclidean_domain α`) for fields like `add`, `mul`, `zero`, etc. Instead write `{ add := (+), mul := (*), zero := 0, ..e }`. The reason is that `{ ..e }` is equivalent to `{ mul := euclidean_domain.mul, ..e }`. And `euclidean_domain.mul` should never be mentioned. I'm not completely sure if this issue remains visible once the structure literal has been elaborated, but this hasn't changed since 3.14. For now, my advice is: if you get weird errors like "cannot unify `a * b` and `?m_1 * ?m_2` in a structure literal, add `mul := (*)`. 2. `refine { le := (≤), .. }; simp` is slower. This is because references to `(≤)` are no longer reduced to `le` in the subgoals. If a subgoal like `a ≤ b → b ≤ a → a = b` was stated for preorders (because `partial_order` extends `preorder`), then the `(≤)` will contain a `preorder` subterm. This subterm also contains other subgoals (proofs of reflexivity and transitivity). Therefore the goals are larger than you might expect: ``` ∀ (a b : α), @has_le.le.{u} α (@preorder.to_has_le.{u} α (@preorder.mk.{u} α le (@lattice.lt._default.{u} α le) (@conditionally_complete_lattice.copy._aux_1.{u} α c le eq_le sup eq_sup inf eq_inf Sup eq_Sup Inf eq_Inf) (@conditionally_complete_lattice.copy._aux_2.{u} α c le eq_le sup eq_sup inf eq_inf Sup eq_Sup Inf eq_Inf) (λ (a b : α), iff.refl (@has_lt.lt.{u} α (@has_lt.mk.{u} α (@lattice.lt._default.{u} α le)) a b)))) a b → @has_le.le.{u} α (@preorder.to_has_le.{u} α (@preorder.mk.{u} α le (@lattice.lt._default.{u} α le) (@conditionally_complete_lattice.copy._aux_1.{u} α c le eq_le sup eq_sup inf eq_inf Sup eq_Sup Inf eq_Inf) (@conditionally_complete_lattice.copy._aux_2.{u} α c le eq_le sup eq_sup inf eq_inf Sup eq_Sup Inf eq_Inf) (λ (a b : α), iff.refl (@has_lt.lt.{u} α (@has_lt.mk.{u} α (@lattice.lt._default.{u} α le)) a b)))) b a → @eq.{u+1} α a b ``` Advice: in cases such as this, try `refine { le := (≤), .. }; abstract { simp }` to reduce the size of the (dependent) subgoals. Co-authored-by: Bryan Gin-ge Chen <bryangingechen@gmail.com> Co-authored-by: Scott Morrison <scott@tqft.net> Co-authored-by: E.W.Ayers <E.W.Ayers@maths.cam.ac.uk>
Do we understand the story with the universe parameters that were made more explicit? |
Build failed (retrying...): |
The main effect for mathlib comes from leanprover-community/lean#282, which changes the elaboration strategy for structure instance literals (`{ foo := 42 }`). There are two points where we need to pay attention: 1. Avoid sourcing (`{ ..e }` where e.g. `e : euclidean_domain α`) for fields like `add`, `mul`, `zero`, etc. Instead write `{ add := (+), mul := (*), zero := 0, ..e }`. The reason is that `{ ..e }` is equivalent to `{ mul := euclidean_domain.mul, ..e }`. And `euclidean_domain.mul` should never be mentioned. I'm not completely sure if this issue remains visible once the structure literal has been elaborated, but this hasn't changed since 3.14. For now, my advice is: if you get weird errors like "cannot unify `a * b` and `?m_1 * ?m_2` in a structure literal, add `mul := (*)`. 2. `refine { le := (≤), .. }; simp` is slower. This is because references to `(≤)` are no longer reduced to `le` in the subgoals. If a subgoal like `a ≤ b → b ≤ a → a = b` was stated for preorders (because `partial_order` extends `preorder`), then the `(≤)` will contain a `preorder` subterm. This subterm also contains other subgoals (proofs of reflexivity and transitivity). Therefore the goals are larger than you might expect: ``` ∀ (a b : α), @has_le.le.{u} α (@preorder.to_has_le.{u} α (@preorder.mk.{u} α le (@lattice.lt._default.{u} α le) (@conditionally_complete_lattice.copy._aux_1.{u} α c le eq_le sup eq_sup inf eq_inf Sup eq_Sup Inf eq_Inf) (@conditionally_complete_lattice.copy._aux_2.{u} α c le eq_le sup eq_sup inf eq_inf Sup eq_Sup Inf eq_Inf) (λ (a b : α), iff.refl (@has_lt.lt.{u} α (@has_lt.mk.{u} α (@lattice.lt._default.{u} α le)) a b)))) a b → @has_le.le.{u} α (@preorder.to_has_le.{u} α (@preorder.mk.{u} α le (@lattice.lt._default.{u} α le) (@conditionally_complete_lattice.copy._aux_1.{u} α c le eq_le sup eq_sup inf eq_inf Sup eq_Sup Inf eq_Inf) (@conditionally_complete_lattice.copy._aux_2.{u} α c le eq_le sup eq_sup inf eq_inf Sup eq_Sup Inf eq_Inf) (λ (a b : α), iff.refl (@has_lt.lt.{u} α (@has_lt.mk.{u} α (@lattice.lt._default.{u} α le)) a b)))) b a → @eq.{u+1} α a b ``` Advice: in cases such as this, try `refine { le := (≤), .. }; abstract { simp }` to reduce the size of the (dependent) subgoals. Co-authored-by: Bryan Gin-ge Chen <bryangingechen@gmail.com> Co-authored-by: Scott Morrison <scott@tqft.net> Co-authored-by: E.W.Ayers <E.W.Ayers@maths.cam.ac.uk>
Build failed: |
bors r+ |
The main effect for mathlib comes from leanprover-community/lean#282, which changes the elaboration strategy for structure instance literals (`{ foo := 42 }`). There are two points where we need to pay attention: 1. Avoid sourcing (`{ ..e }` where e.g. `e : euclidean_domain α`) for fields like `add`, `mul`, `zero`, etc. Instead write `{ add := (+), mul := (*), zero := 0, ..e }`. The reason is that `{ ..e }` is equivalent to `{ mul := euclidean_domain.mul, ..e }`. And `euclidean_domain.mul` should never be mentioned. I'm not completely sure if this issue remains visible once the structure literal has been elaborated, but this hasn't changed since 3.14. For now, my advice is: if you get weird errors like "cannot unify `a * b` and `?m_1 * ?m_2` in a structure literal, add `mul := (*)`. 2. `refine { le := (≤), .. }; simp` is slower. This is because references to `(≤)` are no longer reduced to `le` in the subgoals. If a subgoal like `a ≤ b → b ≤ a → a = b` was stated for preorders (because `partial_order` extends `preorder`), then the `(≤)` will contain a `preorder` subterm. This subterm also contains other subgoals (proofs of reflexivity and transitivity). Therefore the goals are larger than you might expect: ``` ∀ (a b : α), @has_le.le.{u} α (@preorder.to_has_le.{u} α (@preorder.mk.{u} α le (@lattice.lt._default.{u} α le) (@conditionally_complete_lattice.copy._aux_1.{u} α c le eq_le sup eq_sup inf eq_inf Sup eq_Sup Inf eq_Inf) (@conditionally_complete_lattice.copy._aux_2.{u} α c le eq_le sup eq_sup inf eq_inf Sup eq_Sup Inf eq_Inf) (λ (a b : α), iff.refl (@has_lt.lt.{u} α (@has_lt.mk.{u} α (@lattice.lt._default.{u} α le)) a b)))) a b → @has_le.le.{u} α (@preorder.to_has_le.{u} α (@preorder.mk.{u} α le (@lattice.lt._default.{u} α le) (@conditionally_complete_lattice.copy._aux_1.{u} α c le eq_le sup eq_sup inf eq_inf Sup eq_Sup Inf eq_Inf) (@conditionally_complete_lattice.copy._aux_2.{u} α c le eq_le sup eq_sup inf eq_inf Sup eq_Sup Inf eq_Inf) (λ (a b : α), iff.refl (@has_lt.lt.{u} α (@has_lt.mk.{u} α (@lattice.lt._default.{u} α le)) a b)))) b a → @eq.{u+1} α a b ``` Advice: in cases such as this, try `refine { le := (≤), .. }; abstract { simp }` to reduce the size of the (dependent) subgoals. [Zulip thread](https://leanprover.zulipchat.com/#narrow/stream/113488-general/topic/Lean.203.2E15.2E0). Co-authored-by: Bryan Gin-ge Chen <bryangingechen@gmail.com> Co-authored-by: Scott Morrison <scott@tqft.net> Co-authored-by: E.W.Ayers <E.W.Ayers@maths.cam.ac.uk> Co-authored-by: Chris Hughes <chrishughes24@gmail.com>
Pull request successfully merged into master. Build succeeded: |
The main effect for mathlib comes from leanprover-community/lean#282, which changes the elaboration strategy for structure instance literals (`{ foo := 42 }`). There are two points where we need to pay attention: 1. Avoid sourcing (`{ ..e }` where e.g. `e : euclidean_domain α`) for fields like `add`, `mul`, `zero`, etc. Instead write `{ add := (+), mul := (*), zero := 0, ..e }`. The reason is that `{ ..e }` is equivalent to `{ mul := euclidean_domain.mul, ..e }`. And `euclidean_domain.mul` should never be mentioned. I'm not completely sure if this issue remains visible once the structure literal has been elaborated, but this hasn't changed since 3.14. For now, my advice is: if you get weird errors like "cannot unify `a * b` and `?m_1 * ?m_2` in a structure literal, add `mul := (*)`. 2. `refine { le := (≤), .. }; simp` is slower. This is because references to `(≤)` are no longer reduced to `le` in the subgoals. If a subgoal like `a ≤ b → b ≤ a → a = b` was stated for preorders (because `partial_order` extends `preorder`), then the `(≤)` will contain a `preorder` subterm. This subterm also contains other subgoals (proofs of reflexivity and transitivity). Therefore the goals are larger than you might expect: ``` ∀ (a b : α), @has_le.le.{u} α (@preorder.to_has_le.{u} α (@preorder.mk.{u} α le (@lattice.lt._default.{u} α le) (@conditionally_complete_lattice.copy._aux_1.{u} α c le eq_le sup eq_sup inf eq_inf Sup eq_Sup Inf eq_Inf) (@conditionally_complete_lattice.copy._aux_2.{u} α c le eq_le sup eq_sup inf eq_inf Sup eq_Sup Inf eq_Inf) (λ (a b : α), iff.refl (@has_lt.lt.{u} α (@has_lt.mk.{u} α (@lattice.lt._default.{u} α le)) a b)))) a b → @has_le.le.{u} α (@preorder.to_has_le.{u} α (@preorder.mk.{u} α le (@lattice.lt._default.{u} α le) (@conditionally_complete_lattice.copy._aux_1.{u} α c le eq_le sup eq_sup inf eq_inf Sup eq_Sup Inf eq_Inf) (@conditionally_complete_lattice.copy._aux_2.{u} α c le eq_le sup eq_sup inf eq_inf Sup eq_Sup Inf eq_Inf) (λ (a b : α), iff.refl (@has_lt.lt.{u} α (@has_lt.mk.{u} α (@lattice.lt._default.{u} α le)) a b)))) b a → @eq.{u+1} α a b ``` Advice: in cases such as this, try `refine { le := (≤), .. }; abstract { simp }` to reduce the size of the (dependent) subgoals. [Zulip thread](https://leanprover.zulipchat.com/#narrow/stream/113488-general/topic/Lean.203.2E15.2E0). Co-authored-by: Bryan Gin-ge Chen <bryangingechen@gmail.com> Co-authored-by: Scott Morrison <scott@tqft.net> Co-authored-by: E.W.Ayers <E.W.Ayers@maths.cam.ac.uk> Co-authored-by: Chris Hughes <chrishughes24@gmail.com>
The main effect for mathlib comes from leanprover-community/lean#282, which changes the elaboration strategy for structure instance literals (
{ foo := 42 }
). There are two points where we need to pay attention:{ ..e }
where e.g.e : euclidean_domain α
) for fields likeadd
,mul
,zero
, etc. Instead write{ add := (+), mul := (*), zero := 0, ..e }
. The reason is that{ ..e }
is equivalent to{ mul := euclidean_domain.mul, ..e }
. Andeuclidean_domain.mul
should never be mentioned.I'm not completely sure if this issue remains visible once the structure literal has been elaborated, but this hasn't changed since 3.14. For now, my advice is: if you get weird errors like "cannot unify
a * b
and?m_1 * ?m_2
in a structure literal, addmul := (*)
.refine { le := (≤), .. }; simp
is slower. This is because references to(≤)
are no longer reduced tole
in the subgoals. If a subgoal likea ≤ b → b ≤ a → a = b
was stated for preorders (becausepartial_order
extendspreorder
), then the(≤)
will contain apreorder
subterm. This subterm also contains other subgoals (proofs of reflexivity and transitivity). Therefore the goals are larger than you might expect:Advice: in cases such as this, try
refine { le := (≤), .. }; abstract { simp }
to reduce the size of the (dependent) subgoals.Zulip thread.