TorchLean API

FloatLib.Floats.Formats.Posit.Semantics.OnePointOption

One-point views of optional values #

Posits and quires both have a partial exact semantics toRat? : Model → Option Rat whose none case is the unique NaR word. Their intentional one-point projections send some x to the point x and none to the added point of OnePoint. This module defines that map once, as Option.toOnePoint, and proves the characterisations that the posit and quire projective views instantiate.

def Option.toOnePoint {K : Type u_1} :

Send some x to the point x of the one-point compactification and none to the added point.

Instances For
    @[simp]
    theorem Option.toOnePoint_some {K : Type u_1} (x : K) :
    (some x).toOnePoint = x

    some x maps to the finite point x of the one-point compactification.

    @[simp]

    none maps to the point at infinity.

    theorem Option.toOnePoint_eq_coe_iff {K : Type u_1} (option : Option K) (x : K) :
    option.toOnePoint = x option = some x

    The one-point view is a finite point exactly when the option holds that value.

    theorem Option.toOnePoint_eq_infty_iff {K : Type u_1} (option : Option K) :

    The one-point view is the added point exactly when the option is none.

    theorem Option.toOnePoint_map_eq_coe_iff {K : Type u_1} {L : Type u_2} {f : KL} (hf : Function.Injective f) (option : Option K) (x : K) :
    (Option.map f option).toOnePoint = (f x) option = some x

    Mapping through an injective function before the one-point view preserves finite points.

    theorem Option.toOnePoint_map_eq_infty_iff {K : Type u_1} {L : Type u_2} (f : KL) (option : Option K) :

    Mapping before the one-point view does not change which options reach the added point.

    theorem OnePoint.equivProjectivization_eq_iff (K : Type u_1) [DivisionRing K] [DecidableEq K] (left right : OnePoint K) :
    (equivProjectivization K) left = (equivProjectivization K) right left = right

    The projective-line equivalence reflects equality of one-point values.