Files
why3/stdlib/function.mlw

37 lines
638 B
Plaintext
Raw Permalink Normal View History

(** {1 Injections, surjections and bijections} *)
module Injective
2011-01-10 09:43:56 +01:00
type a
type v
function to_ a : v
function from v : a
2011-01-10 09:43:56 +01:00
axiom Inj : forall x : a. from(to_ x) = x
2011-01-10 09:43:56 +01:00
goal G1 : forall x y : a. to_(x)=to_(y) -> x = y
goal G2 : forall y : a. exists x : v. from(x)=y
2011-01-10 09:43:56 +01:00
end
module Surjective
2011-01-10 09:43:56 +01:00
type a
type v
function to_ a : v
function from v : a
2011-01-10 09:43:56 +01:00
clone export Injective with type v = a, type a = v,
function to_ = from, function from = to_, axiom Inj
2011-01-10 09:43:56 +01:00
end
module Bijective
2011-01-10 09:43:56 +01:00
clone export Injective
clone Surjective as S with type v = v, type a = a,
function to_ = to_, function from = from, axiom Inj
2011-01-10 09:43:56 +01:00
end