lean2/tests/lean/run/coe2.lean
Leonardo de Moura 4f2e0c6d7f refactor(frontends/lean): add 'attribute' command
The new command provides a uniform way to set declaration attributes.
It replaces the commands: class, instance, coercion, multiple_instances,
reducible, irreducible
2015-01-24 20:23:21 -08:00

20 lines
489 B
Text

import logic
namespace setoid
inductive setoid : Type :=
mk_setoid: Π (A : Type), (A → A → Prop) → setoid
definition carrier (s : setoid)
:= setoid.rec (λ a eq, a) s
definition eqv {s : setoid} : carrier s → carrier s → Prop
:= setoid.rec (λ a eqv, eqv) s
infix `≈` := eqv
attribute carrier [coercion]
inductive morphism (s1 s2 : setoid) : Type :=
mk_morphism : Π (f : s1 → s2), (∀ x y, x ≈ y → f x ≈ f y) → morphism s1 s2
end setoid