Section UnitRing.
Definition cast_ringType (Q : ringType) T (QeqT : Q = T :> Type) :=
let cast rQ := let: erefl in _ = T := QeqT return Ring.class_of T in rQ in
Ring.Pack (cast (Ring.class Q)).
Variables (R : unitRingType) (S : {pred R}).
Variables (ringS : divringPred S) (kS : keyed_pred ringS).
Variables (T : subType (mem kS)) (Q : ringType) (QeqT : Q = T :> Type).
Let inT x Sx : T := Sub x Sx.
Let invT (u : T) := inT (rpredVr (valP u)).
Let unitT := [qualify a u : T | val u \is a unit].
Let T' := cast_ringType QeqT.
Hypothesis val1 : val (1 : T') = 1.
Hypothesis valM : {morph (val : T' -> R) : x y / x * y}.
Fact mulVr :
{in (unitT : {pred T'}), left_inverse (1 : T') invT (@mul T')}.
Fact unit_id : {in [predC unitT], invT =1 id}.

Lemma pair_mulVr : {in pair_unitr, right_inverse 1 pair_invr *%R}.