2014-07-07 12:40:00 -07:00
|
|
|
import logic
|
|
|
|
|
|
|
|
namespace N1
|
2014-10-02 16:20:52 -07:00
|
|
|
constant num : Type.{1}
|
|
|
|
constant foo : num → num → num
|
2014-08-07 16:59:08 -07:00
|
|
|
end N1
|
2014-07-07 12:40:00 -07:00
|
|
|
|
|
|
|
namespace N2
|
2014-10-02 16:20:52 -07:00
|
|
|
constant val : Type.{1}
|
|
|
|
constant foo : val → val → val
|
2014-08-07 16:59:08 -07:00
|
|
|
end N2
|
2014-07-07 12:40:00 -07:00
|
|
|
|
2014-09-03 16:00:38 -07:00
|
|
|
open N1
|
|
|
|
open N2
|
2014-10-02 16:20:52 -07:00
|
|
|
constants a b : num
|
|
|
|
constants x y : val
|
2014-07-07 12:40:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
check foo a b
|
|
|
|
check foo x y
|
|
|
|
|
2014-10-02 16:20:52 -07:00
|
|
|
constant f : num → val
|
2014-07-07 12:40:00 -07:00
|
|
|
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
|
2014-09-04 16:36:06 -07:00
|
|
|
:= eq.refl _
|
2014-07-07 12:40:00 -07:00
|
|
|
|
2014-08-18 18:24:08 -07:00
|
|
|
definition aux1 := foo a b -- System elaborated it to N1.foo a b
|
|
|
|
#erase_cache T2
|
|
|
|
theorem T2 : aux1 = N1.foo a b
|
2014-09-04 16:36:06 -07:00
|
|
|
:= eq.refl _
|
2014-07-07 12:40:00 -07:00
|
|
|
|
2014-09-03 16:00:38 -07:00
|
|
|
open N1
|
2014-08-18 18:24:08 -07:00
|
|
|
definition aux2 := foo a b -- Now N1 is in the end of the queue, this is elaborated to N2.foo (f a) (f b)
|
2014-07-07 12:40:00 -07:00
|
|
|
check aux2
|
|
|
|
|
2014-08-18 18:24:08 -07:00
|
|
|
theorem T3 : aux2 = N2.foo (f a) (f b)
|
2014-09-04 16:36:06 -07:00
|
|
|
:= eq.refl aux2
|
2014-07-07 12:40:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
check foo a b
|
2014-08-25 21:39:46 -07:00
|
|
|
theorem T4 : foo a b = N2.foo a b
|
2014-09-04 16:36:06 -07:00
|
|
|
:= eq.refl _
|