# Arithmetic

There are functions to perform basic arithmetic operations (addition, subtraction etc.) on power series.

## `AlgComb(c, ss): RngMPolElt, SeqEnum -> RngPowAlgElt`

Given a polynomial $c$ in $r$ variables and a sequence $ss$ of $r$ power series (in a common domain with compatible coefficient field) return the series obtained by substituting the elements of $ss$ for the variables of $c$. This allows the construction of completely arbitrary algebraic combinations.

## `s + t: RngPowAlgElt, RngPowAlgElt -> RngPowAlgElt`

## `s - t: RngPowAlgElt, RngPowAlgElt -> RngPowAlgElt`

## `s * t: RngPowAlgElt, RngPowAlgElt -> RngPowAlgElt`

Add, subtract or multiply two power series.

## `Example: arith (ex-46bd4b)`

One can easily substitute power series into polynomials.

```magma
> // construct the series s0^2+s1^2
> h0 := AlgComb(x^2 + y^2, [s0,s1]);
> Expand(h0, 3);
true 10*x^2 + 2*x*y + y^2 - 6*x + 1

```

This includes of course the ring operations.

```magma
> h1 := Add(s1, PolyToSeries(One(Qxy)));
> Expand(h1, 4);
true
x^3 + 3*x^2*y + 3*x*y^2 + y^3 + x^2 + 2*x*y + y^2 + x + y + 1
> h2 := Mult(h1, PolyToSeries(1 - x - y));
> Expand(h2, 4);
true 1
> h3 := Add(h2, PolyToSeries(-One(Qxy)));
> Expand(h3, 4);
true 0

```
