Section PolyXY_Ring.
Variable R : ringType.
Implicit Types (u : {poly {poly R}}) (p q : {poly R}) (x : R).
Fact swapXY_key : unit. Proof. by []. Qed.
Definition swapXY_def u : {poly {poly R}} := (u ^ map_poly polyC).['Y].
Definition swapXY := locked_with swapXY_key swapXY_def.
Canonical swapXY_unlockable := [unlockable fun swapXY].
Definition sizeY u : nat := \max_(i < size u) (size u`_i).
Definition poly_XaY p : {poly {poly R}} := p^:P \Po ('X + 'Y).
Definition poly_XmY p : {poly {poly R}} := p^:P \Po ('X * 'Y).
Definition sub_annihilant p q := resultant (poly_XaY p) q^:P.
Definition div_annihilant p q := resultant (poly_XmY p) q^:P.
Canonical swapXY_rmorphism := AddRMorphism swapXY_is_multiplicative.

Lemma sizeY_eq0 u : (sizeY u == 0%N) = (u == 0).