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 : predPredType 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 : predPredType T'), left_inverse (1 : T') invT (@mul T')}.
Fact unit_id : {in [predC unitT], invT =1 id}.

(* Specifications: *)
Lemma fieldMixin (F : fieldType) (K : unitRingType) (f : K -> F) :
phant K -> injective f -> f 0 = 0 -> {mono f : u / u \in unit} ->
@Field.mixin_of K.
Lemma pair_mulVr : {in pair_unitr, right_inverse 1 pair_invr *%R}.
Lemma pair_unitP x y : y * x = 1 /\ x * y = 1 -> x \is a pair_unitr.
Lemma pair_invr_out : {in [predC pair_unitr], pair_invr =1 id}.