module sets where
postulate
š : Set
_ā_ : š ā š ā Set
infix 50 _ā_
data _and_ : Set ā Set ā Set where
_ā§_ : (x y : Set) ā x and y
infixl 40 _and_
infixl 40 _ā§_
data _ā”_ : Set ā Set ā Set where
_eq_ : (a b : Set) ā a ā b and b ā a ā a ā” b
infixr 30 _ā”_
infixr 30 _eq_
postulate
_==_ : š ā š ā Set
==-def : (x y z : š) ā ((z ā x ā” z ā y) ā” x == y)
infixr 50 _==_
postulate
eq_ax : (x y : š) ā (x == y) ā (z : š) ā (x ā z ā” y ā z)
ā : (x : Set) ā (z : x ā Set) ā Set
ā-def : (x : Set) ā (y : x) ā (z : x ā Set) ā (z y ā” ā x z)
pair_ax : (x y : š) ā ā š Ī» { z ā x ā z and y ā z }
āŖ : š ā š
āŖ_def : (x y : š) ā x ā āŖ y ā” ā š Ī» { z ā x ā z and z ā y }
_ā_ : š ā š ā Set
ā-def : (x y : š) ā ((z : š) ā z ā x ā z ā y) ā” x ā y
infixl 50 _ā_
first-proof : (x y : š) ā x ā y ā (āŖ x) ā (āŖ y)
first-proof x y z = {!!}
I am new to Agda. I try to find something that can verify my evidence. And so far Agda seems to be the best option (but still not enough convenient). I am implementing ZFC. And don't know, how to proof the last sentence.
I expect to proof without data, closest to the usual proof with quantifiers and connectives.
module sets where
data _and_ : Set ā Set ā Set where
_ā§_ : {x y : Set} ā x ā y ā x and y
infixl 40 _and_
infixl 40 _ā§_
data _ā”_ : Set ā Set ā Set where
eq : {x y : Set} ā (x ā y) and (y ā x) ā x ā” y
infixr 30 _ā”_
straight : {x y : Set} ā x ā” y ā x ā y
straight (eq (z ā§ w)) = z
back : {x y : Set} ā x ā” y ā y ā x
back (eq (z ā§ w)) = w
data ā : {x : Set} ā (z : x ā Set) ā Set where
exists : {x : Set} ā (y : x) ā (z : x ā Set) ā z y ā ā z
postulate
š : Set
_ā_ : š ā š ā Set
infix 50 _ā_
postulate
_==_ : š ā š ā Set
==-def : (x y z : š) ā ((z ā x ā” z ā y) ā” x == y)
infixr 50 _==_
postulate
eq_ax : (x y : š) ā (x == y) ā (z : š) ā (x ā z ā” y ā z)
pair_ax : (x y : š) ā ā Ī» { z ā x ā z and y ā z }
āŖ : š ā š
āŖ-def : (x y : š) ā (ā Ī» { z ā x ā z and z ā y }) ā” x ā āŖ y
_ā_ : š ā š ā Set
ā-def : (x y : š) ā ((z : š) ā z ā x ā z ā y) ā” x ā y
infixr 50 _ā_
th-1 : (x y : š) ā x ā y ā (āŖ x) ā (āŖ y)
th-1 x y z = straight (ā-def (āŖ x) (āŖ y)) Ī» w i ā straight (āŖ-def w y) (lm-1 w (back (āŖ-def w x) i))
where lm-1 : (a : š) ā ā (Ī» { z ā a ā z and z ā x }) ā ā (Ī» { z ā a ā z and z ā y })
lm-1 a (exists b _ (c ā§ d)) = exists b (Ī» { z ā a ā z and z ā y }) (c ā§ (back (ā-def x y) z b d))
I was able to done this proof. I had to add one data more. Several data blocks were wrong - now they are right - partly because of it I couldn't proof. Now I see Agda more convenient - I began to understand it more. I also added two auxiliary functions: straight and back.
It's sad that the answers are hard to find on the topic of Agda(
-----edited------
It is possible sometimes to use only functions. For example
postulate
_and_ : Set ā Set ā Set
and-def : {x y : Set} ā x ā y ā x and y
right : {x y : Set} ā x and y ā y
left : {x y : Set} ā x and y ā x
But, in the end, I came to use data. Functions don't allow to introduce parameters not in implication. For example we cannot write something like this
data ā : {x : Set} ā (z : x ā Set) ā Set where
c-ā : {x : Set} ā (y : x) ā (z : x ā Set) ā z y ā ā z
ā-element : {x : Set} ā (z : x ā Set) ā ā z ā (and-def (y : x) (z y))
It produces parse error at "y : x".