lcm m₁ m₂
returns the least common multiple of the given monomials.
Equations
- One or more equations did not get rendered due to their size.
- Lean.Grind.CommRing.Mon.unit.lcm x✝ = x✝
- x✝.lcm Lean.Grind.CommRing.Mon.unit = x✝
Instances For
Given m₁
and m₂
such that m₂.divides m₁
, then
m₁.div m₂
returns the result.
Example w.x^3.y^2.z
div x^2.z
returns w.x.y^2
Equations
- One or more equations did not get rendered due to their size.
- x✝.div Lean.Grind.CommRing.Mon.unit = x✝
- Lean.Grind.CommRing.Mon.unit.div x✝ = Lean.Grind.CommRing.Mon.unit
Instances For
Contains the S-polynomial resulting from superposing two polynomials p₁
and p₂
,
along with coefficients and monomials used in their construction.
- spol : Poly
The computed S-polynomial.
- k₁ : Int
Coefficient applied to polynomial
p₁
. - m₁ : Mon
Monomial factor applied to polynomial
p₁
. - k₂ : Int
Coefficient applied to polynomial
p₂
. - m₂ : Mon
Monomial factor applied to polynomial
p₂
.
Instances For
Equations
- p.mulConst' k (some char) = Lean.Grind.CommRing.Poly.mulConstC k p char
- p.mulConst' k char? = Lean.Grind.CommRing.Poly.mulConst k p
Instances For
Returns the S-polynomial of polynomials p₁
and p₂
, and coefficients&terms used to construct it.
Given polynomials with leading terms k₁*m₁
and k₂*m₂
, the S-polynomial is defined as:
S(p₁, p₂) = (k₂/gcd(k₁, k₂)) * (lcm(m₁, m₂)/m₁) * p₁ - (k₁/gcd(k₁, k₂)) * (lcm(m₁, m₂)/m₂) * p₂
Remark: if char? = some c
, then c
is the characteristic of the ring.
Instances For
Result of simplifying a polynomial p₁
using a polynomial p₂
.
The simplification rewrites the first monomial of p₁
that can be divided
by the leading monomial of p₂
.
- p : Poly
The resulting simplified polynomial after rewriting.
- k₁ : Int
The integer coefficient multiplied with polynomial
p₁
in the rewriting step. - k₂ : Int
The integer coefficient multiplied with polynomial
p₂
during rewriting. - m₂ : Mon
The monomial factor applied to polynomial
p₂
.
Instances For
Simplifies polynomial p₁
using polynomial p₂
by rewriting.
This function attempts to rewrite p₁
by eliminating the first occurrence of
the leading monomial of p₂
.
Remark: if char? = some c
, then c
is the characteristic of the ring.
Equations
- p₁.simp? (Lean.Grind.CommRing.Poly.add k₂' m₂ p₂_2) char? = Lean.Grind.CommRing.Poly.simp?.go? char? k₂' m₂ p₂_2 p₁
- p₁.simp? p₂ char? = none
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Lean.Grind.CommRing.Poly.simp?.go? char? k₂' m₂ p₂ (Lean.Grind.CommRing.Poly.num k) = none
Instances For
Equations
- (Lean.Grind.CommRing.Poly.num k).degree = 0
- (Lean.Grind.CommRing.Poly.add k m p).degree = m.degree
Instances For
Returns true
if the leading monomial of p
divides m
.
Equations
- (Lean.Grind.CommRing.Poly.num k).divides m = true
- (Lean.Grind.CommRing.Poly.add k m_1 p_1).divides m = m_1.divides m
Instances For
Returns the leading coefficient of the given polynomial
Equations
- (Lean.Grind.CommRing.Poly.num k).lc = k
- (Lean.Grind.CommRing.Poly.add k m p).lc = k
Instances For
Returns the leading monomial of the given polynomial.
Equations
Instances For
Equations
- (Lean.Grind.CommRing.Poly.num k).checkCoeffs = true
- (Lean.Grind.CommRing.Poly.add k m p).checkCoeffs = (k != 0 && p.checkCoeffs)
Instances For
Equations
Instances For
Equations
Instances For
Equations
- Lean.Grind.CommRing.Poly.gcdCoeffs.go (Lean.Grind.CommRing.Poly.num k) acc = if (acc == 1) = true then acc else acc.gcd k.natAbs
- Lean.Grind.CommRing.Poly.gcdCoeffs.go (Lean.Grind.CommRing.Poly.add k m p_1) acc = if (acc == 1) = true then acc else Lean.Grind.CommRing.Poly.gcdCoeffs.go p_1 (acc.gcd k.natAbs)
Instances For
Equations
- (Lean.Grind.CommRing.Poly.num k).divConst a = Lean.Grind.CommRing.Poly.num (k / a)
- (Lean.Grind.CommRing.Poly.add k m p_1).divConst a = Lean.Grind.CommRing.Poly.add (k / a) m (p_1.divConst a)
Instances For
Equations
- Lean.Grind.CommRing.Mon.unit.size = 0
- (Lean.Grind.CommRing.Mon.mult p m).size = m.size + 1
Instances For
Equations
- (Lean.Grind.CommRing.Poly.num k).size = 1
- (Lean.Grind.CommRing.Poly.add k m p).size = m.size + 1 + p.size
Instances For
Equations
- (Lean.Grind.CommRing.Poly.num k).length = 0
- (Lean.Grind.CommRing.Poly.add k m p).length = 1 + p.length