Documentation

Init.Omega.IntList

@[inline, reducible]

A type synonym for List Int, used by omega for dense representation of coefficients.

We define algebraic operations, interpreting List Int as a finitely supported function NatInt.

Equations
Instances For

    Get the i-th element (interpreted as 0 if the list is not long enough).

    Equations
    Instances For

      Like List.set, but right-pad with zeroes as necessary first.

      Equations
      Instances For
        @[simp]
        theorem Lean.Omega.IntList.set_cons_zero {x : Int} {xs : List Int} {y : Int} :
        Lean.Omega.IntList.set (x :: xs) 0 y = y :: xs
        @[simp]
        theorem Lean.Omega.IntList.set_cons_succ {x : Int} {xs : List Int} {i : Nat} {y : Int} :

        Returns the leading coefficient, i.e. the first non-zero entry.

        Equations
        Instances For

          Implementation of + on IntList.

          Equations
          Instances For
            @[simp]
            @[simp]
            @[simp]
            theorem Lean.Omega.IntList.cons_add_cons (x : Int) (xs : Lean.Omega.IntList) (y : Int) (ys : Lean.Omega.IntList) :
            x :: xs + y :: ys = (x + y) :: (xs + ys)

            Implementation of * on IntList.

            Equations
            Instances For
              theorem Lean.Omega.IntList.mul_def (xs : Lean.Omega.IntList) (ys : Lean.Omega.IntList) :
              xs * ys = List.zipWith (fun (x x_1 : Int) => x * x_1) xs ys
              @[simp]
              theorem Lean.Omega.IntList.mul_nil_left {ys : List Int} :
              [] * ys = []
              @[simp]
              theorem Lean.Omega.IntList.mul_nil_right {xs : List Int} :
              xs * [] = []
              @[simp]
              theorem Lean.Omega.IntList.mul_cons₂ {x : Int} {xs : List Int} {y : Int} {ys : List Int} :
              (x :: xs) * (y :: ys) = x * y :: xs * ys

              Implementation of negation on IntList.

              Equations
              Instances For
                theorem Lean.Omega.IntList.neg_def (xs : Lean.Omega.IntList) :
                -xs = List.map (fun (x : Int) => -x) xs
                @[simp]
                @[simp]
                theorem Lean.Omega.IntList.neg_cons {x : Int} {xs : List Int} :
                -(x :: xs) = -x :: -xs

                Implementation of subtraction on IntList.

                Equations
                Instances For

                  Implementation of scalar multiplication by an integer on IntList.

                  Equations
                  Instances For
                    theorem Lean.Omega.IntList.smul_def (xs : Lean.Omega.IntList) (i : Int) :
                    i * xs = List.map (fun (x : Int) => i * x) xs
                    @[simp]
                    theorem Lean.Omega.IntList.smul_nil {i : Int} :
                    i * [] = []
                    @[simp]
                    theorem Lean.Omega.IntList.smul_cons {x : Int} {xs : List Int} {i : Int} :
                    i * (x :: xs) = i * x :: i * xs

                    A linear combination of two IntLists.

                    Equations
                    Instances For
                      @[simp]
                      theorem Lean.Omega.IntList.mul_smul_left {i : Int} {xs : Lean.Omega.IntList} {ys : Lean.Omega.IntList} :
                      i * xs * ys = i * (xs * ys)

                      The sum of the entries of an IntList.

                      Equations
                      Instances For

                        The dot product of two IntLists.

                        Equations
                        Instances For
                          @[simp]
                          theorem Lean.Omega.IntList.dot_cons₂ {x : Int} {xs : List Int} {y : Int} {ys : List Int} :

                          Division of an IntList by a integer.

                          Equations
                          Instances For

                            The gcd of the absolute values of the entries of an IntList.

                            Equations
                            Instances For
                              theorem Lean.Omega.IntList.dvd_gcd (xs : Lean.Omega.IntList) (c : Nat) (w : ∀ {a : Int}, a xsc a) :
                              theorem Lean.Omega.IntList.gcd_eq_iff (xs : Lean.Omega.IntList) (g : Nat) :
                              Lean.Omega.IntList.gcd xs = g (∀ {a : Int}, a xsg a) ∀ (c : Nat), (∀ {a : Int}, a xsc a)c g
                              @[simp]
                              @[inline, reducible]

                              Apply "balanced mod" to each entry in an IntList.

                              Equations
                              Instances For
                                @[inline, reducible]

                                The difference between the balanced mod of a dot product, and the dot product with balanced mod applied to each entry of the left factor.

                                Equations
                                Instances For