Many algebraic identities involving Scalar can be established by first using simp [←toFormal_inj] to coerce to Formal and push coercions inside, then appealing to ring. We give some examples below.
Alternatively, one can "work in coordinates" by using simp [←val_inj] in place of simp [←toFormal_inj].
theorem UnitsSystem.Scalar.hMul_assoc [UnitsSystem] {d₁ d₂ d₃ : Dimensions} (a : Scalar d₁) (b : Scalar d₂) (c : Scalar d₃) :
A Scalar.cast is needed here because
(d₁+d₂)+d₃ is not definitionally equal to d₁+(d₂+d₃).
theorem UnitsSystem.Scalar.left_distrib [UnitsSystem] {d₁ d₂ : Dimensions} (a : Scalar d₁) (b c : Scalar d₂) :
theorem UnitsSystem.Scalar.right_distrib [UnitsSystem] {d₁ d₂ : Dimensions} (a b : Scalar d₁) (c : Scalar d₂) :
An alternate proof based on working in coordinates