Documentation

Mathlib.Tactic.ComputeAsymptotics.Multiseries.Defs

Multiseries definitions #

In this file, we define the multiseries and its main properties: sortedness and approximation. A multiseries in a basis [b₁, ..., bₙ] represents a multivariate series: it is a formal series made from monomials b₁ ^ e₁ * ... * bₙ ^ eₙ where e₁, ..., eₙ are real numbers. We treat multivariate series in a basis [b₁, ..., bₙ] as a univariate series in the variable b₁ (basis_hd) with coefficients being multiseries in the basis [b₂, ..., bₙ] (basis_tl).

Main definitions #

Implementation details #

@[reducible, inline]

List of functions used to construct monomials in multiseries.

Equations
Instances For

    Multiseries representing a given function f : ℝ → ℝ. MultiseriesExpansion [] is just : multiseries representing constant functions. Otherwise it is a pair of a Multiseries basis_hd basis_tl and a function ℝ → ℝ. We call the former an expansion of the latter.

    Note: most of the theory can be formulated in terms of Multiseries, but we need to explicitly store the approximated function to be able to use the eventual zeroness oracle at the trimming step.

    Equations
    Instances For

      Multiseries in a basis basis_hd :: basis_tl. It is a generalisation of asymptotic expansions. A multiseries in a basis [b₁, ..., bₙ] is a formal series made from monomials b₁ ^ e₁ * ... * bₙ ^ eₙ where e₁, ..., eₙ are real numbers. We treat multivariate series in a basis [b₁, ..., bₙ] as a univariate series in the variable b₁ (basis_hd) with coefficients being multiseries in the basis [b₂, ..., bₙ] (basis_tl). We represent such a series as a lazy list (Seq) of pairs (exp, coef) where exp is the exponent of b₁ and coef is the coefficient (a multiseries in basis_tl).

      MultiseriesExpansion is a Multiseries with an attached real function.

      Equations
      Instances For
        def ComputeAsymptotics.MultiseriesExpansion.Multiseries.toSeq {basis_hd : } {basis_tl : Basis} (ms : Multiseries basis_hd basis_tl) :

        Converts a Multiseries basis_hd basis_tl to a Seq (ℝ × MultiseriesExpansion basis_tl).

        Equations
        Instances For
          def ComputeAsymptotics.MultiseriesExpansion.Multiseries.nil {basis_hd : } {basis_tl : Basis} :
          Multiseries basis_hd basis_tl

          The empty multiseries.

          Equations
          Instances For
            def ComputeAsymptotics.MultiseriesExpansion.Multiseries.cons {basis_hd : } {basis_tl : Basis} (exp : ) (coef : MultiseriesExpansion basis_tl) (tl : Multiseries basis_hd basis_tl) :
            Multiseries basis_hd basis_tl

            Prepend a monomial to a multiseries.

            Equations
            Instances For
              def ComputeAsymptotics.MultiseriesExpansion.Multiseries.recOn {basis_hd : } {basis_tl : Basis} {motive : Multiseries basis_hd basis_tlSort u_1} (ms : Multiseries basis_hd basis_tl) (nil : motive nil) (cons : (exp : ) → (coef : MultiseriesExpansion basis_tl) → (tl : Multiseries basis_hd basis_tl) → motive (cons exp coef tl)) :
              motive ms

              Recursion principle for Multiseries basis_hd basis_tl. It is equivalent to Stream'.Seq.recOn but provides some convenience.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                def ComputeAsymptotics.MultiseriesExpansion.Multiseries.destruct {basis_hd : } {basis_tl : Basis} (ms : Multiseries basis_hd basis_tl) :
                Option ( × MultiseriesExpansion basis_tl × Multiseries basis_hd basis_tl)

                Destruct a multiseries into a triple (exp, coef, tl), where exp is the leading exponent, coef is the leading coefficient, and tl is the tail.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  def ComputeAsymptotics.MultiseriesExpansion.Multiseries.head {basis_hd : } {basis_tl : Basis} (ms : Multiseries basis_hd basis_tl) :

                  The head of a multiseries, i.e. the first two entries of the tuple returned by destruct.

                  Equations
                  Instances For
                    def ComputeAsymptotics.MultiseriesExpansion.Multiseries.tail {basis_hd : } {basis_tl : Basis} (ms : Multiseries basis_hd basis_tl) :
                    Multiseries basis_hd basis_tl

                    The tail of a multiseries, i.e. the last entry of the tuple returned by destruct.

                    Equations
                    Instances For
                      def ComputeAsymptotics.MultiseriesExpansion.Multiseries.map {basis_hd : } {basis_tl : Basis} {basis_hd' : } {basis_tl' : Basis} (f : ) (g : MultiseriesExpansion basis_tlMultiseriesExpansion basis_tl') (ms : Multiseries basis_hd basis_tl) :
                      Multiseries basis_hd' basis_tl'

                      Given two functions f : ℝ → ℝ and g : MultiseriesExpansion basis_tl → MultiseriesExpansion basis_tl', apply them to exponents and coefficients of a multiseries.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        def ComputeAsymptotics.MultiseriesExpansion.Multiseries.corec {β : Type u_1} {basis_hd : } {basis_tl : Basis} (f : βOption ( × MultiseriesExpansion basis_tl × β)) (b : β) :
                        Multiseries basis_hd basis_tl

                        Corecursor for Multiseries basis_hd basis_tl.

                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          @[implicit_reducible]
                          Equations
                          • One or more equations did not get rendered due to their size.
                          theorem ComputeAsymptotics.MultiseriesExpansion.Multiseries.eq_of_bisim {basis_hd : } {basis_tl : Basis} {x y : Multiseries basis_hd basis_tl} (motive : Multiseries basis_hd basis_tlMultiseries basis_hd basis_tlProp) (base : motive x y) (step : ∀ (x y : Multiseries basis_hd basis_tl), motive x yx = nil y = nil ∃ (exp : ) (coef : MultiseriesExpansion basis_tl) (x' : Multiseries basis_hd basis_tl) (y' : Multiseries basis_hd basis_tl), x = cons exp coef x' y = cons exp coef y' motive x' y') :
                          x = y
                          theorem ComputeAsymptotics.MultiseriesExpansion.Multiseries.eq_of_bisim_strong {basis_hd : } {basis_tl : Basis} {x y : Multiseries basis_hd basis_tl} (motive : Multiseries basis_hd basis_tlMultiseries basis_hd basis_tlProp) (base : motive x y) (step : ∀ (x y : Multiseries basis_hd basis_tl), motive x yx = y ∃ (exp : ) (coef : MultiseriesExpansion basis_tl) (x' : Multiseries basis_hd basis_tl) (y' : Multiseries basis_hd basis_tl), x = cons exp coef x' y = cons exp coef y' motive x' y') :
                          x = y
                          @[simp]
                          theorem ComputeAsymptotics.MultiseriesExpansion.Multiseries.cons_ne_nil {basis_hd : } {basis_tl : Basis} {exp : } {coef : MultiseriesExpansion basis_tl} {tl : Multiseries basis_hd basis_tl} :
                          cons exp coef tl nil
                          @[simp]
                          theorem ComputeAsymptotics.MultiseriesExpansion.Multiseries.nil_ne_cons {basis_hd : } {basis_tl : Basis} {exp : } {coef : MultiseriesExpansion basis_tl} {tl : Multiseries basis_hd basis_tl} :
                          nil cons exp coef tl
                          @[simp]
                          theorem ComputeAsymptotics.MultiseriesExpansion.Multiseries.cons_eq_cons {basis_hd : } {basis_tl : Basis} {exp1 exp2 : } {coef1 coef2 : MultiseriesExpansion basis_tl} {tl1 tl2 : Multiseries basis_hd basis_tl} :
                          cons exp1 coef1 tl1 = cons exp2 coef2 tl2 exp1 = exp2 coef1 = coef2 tl1 = tl2
                          theorem ComputeAsymptotics.MultiseriesExpansion.Multiseries.corec_nil {β : Type u_1} {basis_hd : } {basis_tl : Basis} {f : βOption ( × MultiseriesExpansion basis_tl × β)} {b : β} (h : f b = none) :
                          corec f b = nil
                          theorem ComputeAsymptotics.MultiseriesExpansion.Multiseries.corec_cons {β : Type u_1} {basis_hd : } {basis_tl : Basis} {exp : } {coef : MultiseriesExpansion basis_tl} {next : β} {f : βOption ( × MultiseriesExpansion basis_tl × β)} {b : β} (h : f b = some (exp, coef, next)) :
                          corec f b = cons exp coef (corec f next)
                          @[simp]
                          theorem ComputeAsymptotics.MultiseriesExpansion.Multiseries.destruct_cons {basis_hd : } {basis_tl : Basis} {exp : } {coef : MultiseriesExpansion basis_tl} {tl : Multiseries basis_hd basis_tl} :
                          (cons exp coef tl).destruct = some (exp, coef, tl)
                          theorem ComputeAsymptotics.MultiseriesExpansion.Multiseries.destruct_eq_none {basis_hd : } {basis_tl : Basis} {ms : Multiseries basis_hd basis_tl} (h : ms.destruct = none) :
                          ms = nil
                          theorem ComputeAsymptotics.MultiseriesExpansion.Multiseries.destruct_eq_cons {basis_hd : } {basis_tl : Basis} {ms : Multiseries basis_hd basis_tl} {exp : } {coef : MultiseriesExpansion basis_tl} {tl : Multiseries basis_hd basis_tl} (h : ms.destruct = some (exp, coef, tl)) :
                          ms = cons exp coef tl
                          @[simp]
                          theorem ComputeAsymptotics.MultiseriesExpansion.Multiseries.head_cons {basis_hd : } {basis_tl : Basis} {exp : } {coef : MultiseriesExpansion basis_tl} {tl : Multiseries basis_hd basis_tl} :
                          (cons exp coef tl).head = some (exp, coef)
                          @[simp]
                          theorem ComputeAsymptotics.MultiseriesExpansion.Multiseries.tail_cons {basis_hd : } {basis_tl : Basis} {exp : } {coef : MultiseriesExpansion basis_tl} {tl : Multiseries basis_hd basis_tl} :
                          (cons exp coef tl).tail = tl
                          @[simp]
                          theorem ComputeAsymptotics.MultiseriesExpansion.Multiseries.map_nil {basis_hd : } {basis_tl : Basis} {basis_hd' : } {basis_tl' : Basis} (f : ) (g : MultiseriesExpansion basis_tlMultiseriesExpansion basis_tl') :
                          map f g nil = nil
                          @[simp]
                          theorem ComputeAsymptotics.MultiseriesExpansion.Multiseries.map_cons {basis_hd : } {basis_tl : Basis} {basis_hd' : } {basis_tl' : Basis} (f : ) (g : MultiseriesExpansion basis_tlMultiseriesExpansion basis_tl') {exp : } {coef : MultiseriesExpansion basis_tl} {tl : Multiseries basis_hd basis_tl} :
                          map f g (cons exp coef tl) = cons (f exp) (g coef) (map f g tl)
                          @[simp]
                          theorem ComputeAsymptotics.MultiseriesExpansion.Multiseries.map_id {basis_hd : } {basis_tl : Basis} (ms : Multiseries basis_hd basis_tl) :
                          map (fun (exp : ) => exp) (fun (coef : MultiseriesExpansion basis_tl) => coef) ms = ms
                          theorem ComputeAsymptotics.MultiseriesExpansion.Multiseries.map_comp {b₁ b₂ b₃ : } {bs₁ bs₂ bs₃ : Basis} (f₁ : ) (g₁ : MultiseriesExpansion bs₁MultiseriesExpansion bs₂) (f₂ : ) (g₂ : MultiseriesExpansion bs₂MultiseriesExpansion bs₃) (ms : Multiseries b₁ bs₁) :
                          map (f₂ f₁) (g₂ g₁) ms = map f₂ g₂ (map f₁ g₁ ms)
                          @[simp]
                          @[simp]
                          theorem ComputeAsymptotics.MultiseriesExpansion.Multiseries.mem_cons_iff {basis_hd : } {basis_tl : Basis} {exp : } {coef : MultiseriesExpansion basis_tl} {tl : Multiseries basis_hd basis_tl} {x : × MultiseriesExpansion basis_tl} :
                          x cons exp coef tl x = (exp, coef) x tl
                          @[simp]
                          theorem ComputeAsymptotics.MultiseriesExpansion.Multiseries.Pairwise_cons_nil {basis_hd : } {basis_tl : Basis} {R : × MultiseriesExpansion basis_tl × MultiseriesExpansion basis_tlProp} {exp : } {coef : MultiseriesExpansion basis_tl} :

                          Convert a real number to a multiseries in an empty basis.

                          Equations
                          Instances For

                            Convert a multiseries in an empty basis to a real number.

                            Equations
                            Instances For
                              def ComputeAsymptotics.MultiseriesExpansion.seq {basis_hd : } {basis_tl : List ()} (ms : MultiseriesExpansion (basis_hd :: basis_tl)) :
                              Multiseries basis_hd basis_tl

                              Convert a multiseries in a non-empty basis to a sequence of pairs (exp, coef).

                              Equations
                              Instances For

                                Convert a multiseries to a function.

                                Equations
                                Instances For
                                  def ComputeAsymptotics.MultiseriesExpansion.mk {basis_hd : } {basis_tl : Basis} (s : Multiseries basis_hd basis_tl) (f : ) :
                                  MultiseriesExpansion (basis_hd :: basis_tl)

                                  Constructs a multiseries from a Multiseries basis_hd basis_tl and a function.

                                  Equations
                                  Instances For
                                    def ComputeAsymptotics.MultiseriesExpansion.recOn {basis_hd : } {basis_tl : List ()} {motive : MultiseriesExpansion (basis_hd :: basis_tl)Sort u_1} (nil : (f : ) → motive (mk Multiseries.nil f)) (cons : (exp : ) → (coef : MultiseriesExpansion basis_tl) → (tl : Multiseries basis_hd basis_tl) → (f : ) → motive (mk (Multiseries.cons exp coef tl) f)) (ms : MultiseriesExpansion (basis_hd :: basis_tl)) :
                                    motive ms

                                    Recursion principle for MultiseriesExpansion (basis_hd :: basis_tl).

                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    Instances For
                                      theorem ComputeAsymptotics.MultiseriesExpansion.eq_mk {basis_hd : } {basis_tl : List ()} (ms : MultiseriesExpansion (basis_hd :: basis_tl)) :
                                      ms = mk ms.seq ms.toFun
                                      theorem ComputeAsymptotics.MultiseriesExpansion.mk_eq_mk_iff {basis_hd : } {basis_tl : Basis} (s t : Multiseries basis_hd basis_tl) (f g : ) :
                                      mk s f = mk t g s = t f = g
                                      @[simp]
                                      theorem ComputeAsymptotics.MultiseriesExpansion.ms_eq_mk_iff {basis_hd : } {basis_tl : List ()} (ms : MultiseriesExpansion (basis_hd :: basis_tl)) (s : Multiseries basis_hd basis_tl) (f : ) :
                                      ms = mk s f ms.seq = s ms.toFun = f
                                      @[simp]
                                      theorem ComputeAsymptotics.MultiseriesExpansion.mk_eq_mk_iff_iff {basis_hd : } {basis_tl : List ()} (ms : MultiseriesExpansion (basis_hd :: basis_tl)) (s : Multiseries basis_hd basis_tl) (f : ) :
                                      mk s f = ms ms.seq = s ms.toFun = f
                                      theorem ComputeAsymptotics.MultiseriesExpansion.ext_iff {basis_hd : } {basis_tl : List ()} (ms₁ ms₂ : MultiseriesExpansion (basis_hd :: basis_tl)) :
                                      ms₁ = ms₂ ms₁.seq = ms₂.seq ms₁.toFun = ms₂.toFun
                                      @[simp]
                                      theorem ComputeAsymptotics.MultiseriesExpansion.mk_toFun {basis_hd : } {basis_tl : Basis} {s : Multiseries basis_hd basis_tl} {f : } :
                                      (mk s f).toFun = f
                                      @[simp]
                                      theorem ComputeAsymptotics.MultiseriesExpansion.mk_seq {basis_hd : } {basis_tl : Basis} (s : Multiseries basis_hd basis_tl) (f : ) :
                                      (mk s f).seq = s
                                      def ComputeAsymptotics.MultiseriesExpansion.replaceFun {basis_hd : } {basis_tl : List ()} (ms : MultiseriesExpansion (basis_hd :: basis_tl)) (f : ) :
                                      MultiseriesExpansion (basis_hd :: basis_tl)

                                      Replace the function attached to a multiseries.

                                      Equations
                                      Instances For
                                        @[simp]
                                        theorem ComputeAsymptotics.MultiseriesExpansion.mk_replaceFun {basis_hd : } {basis_tl : Basis} (s : Multiseries basis_hd basis_tl) (f g : ) :
                                        (mk s f).replaceFun g = mk s g
                                        @[simp]
                                        theorem ComputeAsymptotics.MultiseriesExpansion.replaceFun_toFun {basis_hd : } {basis_tl : List ()} (ms : MultiseriesExpansion (basis_hd :: basis_tl)) (f : ) :
                                        (ms.replaceFun f).toFun = f
                                        @[simp]
                                        theorem ComputeAsymptotics.MultiseriesExpansion.replaceFun_seq {basis_hd : } {basis_tl : List ()} (ms : MultiseriesExpansion (basis_hd :: basis_tl)) (f : ) :
                                        (ms.replaceFun f).seq = ms.seq