-
Notifications
You must be signed in to change notification settings - Fork 454
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…#4408) Before this commit, the `theorem` and `def` declarations had different universe parameter orders. For example, the following `theorem`: ``` theorem f (a : α) (f : α → β) : f a = f a := by rfl ``` was elaborated as ``` theorem f.{u_2, u_1} : ∀ {α : Sort u_1} {β : Sort u_2} (a : α) (f : α → β), f a = f a := fun {α} {β} a f => Eq.refl (f a) ``` However, if we declare `f` as a `def`, the expected order is produced. ``` def f.{u_1, u_2} : ∀ {α : Sort u_1} {β : Sort u_2} (a : α) (f : α → β), f a = f a := fun {α} {β} a f => Eq.refl (f a) ``` This commit fixes this discrepancy. @semorrison @jcommelin: This might be a disruptive change to Mathlib, but it is better to fix the issue asap. I am surprised nobody has complained about this issue before. I discovered it while trying to reduce discrepancies between `theorem` and `def` elaboration.
- Loading branch information
1 parent
6a7bed9
commit a1c8a94
Showing
5 changed files
with
46 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
theorem f1 (a : α) (f : α → β) : f a = f a := by | ||
rfl | ||
|
||
/-- | ||
info: theorem f1.{u_1, u_2} : ∀ {α : Sort u_1} {β : Sort u_2} (a : α) (f : α → β), f a = f a := | ||
fun {α} {β} a f => Eq.refl (f a) | ||
-/ | ||
#guard_msgs in | ||
#print f1 | ||
|
||
theorem f2 {α : Sort u} {β : Sort v} (a : α) (f : α → β) : f a = f a := by | ||
rfl | ||
|
||
/-- | ||
info: theorem f2.{u, v} : ∀ {α : Sort u} {β : Sort v} (a : α) (f : α → β), f a = f a := | ||
fun {α} {β} a f => Eq.refl (f a) | ||
-/ | ||
#guard_msgs in | ||
#print f2 | ||
|
||
theorem f3.{u,v} {α : Sort u} {β : Sort v} (a : α) (f : α → β) : f a = f a := by | ||
rfl | ||
|
||
/-- | ||
info: theorem f3.{u, v} : ∀ {α : Sort u} {β : Sort v} (a : α) (f : α → β), f a = f a := | ||
fun {α} {β} a f => Eq.refl (f a) | ||
-/ | ||
#guard_msgs in | ||
#print f3 | ||
|
||
def g (a : α) (f : α → β) : f a = f a := by | ||
rfl | ||
|
||
/-- | ||
info: def g.{u_1, u_2} : ∀ {α : Sort u_1} {β : Sort u_2} (a : α) (f : α → β), f a = f a := | ||
fun {α} {β} a f => Eq.refl (f a) | ||
-/ | ||
#guard_msgs in | ||
#print g |