0

I would like to define a function $v$ which takes as input an element of the ring $Q[t, t^{-1}]$ and returns the minimum degree of any term of the element. We should have $v(0)= \infty$. For example,

v[1/t-4/t^2+5t^2+t^{20}] = -2,
v[8t^6+t^{20}+ t^7] = 6,

I have tried to do something using the command CoefficientList, but it does not recognize 1/t as a term of a polynomial.

Michael E2
  • 235,386
  • 17
  • 334
  • 747
Madeline Brandt
  • 735
  • 3
  • 11

2 Answers2

1

Since the OP specifies the expression will be a polynomial in t and 1/t, a slight modification to @DanielLichtblau's use of Exponent seems to work.

valuation[expr_] := Exponent[expr, t, List] /. {e : {__} :> Min[e], {} -> -Infinity};

valuation[1/t - 4/t^2 + 5 t^2 + t^20]
valuation[8 t^6 + t^20 + t^7]
valuation[0]
(*
  -2
  6
  -∞
*)

There shouldn't be fractional exponents in an element of ${\bf Q}[t, t^{-1}]$, but Exponent works on them, too:

valuation[1/t - 4/t^(4/3) + 5 t^2 + t^20]
(*  -(4/3)  *)
Michael E2
  • 235,386
  • 17
  • 334
  • 747
0

Update 1: Should handle fractional powers.

Maybe just looking at series expansion around 0?

lowestOrder[someExpr_, t_] := 
 Series[someExpr, {t, 0, 
    0}] /. {SeriesData[t, 0, {a___}, b_, c_, d_] :> b/d, 
   a__ :> ∞}

Then:

SeedRandom[13]; 
Table[Rule[
   TraditionalForm@
    v@(someExpr = 
       Sum[RandomInteger[{-100, 
           100}] t^(RandomInteger[{-100, 100}]/
            RandomInteger[{1, 4}]), {RandomInteger[{0, 7}]}]), 
   lowestOrder[someExpr, t]], 10] // TableForm

yields

$$ \begin{array}{l} v\left(66 t^{45/2}+152 t^{12}\right)\to 12 \\ v\left(-32 t^{80/3}-22 t^{99/4}+65 \ t^{75/4}-\frac{17}{t^{34/3}}-\frac{24}{t^{43/3}}+\frac{75}{t^{51}}+56 \ t^{42}\right)\to -51 \\ v\left(-79 t^{41/2}+\frac{42}{t^{99}}-\frac{27}{t^3}\right)\to -99 \\ v (0)\to \infty \\ v\left(30 t^{37/2}-70 t^{38/3}-80 \ t^{29/4}-\frac{16}{t^{93}}+\frac{60}{t^{59}}-\frac{75}{t^{21}}\right)\to -93 \\ v\left(\frac{72}{t^{33/4}}+38 t^{55}-49 t^{33}\right)\to \ -\frac{33}{4} \\ v\left(25 t^{56/3}-42 t^{49/3}+47 t^{38/3}+\frac{47}{t^{79/3}}-59 \ t^7-10 t^3\right)\to -\frac{79}{3} \\ v\left(-46 \ t^{37/4}-\frac{6}{t^{75/4}}+\frac{35}{t^{77/4}}-\frac{31}{t^{41}}-64 \ t^{23}-72 t^{11}\right)\to -41 \\ v\left(30 \ t^{94/3}-\frac{59}{t^{98}}+\frac{21}{t^{33}}-\frac{69}{t^{10}}+\frac{\ 49}{t^3}\right)\to -98 \\ v\left(-90 t^{11}\right)\to 11 \\ \end{array} $$


Update 2: Clarifying return of valuations of non-vanishing constants e.g. v(32).

I'm not familiar with valuation conventions here. If valuation of non-vanishing constants should be 0, but valuation of strict expression v(0) should be $\infty$ then should rather define:

lowestOrder[someExpr_, t_] := 
 Series[someExpr, {t, 0, 
    0}] /. {SeriesData[t, 0, {a___}, b_, c_, d_] :> b/d, 
   0 :> ∞, a_ :> 0}

Update 3: Addressing CarlWoll's excellent point:

Despite its generosity in finite examples, SeriesData isn't contractually obligated to return the leading term -- in fact it has been known to offer a bound as to what the leading term won't be less than.

If we get suspicious about potential output of SeriesData, can riff off CarlWoll's leadingSeries answer here:

 leadingSeriesDegree[expr_, 
  x_] := (Normal[
    expr /. x -> (x + O[x]^2) /. 
     a_List :> Take[a, 1]]) /. {b___ Power[x, c_] :> c, 
   Power[x, c_] :> c, a_ x :> 1, x :> 1, 0 :> ∞, a_ :> 0}
  • 3
    I think your approach is a bit risky. Series[expr, {t, 0, 0}] is documented to return the 0th order term, but when that term is 0, there is no documentation on what n should be returned for the $O(t^n)$ term. You are relying on Series using the order of the leading term as n in this case, but I don't know that this is always true. One further comment: I can definitely come up with examples where Series returns $O(t^n)$ when there is no $t^n$ term in the series, but these examples have nonzero leading terms. – Carl Woll Sep 19 '17 at 22:00
  • This is a fine point -- updated answer to refer to your approach for extracting the leading term. – John Joseph M. Carrasco Sep 19 '17 at 22:26