File: .lake/packages/lean4/src/lean/Init/Omega/LinearCombo.lean

full_name: Lean.Omega.LinearCombo.coeffs
code: /-- Internal representation of a linear combination of atoms, and a constant term. -/
structure LinearCombo where
  /-- Constant term. -/
  const : Int := 0
  /-- Coefficients of the atoms. -/
  coeffs : Coeffs := []
deriving DecidableEq, Repr
goal: Lean.Omega.Coeffs

full_name: Lean.Omega.LinearCombo
code: /-- Internal representation of a linear combination of atoms, and a constant term. -/
structure LinearCombo where
  /-- Constant term. -/
  const : Int := 0
  /-- Coefficients of the atoms. -/
  coeffs : Coeffs := []
deriving DecidableEq, Repr
goal: Type

full_name: Lean.Omega.LinearCombo.const
code: /-- Internal representation of a linear combination of atoms, and a constant term. -/
structure LinearCombo where
  /-- Constant term. -/
  const : Int := 0
  /-- Coefficients of the atoms. -/
  coeffs : Coeffs := []
deriving DecidableEq, Repr
goal: Int

full_name: Lean.Omega.instReprLinearCombo
code: /-- Internal representation of a linear combination of atoms, and a constant term. -/
structure LinearCombo where
  /-- Constant term. -/
  const : Int := 0
  /-- Coefficients of the atoms. -/
  coeffs : Coeffs := []
deriving DecidableEq, Repr
goal: Repr Lean.Omega.LinearCombo

full_name: Lean.Omega.LinearCombo.instToString
code: instance : ToString LinearCombo 
goal: ToString Lean.Omega.LinearCombo

full_name: Lean.Omega.LinearCombo.instInhabited
code: instance : Inhabited LinearCombo 
goal: Inhabited Lean.Omega.LinearCombo

full_name: Lean.Omega.LinearCombo.ext
code: theorem ext {a b : LinearCombo} (w₁ : a.const = b.const) (w₂ : a.coeffs = b.coeffs) :
    a = b 
goal: a = b

full_name: Lean.Omega.LinearCombo.eval
code: /--
Evaluate a linear combination `⟨r, [c_1, …, c_k]⟩` at values `[v_1, …, v_k]` to obtain
`r + (c_1 * x_1 + (c_2 * x_2 + ... (c_k * x_k + 0))))`.
-/
def eval (lc : LinearCombo) (values : Coeffs) : Int 
goal: Int

full_name: Lean.Omega.LinearCombo.eval_nil
code: @[simp] theorem eval_nil : (lc : LinearCombo).eval .nil = lc.const 
goal: lc.eval [] = lc.const

full_name: Lean.Omega.LinearCombo.coordinate
code: /-- The `i`-th coordinate function. -/
def coordinate (i : Nat) : LinearCombo 
goal: Lean.Omega.LinearCombo

full_name: Lean.Omega.LinearCombo.coordinate_eval
code: @[simp] theorem coordinate_eval (i : Nat) (v : Coeffs) :
    (coordinate i).eval v = v.get i 
goal: (Lean.Omega.LinearCombo.coordinate i).eval v = v.get i

full_name: Lean.Omega.LinearCombo.coordinate_eval_0
code: theorem coordinate_eval_0 : (coordinate 0).eval (.ofList (a0 :: t)) = a0 
goal: (Lean.Omega.LinearCombo.coordinate 0).eval (Lean.Omega.Coeffs.ofList (a0 :: t)) = a0

full_name: Lean.Omega.LinearCombo.coordinate_eval_1
code: theorem coordinate_eval_1 : (coordinate 1).eval (.ofList (a0 :: a1 :: t)) = a1 
goal: (Lean.Omega.LinearCombo.coordinate 1).eval (Lean.Omega.Coeffs.ofList (a0 :: a1 :: t)) = a1

full_name: Lean.Omega.LinearCombo.coordinate_eval_2
code: theorem coordinate_eval_2 : (coordinate 2).eval (.ofList (a0 :: a1 :: a2 :: t)) = a2 
goal: (Lean.Omega.LinearCombo.coordinate 2).eval (Lean.Omega.Coeffs.ofList (a0 :: a1 :: a2 :: t)) = a2

full_name: Lean.Omega.LinearCombo.coordinate_eval_3
code: theorem coordinate_eval_3 :
    (coordinate 3).eval (.ofList (a0 :: a1 :: a2 :: a3 :: t)) = a3 
goal: (Lean.Omega.LinearCombo.coordinate 3).eval (Lean.Omega.Coeffs.ofList (a0 :: a1 :: a2 :: a3 :: t)) = a3

full_name: Lean.Omega.LinearCombo.coordinate_eval_4
code: theorem coordinate_eval_4 :
    (coordinate 4).eval (.ofList (a0 :: a1 :: a2 :: a3 :: a4 :: t)) = a4 
goal: (Lean.Omega.LinearCombo.coordinate 4).eval (Lean.Omega.Coeffs.ofList (a0 :: a1 :: a2 :: a3 :: a4 :: t)) = a4

full_name: Lean.Omega.LinearCombo.coordinate_eval_5
code: theorem coordinate_eval_5 :
    (coordinate 5).eval (.ofList (a0 :: a1 :: a2 :: a3 :: a4 :: a5 :: t)) = a5 
goal: (Lean.Omega.LinearCombo.coordinate 5).eval (Lean.Omega.Coeffs.ofList (a0 :: a1 :: a2 :: a3 :: a4 :: a5 :: t)) = a5

full_name: Lean.Omega.LinearCombo.coordinate_eval_6
code: theorem coordinate_eval_6 :
    (coordinate 6).eval (.ofList (a0 :: a1 :: a2 :: a3 :: a4 :: a5 :: a6 :: t)) = a6 
goal: (Lean.Omega.LinearCombo.coordinate 6).eval (Lean.Omega.Coeffs.ofList (a0 :: a1 :: a2 :: a3 :: a4 :: a5 :: a6 :: t)) = a6

full_name: Lean.Omega.LinearCombo.coordinate_eval_7
code: theorem coordinate_eval_7 :
    (coordinate 7).eval
      (.ofList (a0 :: a1 :: a2 :: a3 :: a4 :: a5 :: a6 :: a7 :: t)) = a7 
goal: (Lean.Omega.LinearCombo.coordinate 7).eval
    (Lean.Omega.Coeffs.ofList (a0 :: a1 :: a2 :: a3 :: a4 :: a5 :: a6 :: a7 :: t)) =
  a7

full_name: Lean.Omega.LinearCombo.coordinate_eval_8
code: theorem coordinate_eval_8 :
    (coordinate 8).eval
      (.ofList (a0 :: a1 :: a2 :: a3 :: a4 :: a5 :: a6 :: a7 :: a8 :: t)) = a8 
goal: (Lean.Omega.LinearCombo.coordinate 8).eval
    (Lean.Omega.Coeffs.ofList (a0 :: a1 :: a2 :: a3 :: a4 :: a5 :: a6 :: a7 :: a8 :: t)) =
  a8

full_name: Lean.Omega.LinearCombo.coordinate_eval_9
code: theorem coordinate_eval_9 :
    (coordinate 9).eval
      (.ofList (a0 :: a1 :: a2 :: a3 :: a4 :: a5 :: a6 :: a7 :: a8 :: a9 :: t)) = a9 
goal: (Lean.Omega.LinearCombo.coordinate 9).eval
    (Lean.Omega.Coeffs.ofList (a0 :: a1 :: a2 :: a3 :: a4 :: a5 :: a6 :: a7 :: a8 :: a9 :: t)) =
  a9

full_name: Lean.Omega.LinearCombo.add
code: /-- Implementation of addition on `LinearCombo`. -/
def add (l₁ l₂ : LinearCombo) : LinearCombo 
goal: Lean.Omega.LinearCombo

full_name: Lean.Omega.LinearCombo.instAdd
code: instance : Add LinearCombo 
goal: Add Lean.Omega.LinearCombo

full_name: Lean.Omega.LinearCombo.add_const
code: @[simp] theorem add_const {l₁ l₂ : LinearCombo} : (l₁ + l₂).const = l₁.const + l₂.const 
goal: (l₁ + l₂).const = l₁.const + l₂.const

full_name: Lean.Omega.LinearCombo.add_coeffs
code: @[simp] theorem add_coeffs {l₁ l₂ : LinearCombo} : (l₁ + l₂).coeffs = l₁.coeffs + l₂.coeffs 
goal: (l₁ + l₂).coeffs = l₁.coeffs + l₂.coeffs

full_name: Lean.Omega.LinearCombo.sub
code: /-- Implementation of subtraction on `LinearCombo`. -/
def sub (l₁ l₂ : LinearCombo) : LinearCombo 
goal: Lean.Omega.LinearCombo

full_name: Lean.Omega.LinearCombo.instSub
code: instance : Sub LinearCombo 
goal: Sub Lean.Omega.LinearCombo

full_name: Lean.Omega.LinearCombo.sub_const
code: @[simp] theorem sub_const {l₁ l₂ : LinearCombo} : (l₁ - l₂).const = l₁.const - l₂.const 
goal: (l₁ - l₂).const = l₁.const - l₂.const

full_name: Lean.Omega.LinearCombo.sub_coeffs
code: @[simp] theorem sub_coeffs {l₁ l₂ : LinearCombo} : (l₁ - l₂).coeffs = l₁.coeffs - l₂.coeffs 
goal: (l₁ - l₂).coeffs = l₁.coeffs - l₂.coeffs

full_name: Lean.Omega.LinearCombo.neg
code: /-- Implementation of negation on `LinearCombo`. -/
def neg (lc : LinearCombo) : LinearCombo 
goal: Lean.Omega.LinearCombo

full_name: Lean.Omega.LinearCombo.instNeg
code: instance : Neg LinearCombo 
goal: Neg Lean.Omega.LinearCombo

full_name: Lean.Omega.LinearCombo.neg_const
code: @[simp] theorem neg_const {l : LinearCombo} : (-l).const = -l.const 
goal: (-l).const = -l.const

full_name: Lean.Omega.LinearCombo.neg_coeffs
code: @[simp] theorem neg_coeffs {l : LinearCombo} : (-l).coeffs = -l.coeffs  
goal: (-l).coeffs = -l.coeffs

full_name: Lean.Omega.LinearCombo.sub_eq_add_neg
code: theorem sub_eq_add_neg (l₁ l₂ : LinearCombo) : l₁ - l₂ = l₁ + -l₂ 
goal: l₁ - l₂ = l₁ + -l₂

full_name: Lean.Omega.LinearCombo.smul
code: /-- Implementation of scalar multiplication of a `LinearCombo` by an `Int`. -/
def smul (lc : LinearCombo) (i : Int) : LinearCombo 
goal: Lean.Omega.LinearCombo

full_name: Lean.Omega.LinearCombo.instHMulInt
code: instance : HMul Int LinearCombo LinearCombo 
goal: HMul Int Lean.Omega.LinearCombo Lean.Omega.LinearCombo

full_name: Lean.Omega.LinearCombo.smul_const
code: @[simp] theorem smul_const {lc : LinearCombo} {i : Int} : (i * lc).const = i * lc.const 
goal: (i * lc).const = i * lc.const

full_name: Lean.Omega.LinearCombo.smul_coeffs
code: @[simp] theorem smul_coeffs {lc : LinearCombo} {i : Int} : (i * lc).coeffs = i * lc.coeffs 
goal: (i * lc).coeffs = i * lc.coeffs

full_name: Lean.Omega.LinearCombo.add_eval
code: @[simp] theorem add_eval (l₁ l₂ : LinearCombo) (v : Coeffs) :
    (l₁ + l₂).eval v = l₁.eval v + l₂.eval v 
goal: (l₁ + l₂).eval v = l₁.eval v + l₂.eval v

full_name: Lean.Omega.LinearCombo.neg_eval
code: @[simp] theorem neg_eval (lc : LinearCombo) (v : Coeffs) : (-lc).eval v = - lc.eval v 
goal: (-lc).eval v = -lc.eval v

full_name: Lean.Omega.LinearCombo.sub_eval
code: @[simp] theorem sub_eval (l₁ l₂ : LinearCombo) (v : Coeffs) :
    (l₁ - l₂).eval v = l₁.eval v - l₂.eval v 
goal: (l₁ - l₂).eval v = l₁.eval v - l₂.eval v

full_name: Lean.Omega.LinearCombo.smul_eval
code: @[simp] theorem smul_eval (lc : LinearCombo) (i : Int) (v : Coeffs) :
    (i * lc).eval v = i * lc.eval v 
goal: (i * lc).eval v = i * lc.eval v

full_name: Lean.Omega.LinearCombo.smul_eval_comm
code: theorem smul_eval_comm (lc : LinearCombo) (i : Int) (v : Coeffs) :
    (i * lc).eval v = lc.eval v * i 
goal: (i * lc).eval v = lc.eval v * i

full_name: Lean.Omega.LinearCombo.mul
code: /--
Multiplication of two linear combinations.
This is useful only if at least one of the linear combinations is constant,
and otherwise should be considered as a junk value.
-/
def mul (l₁ l₂ : LinearCombo) : LinearCombo 
goal: Lean.Omega.LinearCombo

full_name: Lean.Omega.LinearCombo.mul_eval_of_const_left
code: theorem mul_eval_of_const_left (l₁ l₂ : LinearCombo) (v : Coeffs) (w : l₁.coeffs.isZero) :
    (mul l₁ l₂).eval v = l₁.eval v * l₂.eval v 
goal: (l₁.mul l₂).eval v = l₁.eval v * l₂.eval v

full_name: Lean.Omega.LinearCombo.mul_eval_of_const_right
code: theorem mul_eval_of_const_right (l₁ l₂ : LinearCombo) (v : Coeffs) (w : l₂.coeffs.isZero) :
    (mul l₁ l₂).eval v = l₁.eval v * l₂.eval v 
goal: (l₁.mul l₂).eval v = l₁.eval v * l₂.eval v

full_name: Lean.Omega.LinearCombo.mul_eval
code: theorem mul_eval (l₁ l₂ : LinearCombo) (v : Coeffs) (w : l₁.coeffs.isZero ∨ l₂.coeffs.isZero) :
    (mul l₁ l₂).eval v = l₁.eval v * l₂.eval v 
goal: (l₁.mul l₂).eval v = l₁.eval v * l₂.eval v