# Lemmas about the sup and inf of the support of AddMonoidAlgebra#

## TODO #

The current plan is to state and prove lemmas about Finset.sup (Finsupp.support f) D with a "generic" degree/weight function D from the grading Type A to a somewhat ordered Type B.

Next, the general lemmas get specialized for some yet-to-be-defined degrees.

# sup-degree and inf-degree of an AddMonoidAlgebra#

Let R be a semiring and let A be a SemilatticeSup. For an element f : R[A], this file defines

• AddMonoidAlgebra.supDegree: the sup-degree taking values in WithBot A,
• AddMonoidAlgebra.infDegree: the inf-degree taking values in WithTop A.

If the grading type A is a linearly ordered additive monoid, then these two notions of degree coincide with the standard one:

• the sup-degree is the maximum of the exponents of the monomials that appear with non-zero coefficient in f, or ⊥, if f = 0;
• the inf-degree is the minimum of the exponents of the monomials that appear with non-zero coefficient in f, or ⊤, if f = 0.

The main results are

• AddMonoidAlgebra.supDegree_mul_le: the sup-degree of a product is at most the sum of the sup-degrees,
• AddMonoidAlgebra.le_infDegree_mul: the inf-degree of a product is at least the sum of the inf-degrees,
• AddMonoidAlgebra.supDegree_add_le: the sup-degree of a sum is at most the sup of the sup-degrees,
• AddMonoidAlgebra.le_infDegree_add: the inf-degree of a sum is at least the inf of the inf-degrees.

## Implementation notes #

The current plan is to state and prove lemmas about Finset.sup (Finsupp.support f) D with a "generic" degree/weight function D from the grading Type A to a somewhat ordered Type B. Next, the general lemmas get specialized twice:

• once for supDegree (essentially a simple application) and
• once for infDegree (a simple application, via OrderDual).

These final lemmas are the ones that likely get used the most. The generic lemmas about Finset.support.sup may not be used directly much outside of this file. To see this in action, you can look at the triple (sup_support_mul_le, maxDegree_mul_le, le_minDegree_mul).

In this section, we use degb and degt to denote "degree functions" on A with values in a type with bot or top respectively.

theorem AddMonoidAlgebra.sup_support_add_le {R : Type u_1} {A : Type u_3} {B : Type u_5} [] [] [] (degb : AB) (f : ) (g : ) :
(f + g).support.sup degb f.support.sup degb g.support.sup degb
theorem AddMonoidAlgebra.le_inf_support_add {R : Type u_1} {A : Type u_3} {T : Type u_4} [] [] [] (degt : AT) (f : ) (g : ) :
f.support.inf degt g.support.inf degt (f + g).support.inf degt
theorem AddMonoidAlgebra.sup_support_mul_le {R : Type u_1} {A : Type u_3} {B : Type u_5} [] [] [] [Add A] [Add B] [CovariantClass B B (fun (x x_1 : B) => x + x_1) fun (x x_1 : B) => x x_1] [CovariantClass B B (Function.swap fun (x x_1 : B) => x + x_1) fun (x x_1 : B) => x x_1] {degb : AB} (degbm : ∀ {a b : A}, degb (a + b) degb a + degb b) (f : ) (g : ) :
(f * g).support.sup degb f.support.sup degb + g.support.sup degb
theorem AddMonoidAlgebra.le_inf_support_mul {R : Type u_1} {A : Type u_3} {T : Type u_4} [] [] [] [Add A] [Add T] [CovariantClass T T (fun (x x_1 : T) => x + x_1) fun (x x_1 : T) => x x_1] [CovariantClass T T (Function.swap fun (x x_1 : T) => x + x_1) fun (x x_1 : T) => x x_1] {degt : AT} (degtm : ∀ {a b : A}, degt a + degt b degt (a + b)) (f : ) (g : ) :
f.support.inf degt + g.support.inf degt (f * g).support.inf degt
theorem AddMonoidAlgebra.sup_support_list_prod_le {R : Type u_1} {A : Type u_3} {B : Type u_5} [] [] [] [] [] [CovariantClass B B (fun (x x_1 : B) => x + x_1) fun (x x_1 : B) => x x_1] [CovariantClass B B (Function.swap fun (x x_1 : B) => x + x_1) fun (x x_1 : B) => x x_1] {degb : AB} (degb0 : degb 0 0) (degbm : ∀ (a b : A), degb (a + b) degb a + degb b) (l : List ()) :
l.prod.support.sup degb (List.map (fun (f : ) => f.support.sup degb) l).sum
theorem AddMonoidAlgebra.le_inf_support_list_prod {R : Type u_1} {A : Type u_3} {T : Type u_4} [] [] [] [] [] [CovariantClass T T (fun (x x_1 : T) => x + x_1) fun (x x_1 : T) => x x_1] [CovariantClass T T (Function.swap fun (x x_1 : T) => x + x_1) fun (x x_1 : T) => x x_1] {degt : AT} (degt0 : 0 degt 0) (degtm : ∀ (a b : A), degt a + degt b degt (a + b)) (l : List ()) :
(List.map (fun (f : ) => f.support.inf degt) l).sum l.prod.support.inf degt
theorem AddMonoidAlgebra.sup_support_pow_le {R : Type u_1} {A : Type u_3} {B : Type u_5} [] [] [] [] [] [CovariantClass B B (fun (x x_1 : B) => x + x_1) fun (x x_1 : B) => x x_1] [CovariantClass B B (Function.swap fun (x x_1 : B) => x + x_1) fun (x x_1 : B) => x x_1] {degb : AB} (degb0 : degb 0 0) (degbm : ∀ (a b : A), degb (a + b) degb a + degb b) (n : ) (f : ) :
(f ^ n).support.sup degb n f.support.sup degb
theorem AddMonoidAlgebra.le_inf_support_pow {R : Type u_1} {A : Type u_3} {T : Type u_4} [] [] [] [] [] [CovariantClass T T (fun (x x_1 : T) => x + x_1) fun (x x_1 : T) => x x_1] [CovariantClass T T (Function.swap fun (x x_1 : T) => x + x_1) fun (x x_1 : T) => x x_1] {degt : AT} (degt0 : 0 degt 0) (degtm : ∀ (a b : A), degt a + degt b degt (a + b)) (n : ) (f : ) :
n f.support.inf degt (f ^ n).support.inf degt
theorem AddMonoidAlgebra.sup_support_multiset_prod_le {R : Type u_1} {A : Type u_3} {B : Type u_5} [] [] [] [] [] [CovariantClass B B (fun (x x_1 : B) => x + x_1) fun (x x_1 : B) => x x_1] [CovariantClass B B (Function.swap fun (x x_1 : B) => x + x_1) fun (x x_1 : B) => x x_1] {degb : AB} (degb0 : degb 0 0) (degbm : ∀ (a b : A), degb (a + b) degb a + degb b) (m : Multiset ()) :
m.prod.support.sup degb (Multiset.map (fun (f : ) => f.support.sup degb) m).sum
theorem AddMonoidAlgebra.le_inf_support_multiset_prod {R : Type u_1} {A : Type u_3} {T : Type u_4} [] [] [] [] [] [CovariantClass T T (fun (x x_1 : T) => x + x_1) fun (x x_1 : T) => x x_1] [CovariantClass T T (Function.swap fun (x x_1 : T) => x + x_1) fun (x x_1 : T) => x x_1] {degt : AT} (degt0 : 0 degt 0) (degtm : ∀ (a b : A), degt a + degt b degt (a + b)) (m : Multiset ()) :
(Multiset.map (fun (f : ) => f.support.inf degt) m).sum m.prod.support.inf degt
theorem AddMonoidAlgebra.sup_support_finset_prod_le {R : Type u_1} {A : Type u_3} {B : Type u_5} {ι : Type u_6} [] [] [] [] [] [CovariantClass B B (fun (x x_1 : B) => x + x_1) fun (x x_1 : B) => x x_1] [CovariantClass B B (Function.swap fun (x x_1 : B) => x + x_1) fun (x x_1 : B) => x x_1] {degb : AB} (degb0 : degb 0 0) (degbm : ∀ (a b : A), degb (a + b) degb a + degb b) (s : ) (f : ι) :
(s.prod fun (i : ι) => f i).support.sup degb s.sum fun (i : ι) => (f i).support.sup degb
theorem AddMonoidAlgebra.le_inf_support_finset_prod {R : Type u_1} {A : Type u_3} {T : Type u_4} {ι : Type u_6} [] [] [] [] [] [CovariantClass T T (fun (x x_1 : T) => x + x_1) fun (x x_1 : T) => x x_1] [CovariantClass T T (Function.swap fun (x x_1 : T) => x + x_1) fun (x x_1 : T) => x x_1] {degt : AT} (degt0 : 0 degt 0) (degtm : ∀ (a b : A), degt a + degt b degt (a + b)) (s : ) (f : ι) :
(s.sum fun (i : ι) => (f i).support.inf degt) (s.prod fun (i : ι) => f i).support.inf degt

### Shorthands for special cases #

Note that these definitions are reducible, in order to make it easier to apply the more generic lemmas above.

@[reducible, inline]
abbrev AddMonoidAlgebra.supDegree {R : Type u_1} {A : Type u_3} {B : Type u_5} [] [] [] (D : AB) (f : ) :
B

Let R be a semiring, let A be an AddZeroClass, let B be an OrderBot, and let D : A → B be a "degree" function. For an element f : R[A], the element supDegree f : B is the supremum of all the elements in the support of f, or ⊥ if f is zero. Often, the Type B is WithBot A, If, further, A has a linear order, then this notion coincides with the usual one, using the maximum of the exponents.

Equations
• = f.support.sup D
Instances For
theorem AddMonoidAlgebra.supDegree_add_le {R : Type u_1} {A : Type u_3} {B : Type u_5} [] [] [] [] {D : AB} {f : } {g : } :
@[simp]
theorem AddMonoidAlgebra.supDegree_neg {R' : Type u_2} {A : Type u_3} {B : Type u_5} [Ring R'] [] [] [] {D : AB} {f : } :
theorem AddMonoidAlgebra.supDegree_sub_le {R' : Type u_2} {A : Type u_3} {B : Type u_5} [Ring R'] [] [] [] {D : AB} {f : } {g : } :
theorem AddMonoidAlgebra.supDegree_sum_le {R : Type u_1} {A : Type u_3} {B : Type u_5} [] [] [] {D : AB} {ι : Type u_7} {s : } {f : ι} :
AddMonoidAlgebra.supDegree D (s.sum fun (i : ι) => f i) s.sup fun (i : ι) =>
theorem AddMonoidAlgebra.supDegree_single_ne_zero {R : Type u_1} {A : Type u_3} {B : Type u_5} [] [] [] {D : AB} (a : A) {r : R} (hr : r 0) :
theorem AddMonoidAlgebra.supDegree_single {R : Type u_1} {A : Type u_3} {B : Type u_5} [] [] [] {D : AB} (a : A) (r : R) :
= if r = 0 then else D a
@[simp]
theorem AddMonoidAlgebra.supDegree_zero {R : Type u_1} {A : Type u_3} {B : Type u_5} [] [] [] [] {D : AB} :
theorem AddMonoidAlgebra.ne_zero_of_supDegree_ne_bot {R : Type u_1} {A : Type u_3} {B : Type u_5} [] [] [] [] {D : AB} {p : } :
p 0
theorem AddMonoidAlgebra.ne_zero_of_not_supDegree_le {R : Type u_1} {A : Type u_3} {B : Type u_5} [] [] [] [] {D : AB} {p : } {b : B} (h : ¬) :
p 0
theorem AddMonoidAlgebra.apply_eq_zero_of_not_le_supDegree {R : Type u_1} {A : Type u_3} {B : Type u_5} [] [] [] {D : AB} {p : } {a : A} (hlt : ¬D a ) :
p a = 0
theorem AddMonoidAlgebra.supDegree_mul_le {R : Type u_1} {A : Type u_3} {B : Type u_5} [] [] [] [Add B] [] {D : AB} {p : } {q : } (hadd : ∀ (a1 a2 : A), D (a1 + a2) = D a1 + D a2) [CovariantClass B B (fun (x x_1 : B) => x + x_1) fun (x x_1 : B) => x x_1] [CovariantClass B B (Function.swap fun (x x_1 : B) => x + x_1) fun (x x_1 : B) => x x_1] :
theorem AddMonoidAlgebra.supDegree_prod_le {R : Type u_7} {A : Type u_8} {B : Type u_9} [] [] [] [] [] [CovariantClass B B (fun (x x_1 : B) => x + x_1) fun (x x_1 : B) => x x_1] [CovariantClass B B (Function.swap fun (x x_1 : B) => x + x_1) fun (x x_1 : B) => x x_1] {D : AB} (hzero : D 0 = 0) (hadd : ∀ (a1 a2 : A), D (a1 + a2) = D a1 + D a2) {ι : Type u_10} {s : } {f : ι} :
AddMonoidAlgebra.supDegree D (s.prod fun (i : ι) => f i) s.sum fun (i : ι) =>
theorem AddMonoidAlgebra.apply_add_of_supDegree_le {R : Type u_1} {A : Type u_3} {B : Type u_5} [] [] [] [Add B] [] {D : AB} {p : } {q : } (hadd : ∀ (a1 a2 : A), D (a1 + a2) = D a1 + D a2) [CovariantClass B B (fun (x x_1 : B) => x + x_1) fun (x x_1 : B) => x < x_1] [CovariantClass B B (Function.swap fun (x x_1 : B) => x + x_1) fun (x x_1 : B) => x < x_1] (hD : ) {ap : A} {aq : A} (hp : D ap) (hq : D aq) :
(p * q) (ap + aq) = p ap * q aq
theorem AddMonoidAlgebra.supDegree_withBot_some_comp {R : Type u_1} {A : Type u_3} {B : Type u_5} [] [] [] {D : AB} {s : } (hs : s.support.Nonempty) :
Let R be a semiring, let A be an AddZeroClass, let T be an OrderTop, and let D : A → T be a "degree" function. For an element f : R[A], the element infDegree f : T is the infimum of all the elements in the support of f, or ⊤ if f is zero. Often, the Type T is WithTop A, If, further, A has a linear order, then this notion coincides with the usual one, using the minimum of the exponents.