Real semantics of posit trigonometric operations #
The operation proofs compose exact comparator semantics with the standard posit rounding algorithm. They cover all finite inputs in the real domain, including exact zero results, domain endpoints, and nonzero saturation. NaR propagation and invalid inverse domains are stated separately.
theorem
FloatLib.Floats.Formats.Posit.Model.Trigonometric.evaluate_eq_real
(prepare : ℚ → ℕ → Numerics.Enclosure.Comparison.Prepared)
(function : ℝ → ℝ)
(hprepare :
∀ (argument : ℚ) (levels : ℕ) (boundary : ℚ),
(prepare argument levels).compare boundary = cmp (function ↑argument) ↑boundary)
{format : Format}
(value : Model format)
{q : ℚ}
(hvalue : value.toRat? = some q)
:
Exact comparison followed by signed posit rounding gives the required real result.
theorem
FloatLib.Floats.Formats.Posit.Model.Trigonometric.evaluateUnit_eq_real
(prepare : ℚ → ℕ → Numerics.Enclosure.Comparison.Prepared)
(function : ℝ → ℝ)
(hprepare :
∀ (argument : ℚ) (levels : ℕ) (boundary : ℚ),
-1 ≤ argument → argument ≤ 1 → (prepare argument levels).compare boundary = cmp (function ↑argument) ↑boundary)
{format : Format}
(value : Model format)
{q : ℚ}
(hvalue : value.toRat? = some q)
(hlower : -1 ≤ q)
(hupper : q ≤ 1)
:
The same composition applies to a comparator whose contract is restricted to [-1, 1].
@[simp]
theorem
FloatLib.Floats.Formats.Posit.Model.Trigonometric.evaluate_nar
(prepare : ℚ → ℕ → Numerics.Enclosure.Comparison.Prepared)
{format : Format}
:
Evaluation propagates NaR without preparing a comparison search.
@[simp]
theorem
FloatLib.Floats.Formats.Posit.Model.Trigonometric.evaluateUnit_nar
(prepare : ℚ → ℕ → Numerics.Enclosure.Comparison.Prepared)
{format : Format}
:
The closed-domain adapter also propagates NaR.
theorem
FloatLib.Floats.Formats.Posit.Model.Trigonometric.evaluateUnit_eq_nar
(prepare : ℚ → ℕ → Numerics.Enclosure.Comparison.Prepared)
{format : Format}
(value : Model format)
{q : ℚ}
(hvalue : value.toRat? = some q)
(houtside : q < -1 ∨ 1 < q)
:
A finite input outside the closed unit interval produces NaR before evaluation.