Affine conversion between units.
ā ļø Warning : Affine composition works when offset is zero or factor is 1
ie :
abbrev Affinable (c1 c2 : Conversion) : Prop :=
(c1.factor = 1 ⧠c2.factor = 1) ⨠(c1.offset = 0 ⧠c2.offset = 0)
instance (cā cā : Conversion) : Decidable (Affinable cā cā) := by infer_instance
But we can't eforce it in the instances below because there is no way to attach
the proof to the standard typeclasses.
We could attach it to Conversion but that would restrict it too much.
Indeed, it would prevent converting from celsius to fahrenheit directly.
Instances For
theorem
Units.Conversion.ext
{x y : Conversion}
(factor : x.factor = y.factor)
(offset : x.offset = y.offset)
:
Equations
- Units.instReprConversion = { reprPrec := Units.instReprConversion.repr }
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Units.instBEqConversion.beq xā¹ xā = false
Instances For
Equations
Equations
- Units.Conversion.identity = { factor := 1, offset := 0, factor_ne_zero := Units.Conversion.identity._proof_1 }
Instances For
Equations
- Units.Conversion.instInhabited = { default := Units.Conversion.identity }
Equations
- Units.Conversion.scale s h = { factor := s, offset := 0, factor_ne_zero := h }
Instances For
Equations
- Units.Conversion.translate t = { factor := 1, offset := t, factor_ne_zero := Units.Conversion.identity._proof_1 }
Instances For
Instances For
Equations
Instances For
Instances For
Equations
Equations
Equations
Equations
Instances For
Instances For
Equations
Instances For
Equations
Instances For
Equations
Instances For
Equations
- Units.Conversion.instNeg = { neg := fun (c : Units.Conversion) => c.neg }
Equations
Equations
Equations
Equations
Equations
Equations
- One or more equations did not get rendered due to their size.