2014-12-01 05:16:01 +00:00
|
|
|
prelude
|
2014-09-17 21:39:05 +00:00
|
|
|
definition Prop := Type.{0}
|
2014-06-26 00:47:38 +00:00
|
|
|
|
2014-07-22 16:43:18 +00:00
|
|
|
definition false : Prop := ∀x : Prop, x
|
2014-06-26 00:47:38 +00:00
|
|
|
check false
|
|
|
|
|
2014-12-15 20:05:44 +00:00
|
|
|
theorem false.elim (C : Prop) (H : false) : C
|
2014-06-26 00:47:38 +00:00
|
|
|
:= H C
|
|
|
|
|
|
|
|
definition eq {A : Type} (a b : A)
|
2014-07-22 16:43:18 +00:00
|
|
|
:= ∀ P : A → Prop, P a → P b
|
2014-06-26 00:47:38 +00:00
|
|
|
|
|
|
|
check eq
|
|
|
|
|
2014-07-01 23:55:41 +00:00
|
|
|
infix `=`:50 := eq
|
2014-06-26 00:47:38 +00:00
|
|
|
|
|
|
|
theorem refl {A : Type} (a : A) : a = a
|
|
|
|
:= λ P H, H
|
|
|
|
|
2014-07-22 16:43:18 +00:00
|
|
|
definition true : Prop
|
2014-06-26 00:47:38 +00:00
|
|
|
:= false = false
|
|
|
|
|
|
|
|
theorem trivial : true
|
|
|
|
:= refl false
|
|
|
|
|
2014-07-22 16:43:18 +00:00
|
|
|
theorem subst {A : Type} {P : A -> Prop} {a b : A} (H1 : a = b) (H2 : P a) : P b
|
2014-06-26 00:47:38 +00:00
|
|
|
:= H1 _ H2
|
|
|
|
|
|
|
|
theorem symm {A : Type} {a b : A} (H : a = b) : b = a
|
|
|
|
:= subst H (refl a)
|
|
|
|
|
|
|
|
theorem trans {A : Type} {a b c : A} (H1 : a = b) (H2 : b = c) : a = c
|
|
|
|
:= subst H2 H1
|
|
|
|
|
|
|
|
inductive nat : Type :=
|
2015-02-26 01:00:10 +00:00
|
|
|
| zero : nat
|
|
|
|
| succ : nat → nat
|
2014-09-04 23:36:06 +00:00
|
|
|
namespace nat end nat open nat
|
2014-06-26 00:47:38 +00:00
|
|
|
|
|
|
|
print "using strict implicit arguments"
|
2014-09-17 21:39:05 +00:00
|
|
|
definition symmetric {A : Type} (R : A → A → Prop) := ∀ ⦃a b⦄, R a b → R b a
|
2014-06-26 00:47:38 +00:00
|
|
|
|
|
|
|
check symmetric
|
2014-10-02 23:20:52 +00:00
|
|
|
constant p : nat → nat → Prop
|
2014-06-26 00:47:38 +00:00
|
|
|
check symmetric p
|
|
|
|
axiom H1 : symmetric p
|
|
|
|
axiom H2 : p zero (succ zero)
|
|
|
|
check H1
|
|
|
|
check H1 H2
|
|
|
|
|
|
|
|
print "------------"
|
|
|
|
print "using implicit arguments"
|
2014-09-17 21:39:05 +00:00
|
|
|
definition symmetric2 {A : Type} (R : A → A → Prop) := ∀ {a b}, R a b → R b a
|
2014-06-26 00:47:38 +00:00
|
|
|
check symmetric2
|
|
|
|
check symmetric2 p
|
|
|
|
axiom H3 : symmetric2 p
|
|
|
|
axiom H4 : p zero (succ zero)
|
|
|
|
check H3
|
|
|
|
check H3 H4
|
|
|
|
|
|
|
|
print "-----------------"
|
|
|
|
print "using strict implicit arguments (ASCII notation)"
|
2014-09-17 21:39:05 +00:00
|
|
|
definition symmetric3 {A : Type} (R : A → A → Prop) := ∀ {{a b}}, R a b → R b a
|
2014-06-26 00:47:38 +00:00
|
|
|
|
|
|
|
check symmetric3
|
|
|
|
check symmetric3 p
|
|
|
|
axiom H5 : symmetric3 p
|
|
|
|
axiom H6 : p zero (succ zero)
|
|
|
|
check H5
|
|
|
|
check H5 H6
|