Canonical addsmx_monoid n :=
  Monoid.Law (@addsmxA n n n n) (@adds0mx_id n n) (@addsmx0_id n n).Canonical addsmx_comoid n := Monoid.ComLaw (@addsmxC n n n).Implicit Type P : pred I.Canonical capmx_monoid n :=
   Monoid.Law (@capmxA n n n n) (@cap1mx n) (@capmx1 n).Canonical capmx_comoid n := Monoid.ComLaw (@capmxC n n n).Canonical trivial_mxsum m n A :=
  @Mxsum m n (Wrap A) (Wrap (\rank A)) (TrivialMxsum A).Fact binary_mxsum_proof :
  mxsum_spec (unwrap S1 + unwrap S2)
             (unwrap (mxsum_rank S1) + unwrap (mxsum_rank S2)).Canonical binary_mxsum_expr := ProperMxsumExpr binary_mxsum_proof.Canonical nary_mxsum_expr := ProperMxsumExpr nary_mxsum_proof.

Lemma mxdirectP n (S : proper_mxsum_expr n) : reflect (\rank S = proper_mxsum_rank S) (mxdirect S).