Linear combinations #
We use this data structure while processing hypotheses.
Internal representation of a linear combination of atoms, and a constant term.
- const : Int
Constant term.
- coeffs : Lean.Omega.Coeffs
Coefficients of the atoms.
Instances For
Equations
- Lean.Omega.instReprLinearCombo = { reprPrec := Lean.Omega.reprLinearCombo✝ }
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.Omega.LinearCombo.instInhabited = { default := { const := 1, coeffs := [] } }
Check if a linear combination is an atom, i.e. the constant term is zero and there is exactly one nonzero coefficient, which is one.
Equations
Instances For
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))))
.
Instances For
The i
-th coordinate function.
Equations
- Lean.Omega.LinearCombo.coordinate i = { const := 0, coeffs := Lean.Omega.Coeffs.set [] i 1 }
Instances For
Implementation of addition on LinearCombo
.
Instances For
Equations
Implementation of subtraction on LinearCombo
.
Instances For
Equations
Implementation of negation on LinearCombo
.
Instances For
Equations
Implementation of scalar multiplication of a LinearCombo
by an Int
.
Instances For
Equations
- Lean.Omega.LinearCombo.instHMulInt = { hMul := fun (i : Int) (lc : Lean.Omega.LinearCombo) => lc.smul i }
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.