Non-formal introduction - just some motivational examples

Peano axioms

See Peano axioms for details. I will give simplified explanation:

  1. - zero is a natural number
  2. - is a natural number

So solution of this equation: forms all natural numbers.

Solution in this case can refer to (either):

  • minimal solution
  • unique solution
  • maximal solution

Result:

Kleene closure

Classically denoted as . But also can be written in form of Chomsky rules:

So solution of this equation: forms language for Kleene closure .

Result: e.g. empty string, string “a”, string “aa” etc.

ADT list

Type signature for linked list in terms of ADT

List(T) = T * List(T) + 1

Or the same in terms of TypeScript:

type List<T> = {
  value: T;
  next: List<T>;
} | null;

Result: e.g. empty list, list with one item of type T, list with two items of type T, etc.

Conclusion

As we can see it’s all the same principles, but symbols are a bit different

NumbersLanguagesTypesSets
+|+
**
0
11, null,
  1. Algebra allows to describe “structures”
  2. Algebra can be applied to different areas. I skipped all details, but there are formal definitions which allow to specify exactly how operations behave, which allows to find exact correspondence between different system
  3. List is a graph (DAG), which brings us to idea that we can use algebra to specify graphs

Related subjects:

  • Algebraic graphs
  • Combinatorial species
  • Algebraic property graphs
  • Categorical query language

See also: