(defn join-multisets-by
[func]
(fn
([] {})
([a] a)
([a b]
(apply merge
(map
(fn [key]
(func
(if (contains? a key) (get a key) 0)
(if (contains? b key) (get b key) 0)))
(clojure.set/union (keys a) (keys b))))
([a b & more] (reduce func (func a b) more))))
(def join-multisets
(join-multisets-by max))
(def meet-multisets
(join-multisets-by min))
Sets can be defined as a particular type of multisets whose values are all equal to one, as such the set lattice is a sublattice of the multiset lattice dealing with just sets. On the other hand, multisets can be represented as sets by replacing the value for each key with an interval set from the minimal value to that number. All distributive lattices can be represented in terms of the multiset lattice.
Saturday, August 11, 2012
The lattice of multisets
The join operation in the multiset lattice is provided by taking the maximum value of each key present in any of the multisets and the meet operation is provided by taking the corresponding minimum value.
Saturday, July 21, 2012
Grid dimensions
The dimensions of a grid are mutable, but the area of the grid is not. As such, in my computer algebra system the dimensions relation is implemented as a place:
(setf [dimensions [[1 2 3] [4 5 6]]] [3 2])
The transpose operation on matrices can be implemented as an automorphism that rearranges the elements of the collection and that reverses the dimensions of the grid.
(zap reverse [dimensions coll])
Any permutation operation, including reverse, can be applied to the dimensions place without every producing an error because permutations do not change the area part of the underlying grid structure.
Sunday, July 1, 2012
Reversible functional programming
In the current reversible functional programming framework implementation, all functions will have a set of places that that they effect in their argument. Functions that do not effect the :trash place are bijections. By default all functions trash their entire input and return their output, and they effect the top level place.
In our reversible FP framework, our interest is to deviate from the default setup by establishing bijections and zap functions whenever possible. Parallelism occurs when functions that effect separate places are composed together.
In our reversible FP framework, our interest is to deviate from the default setup by establishing bijections and zap functions whenever possible. Parallelism occurs when functions that effect separate places are composed together.
Friday, June 29, 2012
Linear ordinary differential operators
Linear ordinary differential operators are endomorphisms of differentiable vector spaces, and they can be decomposed into separate functions that handle the complementary solution $y_c$ and the particular solution $y_p$ of a differential vector space.
Linear differential operators are inverted by linear integral operators, for example, the diff operator is inverted by antidiff. A variety of methods can be used to make linear differential operators invertible including laplace transforms and series methods.
Linear differential operators are inverted by linear integral operators, for example, the diff operator is inverted by antidiff. A variety of methods can be used to make linear differential operators invertible including laplace transforms and series methods.
Monday, June 25, 2012
Commutative decomposition of endofunctions
All endofunctions can be described as the composition of zap operations. If two different places are disjoint, then zap operations involving them commute. For example, the cube function only effects the magnitude of a number and - only effects its sign so these functions commute:
(= (compose (polynomial. [0 0 0 1]) (polynomial. [0 -1]))
(compose (polynomial. [0 -1]) (polynomial. [0 0 0 1])))
Doubling a number can be described as incrementing the multiplicity of the prime number factor 2 of the number, so multiplication commutes and $\mathbb{Q}+$ forms an abelian group. In general, two polynomials commute if they are either powers of x or chebyshev polynomials. First order homogeneous linear ordinary differential operators also commute under composition:
(= (compose (lodo. [0 1 1]) (lodo. [0 2 1]))
(compose (lodo. [0 2 1]) (lodo. [0 1 1])))
The behavior of the composition of linear ordinary differential operators corresponds to polynomial multiplication. These operators can be described as endomorphisms of vector spaces of differentiable functions.
Thursday, June 14, 2012
Arithmetic module
The arithmetic module deals with functions that are built out of the of addition, multiplication, and composition. All of these higher order operations have derivative laws associated with them: the sum rule, the product rule, and the chain rule. As such, this module includes derivative operations.
Entire functions are described entirely using power series. The functions exp, sin, cos, sinh, cosh, erfi, the reciprocal of gamma, all polynomials, and all addition, multiplication, and compositions of entire functions are entire. However, entire functions are not closed under inversion or division so ln, sqrt, and tan are not entire.
Linear ordinary differential operators receive functions as arguments and then they output new functions using higher order operations and differentiation. Linear ordinary differential operators are closed under composition, so they form their compositional monoid. The derivative function itself is a differential operator that uses a hidden multimethod internally that dispatches on the type of its arguments.
Entire functions are described entirely using power series. The functions exp, sin, cos, sinh, cosh, erfi, the reciprocal of gamma, all polynomials, and all addition, multiplication, and compositions of entire functions are entire. However, entire functions are not closed under inversion or division so ln, sqrt, and tan are not entire.
Linear ordinary differential operators receive functions as arguments and then they output new functions using higher order operations and differentiation. Linear ordinary differential operators are closed under composition, so they form their compositional monoid. The derivative function itself is a differential operator that uses a hidden multimethod internally that dispatches on the type of its arguments.
Thursday, June 7, 2012
The regularity of relations
The regularity of relations first leads us to functions which are relations with a out degree regularity of one. Functions that also have an in degree regularity are place forms, and if the in degree regularity of a function is one then the function is one-to-one. Since bijections are just special cases of place forms you can apply all place form functions to them:
(setf [reverse coll] '(3 2 1))
;=> (1 2 3)
Functions that cannot be expressed as place forms are in degree irregular. Count is an example of such a function, because there is only one type of empty collection, and there are many other possible collections for the other sizes. Monoids are also irregular functions because there is a different number of partitions for different objects in most monoids, unless you consider the identity.
Subscribe to:
Posts (Atom)