2014-08-25 02:58:48 +00:00
|
|
|
import logic
|
2014-07-10 12:49:41 +00:00
|
|
|
|
|
|
|
namespace setoid
|
|
|
|
inductive setoid : Type :=
|
2014-08-22 22:46:10 +00:00
|
|
|
mk_setoid: Π (A : Type), (A → A → Prop) → setoid
|
2014-07-10 12:49:41 +00:00
|
|
|
|
|
|
|
definition carrier (s : setoid)
|
2014-09-04 22:03:59 +00:00
|
|
|
:= setoid.rec (λ a eq, a) s
|
2014-07-10 12:49:41 +00:00
|
|
|
|
2014-07-22 16:43:18 +00:00
|
|
|
definition eqv {s : setoid} : carrier s → carrier s → Prop
|
2014-09-04 22:03:59 +00:00
|
|
|
:= setoid.rec (λ a eqv, eqv) s
|
2014-07-10 12:49:41 +00:00
|
|
|
|
2014-10-21 22:27:45 +00:00
|
|
|
infix `≈` := eqv
|
2014-07-10 12:49:41 +00:00
|
|
|
|
2015-01-25 04:23:21 +00:00
|
|
|
attribute carrier [coercion]
|
2014-07-10 12:49:41 +00:00
|
|
|
|
|
|
|
inductive morphism (s1 s2 : setoid) : Type :=
|
2014-09-04 23:36:06 +00:00
|
|
|
mk : Π (f : s1 → s2), (∀ x y, x ≈ y → f x ≈ f y) → morphism s1 s2
|
2014-07-10 12:49:41 +00:00
|
|
|
|
|
|
|
set_option pp.universes true
|
|
|
|
|
2014-09-04 23:36:06 +00:00
|
|
|
check morphism.mk
|
2014-07-10 12:49:41 +00:00
|
|
|
check λ (s1 s2 : setoid), s1
|
|
|
|
check λ (s1 s2 : Type), s1
|
|
|
|
|
|
|
|
inductive morphism2 (s1 : setoid) (s2 : setoid) : Type :=
|
2014-09-04 23:36:06 +00:00
|
|
|
mk : Π (f : s1 → s2), (∀ x y, x ≈ y → f x ≈ f y) → morphism2 s1 s2
|
2014-07-10 12:49:41 +00:00
|
|
|
|
2014-09-04 23:36:06 +00:00
|
|
|
check morphism2.mk
|
2014-09-04 22:03:59 +00:00
|
|
|
end setoid
|