2014-07-07 19:40:00 +00:00
|
|
|
import logic
|
|
|
|
|
|
|
|
namespace N1
|
|
|
|
variable num : Type.{1}
|
|
|
|
variable foo : num → num → num
|
2014-08-07 23:59:08 +00:00
|
|
|
end N1
|
2014-07-07 19:40:00 +00:00
|
|
|
|
|
|
|
namespace N2
|
|
|
|
variable val : Type.{1}
|
|
|
|
variable foo : val → val → val
|
2014-08-07 23:59:08 +00:00
|
|
|
end N2
|
2014-07-07 19:40:00 +00:00
|
|
|
|
|
|
|
using N1
|
|
|
|
using N2
|
|
|
|
variables a b : num
|
|
|
|
variables x y : val
|
|
|
|
|
|
|
|
|
|
|
|
check foo a b
|
|
|
|
check foo x y
|
|
|
|
|
|
|
|
variable f : num → val
|
|
|
|
coercion f
|
|
|
|
|
|
|
|
check foo a x
|
|
|
|
check foo x y
|
|
|
|
check foo x a
|
|
|
|
|
|
|
|
check foo a b
|
|
|
|
theorem T1 : foo a b = N1.foo a b
|
|
|
|
:= refl _
|
|
|
|
|
|
|
|
definition aux1 := foo a b -- System elaborated it to N2.foo (f a) (f b)
|
|
|
|
theorem T2 : aux1 = N2.foo (f a) (f b)
|
|
|
|
:= refl _
|
|
|
|
|
|
|
|
using N1
|
|
|
|
definition aux2 := foo a b -- Now N1 is in the beginning of the queue again, and this is elaborated to N1.foo a b
|
|
|
|
check aux2
|
|
|
|
|
|
|
|
theorem T3 : aux2 = N1.foo a b
|
|
|
|
:= refl aux2
|
|
|
|
|
|
|
|
|
|
|
|
check foo a b
|
|
|
|
theorem T4 : foo a b = N1.foo a b
|
|
|
|
:= refl _
|