End RestrictionOps.
Arguments filterf : simpl never.
Arguments restrictf : simpl never.
Notation "x .[& A ]" := (restrictf x A) : fmap_scope.
Notation "x .[\ A ]" := (x.[& domf x `\` A]) : fmap_scope.
Notation "x .[~ k ]" := (x.[\ [fset k]]) : fmap_scope.
Section Cat.
Variables (K : choiceType) (V : Type).
Implicit Types (f g : {fmap K -> V}).
Definition catf (f g : {fmap K -> V}) :=
[fmap k : (domf f `\` domf g) `|` domf g=>
match fsetULVR (valP k) with
| inl kfDg => f.[fsubsetP (fsubsetDl _ _) _ kfDg]
| inr kg => g.[kg]
end].
Local Notation "f + g" := (catf f g) : fset_scope.

Lemma disjoint_catfsI h f g :
[disjoint domf f & domf h] -> [disjoint domf g & domf h] ->
h + f = h + g -> f = g.