Parameter set : Type.
Parameter IN : setsetProp.
Infix ":e" := IN (at level 70).

Definition Subq (X Y:set) : Prop := z, z :e Xz :e Y.
Infix "c=" := Subq (at level 70).

Axioms

Extensionality
Axiom set_ext : X Y, X c= YY c= XX = Y.

Empty
Parameter empty : set.
Axiom emptyE : (x:set), ¬ x :e empty.

Unions
Parameter union : setset.
Axiom unionAx : (x z:set), z :e union x y, y :e x z :e y.

Power Sets
Parameter power : setset.
Axiom powerAx : (X:set), Y:set, Y c= X Y :e power X.

Specifications

Description Specification
Record DescrSpec : Type := mkDescr
{
  descr : (setProp) → set;
  descrAx : P:setProp, (! y, P y) → P (descr P)
}.

Separation Specification
Record SepSpec : Type := mkSep
{
  sep : set → (setProp) → set;
  sepAx : X P z, z :e sep X P z :e X P z
}.

Total Replacement Specification
Record TotReplSpec : Type := mkTotRepl
{
  repS : set → (setsetProp) → set;
  repSAx : X:set, P:setsetProp, ( x, x :e X! y, P x y) → y, y :e repS X P x, x :e X P x y
}.

Map Replacement Specification
Record MapReplSpec : Type := mkMapRepl
{
  repM : set → (setset) → set;
  repMAx : X:set, F:setset, y, y :e repM X F x, x :e X F x = y
}.

Partial Replacement Specification (No requirement that P is a *total* functional relation on X). This is the version Barras uses.
Record PartReplSpec : Type := mkPartRepl
{
  repP : set → (setsetProp) → set;
  repPAx : X:set, P:setsetProp, ( x, x :e X y z, P x yP x zy = z) → y, y :e repP X P x, x :e X P x y
}.

TotRepl <-> Descr /\ MapRepl

Definition TotRepl_Descr : TotReplSpecDescrSpec.
Defined.

Definition TotRepl_MapRepl : TotReplSpecMapReplSpec.
Defined.

Definition Descr_MapRepl_TotRepl : DescrSpecMapReplSpecTotReplSpec.
Defined.

PartRepl <-> Sep /\ TotRepl

Definition PartRepl_Sep : PartReplSpecSepSpec.
Defined.

Definition PartRepl_TotRepl : PartReplSpecTotReplSpec.
Defined.

Definition Sep_TotRepl_PartRepl : SepSpecTotReplSpecPartReplSpec.
Defined.