toFun r :=
{ toFun :=fun m => r • m
map_add' := smul_add r
map_smul' :=fun c m => smul_comm r c m }
map_add' r s :=by ext m; exact add_smul r s m
map_smul' c r :=by ext m; exact smul_assoc c r m
__ := lunitMap (k := k) (R:=R) (M:=M)
invFun := lunitInv
right_inv m :=by simp [lunitInv]
left_inv z :=by
change lunitInv (lunitMap z) = z
induction z using induction_on with
| zero => simp
| tmul r m =>
change tmul (k := k) (R:=R) 1 (r • m) = tmul r m
simpa using (balance (k := k) (R:=R) (1 : R) r m).symm
| add x y hx hy => simp only [map_add, hx, hy]
toFun f :=
{ toFun :=fun r =>MulOpposite.op r • f
map_add' r s :=by simp [add_smul]
map_smul' c r :=by simp [MulOpposite.op_smul, smul_assoc] }
map_add' f g :=by ext r; exact smul_add _ _ _
map_smul' c f :=by ext r; exact smul_comm _ _ _
__ := runitMap (k := k) (R:=R) (F:=F)
invFun f := tmul f 1
right_inv f :=by simp [runitMap_tmul]
left_inv z :=by
change tmul (runitMap z) 1 = z
induction z using induction_on with
| zero => simp
| tmul f r => simpa using (balance (k := k) (R:=R) f r (1 : R))
| add x y hx hy => simpa only [map_add, add_tmul] using congrArg₂ (· + ·) hx hy
__ := (runit (k := k) (R:=R) (F:=F)).toAddEquiv
map_smul' s z :=by
change runit (s • z) = s • runit z
induction z using induction_on with
| zero => simp
| tmul f r => simpa only [smul_tmul, runit_tmul] using (smul_comm s (MulOpposite.op r) f).symm
| add x y hx hy => simp only [smul_add, map_add] at *; rw [hx, hy]