Created
November 3, 2014 17:11
-
-
Save leodemoura/f30759cd8183c1da6a1e to your computer and use it in GitHub Desktop.
relativization
This file contains hidden or 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
import logic data.nat | |
inductive funext [class] : Prop := | |
intro : (∀ {A : Type} {B : A → Type} {f g : Π x, B x} (H : ∀ x, f x = g x), f = g) → funext | |
namespace funext | |
definition apply [F : funext] : ∀ {A : Type} {B : A → Type} {f g : Π x, B x} (H : ∀ x, f x = g x), f = g := | |
rec_on F (λax, ax) | |
end funext | |
section | |
variables [F₁₁ : funext.{1 1}] | |
include F₁₁ | |
open nat | |
theorem ex : (λx y, x + y) = (λx y, y + x) := | |
funext.apply (take x, funext.apply (take y, add.comm x y)) | |
end | |
check ex -- Error funext cannot be synthesized | |
check (λ F : funext, ex) -- Ok F is used as argument for ex | |
axiom funext_ax : ∀ (A : Type) (B : A → Type) (f g : Π x, B x) (H : ∀ x, f x = g x), f = g | |
theorem funext_ax_inst [instance] : funext := | |
funext.intro funext_ax | |
check ex -- Ok, funext_inst is used |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment