closes #318 Like Lean 3, we are doing it only for theorems. @Kha, we talked about doing it for definitions too, it sounded like a good idea, and it would make the system's behavior more uniform, but unfortunately it creates too many problems. There are so many trivial cases where it breaks. Here are some examples. 1- Definitions that take multiple bundled structures ``` def foo (s1 : Group) (s2 : CommRing) ... ``` They are universe polymorphic, and the different structures must be in the same universe, but we don't know it when we elaborate the header, that is, we need to elaborate the body. An extreme case is `PUnit` occurring in the header. It is universe polymorphic, but we only lear the constraints on this universe after we elaborate the body. 2- All files containing unification hints broke. Again, there are universe constraints on the header that we only learn after we elaborate the body. 3- Many `CoeSort` and `CoeFun` examples broke. Example: ``` structure Group := (carrier : Type u) (mul : carrier → carrier → carrier) (one : carrier) instance GroupToType : CoeSort Group (Type u) := CoeSort.mk (fun g => g.carrier) ``` We would have to write ``` instance GroupToType : CoeSort Group.{u} (Type u) := CoeSort.mk (fun g => g.carrier) ``` We would have to provide universe level parameters manually in this kind of instance. I think it would be too annoying.
21 lines
560 B
Text
21 lines
560 B
Text
α : Type u_1
|
||
as bs : List α
|
||
⊢ as ++ bs ++ bs = as ++ (bs ++ bs)
|
||
rewrite.lean:12:20-12:29: error: tactic 'rewrite' failed, did not find instance of the pattern in the target expression
|
||
List.reverse (List.reverse ?m)
|
||
α : Type u_1
|
||
as bs : List α
|
||
⊢ as ++ [] ++ [] ++ bs ++ bs = as ++ (bs ++ bs)
|
||
x y z : Nat
|
||
h₁ : x = y
|
||
h₂ : y = z
|
||
⊢ x = z
|
||
rewrite.lean:31:0-31:24: error: tactic 'rewrite' failed, did not find instance of the pattern in the current goal
|
||
x y z : Nat
|
||
h₁ : 0 + x = y
|
||
h₂ : 0 + y = z
|
||
⊢ x = z
|
||
m n k : Nat
|
||
: n = m
|
||
h : k = m
|
||
⊢ k = n
|