12d89ea0b9
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
20 lines
No EOL
479 B
Text
20 lines
No EOL
479 B
Text
import standard
|
|
|
|
namespace setoid
|
|
inductive setoid : Type :=
|
|
| mk_setoid: Π (A : Type), (A → A → Bool) → setoid
|
|
|
|
definition carrier (s : setoid)
|
|
:= setoid_rec (λ a eq, a) s
|
|
|
|
definition eqv {s : setoid} : carrier s → carrier s → Bool
|
|
:= setoid_rec (λ a eqv, eqv) s
|
|
|
|
infix `≈`:50 := eqv
|
|
|
|
coercion carrier
|
|
|
|
inductive morphism (s1 s2 : setoid) : Type :=
|
|
| mk_morphism : Π (f : s1 → s2), (∀ x y, x ≈ y → f x ≈ f y) → morphism s1 s2
|
|
|
|
end |