Idris2Doc : Algebra.Solver.Ring.Sum

Algebra.Solver.Ring.Sum

(source)

Definitions

recordTerm : (a : Type) ->Lista->Type
  A single term in a normalized arithmetic expressions.

This is a product of all variables each raised to
a given power, multiplied with a factors (which is supposed
to reduce during elaboration).

Totality: total
Visibility: public export
Constructor: 
T : a->Prodaas->Termaas

Projections:
.factor : Termaas->a
.prod : Termaas->Prodaas
.factor : Termaas->a
Totality: total
Visibility: public export
factor : Termaas->a
Totality: total
Visibility: public export
.prod : Termaas->Prodaas
Totality: total
Visibility: public export
prod : Termaas->Prodaas
Totality: total
Visibility: public export
eterm : Ringa=>Termaas->a
  Evaluate a term.

Totality: total
Visibility: public export
negTerm : Ringa=>Termaas->Termaas
  Negate a term.

Totality: total
Visibility: public export
dataSum : (a : Type) ->Lista->Type
  Normalized arithmetic expression in a commutative
ring (represented as an (ordered) sum of terms).

Totality: total
Visibility: public export
Constructors:
Nil : Sumaas
(::) : Termaas->Sumaas->Sumaas
esum : Ringa=>Sumaas->a
  Evaluate a sum of terms.

Totality: total
Visibility: public export
negate : Ringa=>Sumaas->Sumaas
  Negate a sum of terms.

Totality: total
Visibility: public export
Fixity Declaration: prefix operator, level 10
add : SolvableRinga=>Sumaas->Sumaas->Sumaas
  Add two sums of terms.

The order of terms will be kept. If two terms have identical
products of variables, they will be unified by adding their
factors.

Totality: total
Visibility: public export
normSum : SolvableRinga=>Sumaas->Sumaas
  Normalize a sum of terms by removing all terms with a
`zero` factor.

Totality: total
Visibility: public export
mult1 : SolvableRinga=>Termaas->Sumaas->Sumaas
  Multiplies a single term with a sum of terms.

Totality: total
Visibility: public export
mult : SolvableRinga=>Sumaas->Sumaas->Sumaas
  Multiplies two sums of terms.

Totality: total
Visibility: public export
norm : SolvableRinga=>Expraas->Sumaas
  Normalizes an arithmetic expression to a sum of products.

Totality: total
Visibility: public export
normalize : SolvableRinga=>Expraas->Sumaas
  Like `norm` but removes all `zero` terms.

Totality: total
Visibility: public export
0solve : {auto{conArg:5511} : SolvableRinga} -> (as : Lista) -> (e1 : Expraas) -> (e2 : Expraas) ->normalizee1=normalizee2=>evale1=evale2
  Given a list `as` of variables and two arithmetic expressions
over these variables, if the expressions are converted
to the same normal form, evaluating them gives the same
result.

This simple fact allows us to conveniently and quickly
proof arithmetic equalities required in other parts of
our code. For instance:

```idris example
0 binom1 : {x,y : Bits8}
-> (x + y) * (x + y) === x * x + 2 * x * y + y * y
binom1 = solve [x,y]
((x .+. y) * (x .+. y))
(x .*. x + 2 *. x *. y + y .*. y)
```

Totality: total
Visibility: export