Slide 6
Slide 6 text
Algebraic types
Abstract algebra can be useful when generalizing to new structures
Helps us to easily translate between mathematics and source code
Most of the time in numerical computing, we are dealing with Fields
A ļ¬eld is a set F with two operations + and Ć, with the properties:
Associativity: āa, b, c ā F, a + (b + c) = (a + b) + c
Commutivity: āa, b ā F, a + b = b + a and a Ć b = b Ć a
Distributivity: āa, b, c ā F, a Ć (b Ć c) = (a Ć b) Ć c
Identity: āa ā F, ā0, 1 ā F s.t. a + 0 = a and a Ć 1 = a
+ inverse: āa ā F, ā ā a s.t. a + (āa) = 0
Ć inverse: āa = 0 ā F, āaā1 s.t. a Ć aā1 = 1
Readily extensible to complex numbers, quaternions, dual numbers
Field arithmetic can be implemented using parametric polymorphism
What is a program, but a series of arithmetic operations?
Sajovic & Vuk, Operational Calculus for Diļ¬erentiable Programming
Breandan Considine (UdeM) Kotlinā January 15, 2019 6 / 16