extensional constructive analysis via locators
play

Extensional constructive analysis via locators Auke Booij - PowerPoint PPT Presentation

Extensional constructive analysis via locators Auke Booij University of Birmingham 11 April 2019 Real number computation in Haskell 1 We work with the signed unit interval I=[-1,1], using binary notation with signed digits. Alphabet of digits


  1. Extensional constructive analysis via locators Auke Booij University of Birmingham 11 April 2019

  2. Real number computation in Haskell 1 We work with the signed unit interval I=[-1,1], using binary notation with signed digits. Alphabet of digits -1,0,1: > type Digit = Int Representation of the space I=[-1,1]: > type I = [ Digit ] A sequence ds = [d_0, d_1, ..., d_n, ...] represents the number x = d_0 / 2 + d_1 / 4 + d_2 / 8 + ... + d_n / 2^{n+1} + ... > zero, one, minusHalf :: I > zero = repeat 0 > one = repeat 1 > minusHalf = -1 : repeat 0 Truncated x+1 as a function [-1,1] -> [-1,1], that is, x |-> min(x+1,1): > addOne :: I -> I > addOne ( 1 : x) = one > addOne ( 0 : x) = 1 : addOne x > addOne (-1 : x) = 1 : x 1 Martín Escardó, https://www.cs.bham.ac.uk/~mhe/papers/fun2011.lhs

  3. Dedekind reals in Coq 2 (** A Dedekind cut is represented by the predicates [lower] and [upper], satisfying a number of conditions. *) Structure R := { (* The cuts are represented as propositional functions, rather than subsets, as there are no subsets in type theory. *) lower : Q -> Prop ; upper : Q -> Prop ; (* The cuts respect equality on Q. *) lower_proper : Proper (Qeq ==> iff) lower; upper_proper : Proper (Qeq ==> iff) upper; (** Strict order. *) (* The cuts are inabited. *) Definition Rlt (x y : R) := lower_bound : {q : Q | lower q}; exists q : Q, upper x q /\ lower y q. upper_bound : {r : Q | upper r}; (* The lower cut is a lower set. *) (** Non-strict order. *) lower_lower : forall q r, Definition Rle (x y : R) := q < r -> lower r -> lower q; forall q, lower x q -> lower y q. (* The lower cut is open. *) lower_open : forall q, (** Equality. *) Definition Req (x y : R) := lower q -> exists r, q < r /\ lower r; (* The upper cut is an upper set. *) Rle x y /\ Rle y x. upper_upper : forall q r, q < r -> upper q -> upper r; (* The upper cut is open. *) upper_open : forall r, upper r -> exists q, q < r /\ upper q; (* The cuts are disjoint. *) disjoint : forall q, ~ (lower q /\ upper q); (* There is no gap between the cuts. *) located : forall q r, q < r -> lower q \/ upper r }. 2 Andrej Bauer, https://github.com/andrejbauer/dedekind-reals

  4. Logic, types, propositions Logic Propositions-as-types Univalent logic same ⊤ 1 ⊥ 0 same same P ∧ Q P × Q P ⇒ Q P → Q same same P ⇔ Q ( P → Q ) × ( Q → P ) ¬ P P → 0 same P ∨ Q P + Q � P + Q � ∀( x : A ) . P ( x ) Π ( x : A ) . P ( x ) same ∃( x : A ) . P ( x ) Σ ( x : A ) . P ( x ) � Σ ( x : A ) . P ( x )�

  5. (H)Propositions For P : U : isHProp ( P ) ≔ Π ( p , q : P ) . p = P q HProp ≔ Σ ( P : U) . isHProp ( P ) Any X : U can be truncated to a proposition: � X � X � The universal property says that for any Q : HProp we have: | · | � X � X ∃ ! Q

  6. Dedekind reals (1/2) Let q , r : Q and x = ( L , U ) a pair of predicates on Q , that is, L , U : Q → HProp, then we write ( q < x ) ≔ ( q ∈ L ) and ( x < r ) ≔ ( r ∈ U ) . )( Q L U

  7. Dedekind reals: property or structure? Axiom Univalent logic lower bounded ∃( q : Q ) . q < x upper bounded ∃( r : Q ) . x < r ∀( q , q ′ : Q ) . ( q < q ′ ) ∧ ( q ′ < x ) ⇒ q < x lower closed ∀( r , r ′ : Q ) . ( r ′ < r ) ∧ ( x < r ′ ) ⇒ x < r upper closed ∀( q : Q ) . q < x ⇒ ∃( q ′ : Q ) . ( q < q ′ ) ∧ ( q ′ < x ) lower open ∀( r : Q ) . x < r ⇒ ∃( r ′ : Q ) . ( r ′ < r ) ∧ ( x < r ′ ) upper open transitive ∀( q , r : Q ) . ( q < x ) ∧ ( x < r ) ⇒ ( q < r ) located ∀( q , r : Q ) . ( q < r ) ⇒ ( q < x ) ∨ ( x < r )

  8. Dedekind reals: property or structure? Axiom Propositions-as-types lower bounded Σ ( q : Q ) . q < x upper bounded Σ ( r : Q ) . x < r Π ( q , q ′ : Q ) . ( q < q ′ ) × ( q ′ < x ) → q < x lower closed Π ( r , r ′ : Q ) . ( r ′ < r ) × ( x < r ′ ) → x < r upper closed Π ( q : Q ) . q < x → Σ ( q ′ : Q ) . ( q < q ′ ) × ( q ′ < x ) lower open Π ( r : Q ) . x < r → Σ ( r ′ : Q ) . ( r ′ < r ) × ( x < r ′ ) upper open transitive Π ( q , r : Q ) . ( q < x ) × ( x < r ) → ( q < r ) located Π ( q , r : Q ) . ( q < r ) → ( q < x ) + ( x < r )

  9. Dedekind reals (2/2) We let isCut ( L , U ) denote the conjunction of the conditions, phrased in univalent logic. We let isCut § ( L , U ) denote the conjunction of the conditions, phrased in propositions-as-types. The type of Dedekind reals is R D ≔ { ( L , U ) : ( Q → HProp ) × ( Q → HProp ) | isCut ( L , U ) } . x < y ≔ ∃( q : Q ) . x < q < y

  10. Locators: definition Recall that x = ( L , U ) is located if ∀( q , r : Q ) . ( q < r ) ⇒ ( q < x ) ∨ ( x < r ) . A locator for x : R D is the data/structure ( not unique for a given x ) locator ( x ) ≔ Π ( q , r : Q ) . q < r → ( q < x ) + ( x < r ) . The set of all Dedekind reals with locators: R L D ≔ Σ ( x : R D ) . locator ( x )

  11. Bounders from locators Given x : R D with ℓ : locator ( x ) , we can obtain a lower bound of x . Precisely, we prove: Π ( x : R D ) . locator ( x ) → Σ ( q : Q ) . q < x . (By the same argument we will be able to get an upper bound.)

  12. Bounders from locators (2/2) Recall that Dedekind reals are bounded in the sense that ∃( q : Q ) . q < x ≔ � Σ ( q : Q ) . q < x � . | · | Σ ( q : Q ) . q < x � Σ ( q : Q ) . q < x � ? id Σ ( q : Q ) . q < x

  13. Bounders from locators (2/2) Recall that Dedekind reals are bounded in the sense that ∃( q : Q ) . q < x ≔ � Σ ( q : Q ) . q < x � . | · | Σ ( q : Q ) . q < x � Σ ( q : Q ) . q < x � ∃ ! ??? Q projection Σ ( q : Q ) . q < x

  14. Locators: visualization Suppose ℓ : locator ( x ) and q , r : Q and ν : q < r . What is ℓ ( q , r , ν ) ? (NB: ℓ ( q , r , ν ) : ( q < x ) + ( x < r ) .) R D q < r x R D q < r x R D q x r

  15. Locators: visualization Suppose ℓ : locator ( x ) and q , r : Q and ν : q < r . What is ℓ ( q , r , ν ) ? (NB: ℓ ( q , r , ν ) : ( q < x ) + ( x < r ) .) R D q < r x A: The locator must have answered q < x , because x < r is false. R D q < r x R D q x r

  16. Locators: visualization Suppose ℓ : locator ( x ) and q , r : Q and ν : q < r . What is ℓ ( q , r , ν ) ? (NB: ℓ ( q , r , ν ) : ( q < x ) + ( x < r ) .) R D q < r x A: The locator must have answered q < x , because x < r is false. R D q < r x A: The locator must have answered x < r , because q < x is false. R D q x r

  17. Locators: visualization Suppose ℓ : locator ( x ) and q , r : Q and ν : q < r . What is ℓ ( q , r , ν ) ? (NB: ℓ ( q , r , ν ) : ( q < x ) + ( x < r ) .) R D q < r x A: The locator must have answered q < x , because x < r is false. R D q < r x A: The locator must have answered x < r , because q < x is false. R D q x r A: The locator can answer both q < x and x < r .

  18. Decidable propositions A proposition P : HProp is decidable if we have P + ¬ P . We have the type DHProp ≔ Σ ( P : HProp ) . P + ¬ P of decidable propositions.

  19. Locators as decidable propositions Lemma The type locator ( x ) is equivalent to the type Σ ( locatesRight : Π ( q , r : Q ) . q < r → DHProp ) . ( Π ( q , r : Q ) . Π ( ν : q < r ) . locatesRight ( q , r , ν ) → q < x ) × ( Π ( q , r : Q ) . Π ( ν : q < r ) . ¬ locatesRight ( q , r , ν ) → x < r ) . Proof. Given a locator ℓ : Π ( q , r : Q ) . q < r → ( q < x ) + ( x < r ) , define locatesRight ( q , r , ν ) to be true when the locator determines x to be on the right of the lower bound q , that is, when the locator lands in the lef summand, and false when the locator determines x to be on the lef of the lower bound r . Straightforwardly, locatesRight satisfies the two conditions. In the other direction, given locatesRight, we obtain a locator by seting ℓ ( q , r , ν ) to locate q < x when locatesRight ( q , r , ν ) , and to locate x < r otherwise. �

  20. Locator notation For a real x with a locator ℓ and rationals q , r with ν : q < r , we write locatesRight ( q < ℓ x r ) or locatesRight ( q < x r ) for the decidable proposition locatesRight ( q , r , ν ) . We write locatesLef ( q < ℓ x r ) or locatesLef ( q < x r ) for the decidable proposition ¬ locatesRight ( q < x r ) : so it is the proposition which is true if we locate x < r .

  21. Locators: visualization Suppose x has a locator. What does the locator say about q < r ? R D q < r x locatesRight ( q < ℓ x r ) : We locate q < x . R D q < r x locatesLef ( q < ℓ x r ) : We locate x < r . R D q x r locatesRight ( q < ℓ x r ) or locatesLef ( q < ℓ x r )

  22. Locators: examples (1/2) By trichotomy of the rationals, namely for all s , t : Q , ( s < t ) + ( s = t ) + ( s > t ) , the rationals have locators. Q q r <

  23. Locators: examples (1/2) By trichotomy of the rationals, namely for all s , t : Q , ( s < t ) + ( s = t ) + ( s > t ) , the rationals have locators. Q q r < ◮ s < q : then s < q < r so we locate s < r (lef) ◮ s = q : then s = q < r so we locate s < r (lef) ◮ s > q : then we locate q < s (right)

Recommend


More recommend