Documentation

Interval.Box.Basic

Complex interval arithmic (on top of 64-bit fixed point intervals) #

@[unbox]
structure Box :

Rectangular boxes of complex numbers

Instances For
    def instDecidableEqBox.decEq (x✝ x✝¹ : Box) :
    Decidable (x✝ = x✝¹)
    Equations
    Instances For
      def instBEqBox.beq :
      BoxBoxBool
      Equations
      Instances For

        Box has nice equality

        theorem Box.ext_iff (z w : Box) :
        z = w z.re = w.re z.im = w.im

        Reduce Box s equality to Interval equality

        Equations
        @[simp]
        theorem Box.mem_image2_iff {z : } {s t : Set } :
        z Set.image2 (fun (r i : ) => { re := r, im := i }) s t z.re s z.im t

        Simplification of ∈ image2 for Box

        Box approximates

        Equations

        Box zero

        Equations
        instance Box.instOne :

        Box one

        Equations
        instance Box.instNeg :

        Box negation

        Equations
        instance Box.instAdd :

        Box addition

        Equations
        instance Box.instSub :

        Box subtraction

        Equations

        Complex conjugation

        Equations
        instance Box.instMul :

        Box multiplication

        Equations

        Interval * Box

        Equations
        def Box.sqr (z : Box) :

        Box squaring (tighter than z * z)

        Equations
        Instances For
          @[irreducible]
          def Box.scaleB (z : Box) (t : Int64) :

          Power of two scaling

          Equations
          Instances For
            theorem Box.neg_def {z : Box} :
            -z = { re := -z.re, im := -z.im }
            theorem Box.add_def {z w : Box} :
            z + w = { re := z.re + w.re, im := z.im + w.im }
            theorem Box.sub_def {z w : Box} :
            z - w = { re := z.re - w.re, im := z.im - w.im }
            theorem Box.mul_def {z w : Box} :
            z * w = { re := z.re * w.re - z.im * w.im, im := z.re * w.im + z.im * w.re }
            theorem Box.smul_def {x : Interval} {z : Box} :
            x z = { re := x * z.re, im := x * z.im }
            @[simp]
            theorem Box.re_conj {z : Box} :
            (star z).re = z.re
            @[simp]
            theorem Box.im_conj {z : Box} :
            (star z).im = -z.im
            @[simp]
            theorem Box.re_zero :
            re 0 = 0
            @[simp]
            theorem Box.im_zero :
            im 0 = 0
            @[simp]
            theorem Box.re_one :
            re 1 = 1
            @[simp]
            theorem Box.im_one :
            im 1 = 0
            @[simp]
            theorem Box.approx_zero_iff {z' : } :
            approx 0 z' z' = 0
            @[simp]
            theorem Box.re_neg {z : Box} :
            (-z).re = -z.re
            @[simp]
            theorem Box.im_neg {z : Box} :
            (-z).im = -z.im
            @[simp]
            theorem Box.re_smul {x : Interval} {z : Box} :
            (x z).re = x * z.re
            @[simp]
            theorem Box.im_smul {x : Interval} {z : Box} :
            (x z).im = x * z.im
            theorem Box.approx_re {z : } {w : Box} (zw : approx w z) :

            Prove re via full

            theorem Box.approx_im {z : } {w : Box} (zw : approx w z) :

            Prove im via full

            theorem Box.approx_iff_ext {z : } {w : Box} :

            Split ∈ approx into components

            star is conservative

            theorem Box.approx_conj {z : Box} {z' : } (m : approx z z') :

            Box.neg respects approx

            Box.add respects approx

            Box.sub respects approx

            Box approximates as an additive group

            Equations
            • One or more equations did not get rendered due to their size.

            Box multiplication approximates

            theorem Box.approx_smul {z : Box} {z' : } {x : Interval} {x' : } (ax : approx x x') (az : approx z z') :
            approx (x z) (x' z')

            IntervalBox approximates

            Box approximates as a ring

            Equations
            • One or more equations did not get rendered due to their size.
            theorem Box.approx_sqr {z : Box} {z' : } (az : approx z z') :
            approx z.sqr (z' ^ 2)

            Box squaring approximates

            theorem Box.approx_scaleB {z : Box} {z' : } (az : approx z z') (t : Int64) :
            approx (z.scaleB t) (z' * 2 ^ t)

            Box scaling approximates

            theorem Box.approx_scaleB_one {z : Box} {z' : } (az : approx z z') :
            approx (z.scaleB 1) (2 * z')

            Box doubling approximates

            Multiplication and division by I #

            @[irreducible]
            def Box.mul_I (z : Box) :
            Equations
            Instances For
              @[irreducible]
              def Box.div_I (z : Box) :
              Equations
              Instances For
                theorem Box.approx_mul_I {z : Box} {z' : } (m : approx z z') :
                theorem Box.approx_div_I {z : Box} {z' : } (m : approx z z') :
                theorem Box.approx_div_I' {z : Box} {z' : } (m : approx z z') :
                @[simp]
                theorem Box.div_I_mul_I {z : Box} :
                @[simp]
                theorem Box.mul_I_div_I {z : Box} :

                Square magnitude #

                @[irreducible]

                Box square magnitude

                Equations
                Instances For
                  theorem Box.approx_normSq {z : Box} {z' : } (m : approx z z') :

                  normSq is conservative

                  theorem Box.approx_normSq' {z : Box} {z' : } (m : approx z z') :

                  normSq is conservative

                  theorem Box.sqrt_normSq_le_abs {z : Box} {z' : } (m : approx z z') :

                  Lower bounds on normSq produce lower bounds on contained radii

                  theorem Box.abs_le_sqrt_normSq {z : Box} {z' : } (m : approx z z') (n : z.normSq nan) :

                  Upper bounds on normSq produce upper bounds on contained radii

                  Conversion #

                  @[irreducible]
                  Equations
                  • z = { re := z.1, im := z.2 }
                  Instances For
                    theorem Complex.ofRat_def (z : × ) :
                    z = { re := z.1, im := z.2 }
                    noncomputable instance Box.instCoeProdRatComplex :
                    Equations
                    @[irreducible]
                    def Box.ofRat (z : × ) :
                    Equations
                    Instances For
                      theorem Box.approx_ofRat (z : × ) :
                      approx (ofRat z) z

                      Unbundled instances #