## 2014-07-22

### Filtration as implication


In this article, Jakub Marian defines square brackets to denote the filter function. It is defined thus for sets:$[p]\ xs = \{x:x\in xs\wedge p\ x\}$How do we use it? Well, Jakub translates classical:${}_\d^2x+{}_\d^2y=1\implies\abs\ (x\d y)\in\left[0,\frac 1 2\right]$into:$\abs\ (x\d y)\ [{}_\d^2x+{}_\d^2y=1]\subseteq\left[0,\frac 1 2\right]$where $x$ and $y$ are essentially the fst and snd functions, and the implicit argument is the set of all pairs of real numbers. I use $\abs$ rather than vertical bars for two reasons: vertical bars don't work well and I plan to have other uses for them in conjunction with brackets (to make syntax that looks similar to Haskell's quasi-quoters). Most notably, I need a notation for zip lists.

Getting back on topic, I think that this notation can be taken further. Notice how the $\abs\ (x\d y)$ and $\left[0,\frac 1 2\right]$ have become split up. This is not ideal. So, we can rephrase the whole thing as this:$\left(\abs\ (x\d y)\in\left[0,\frac 1 2\right]\right)\ [{}_\d^2x+{}_\d^2y=1]$I'd like to say that this has some new and interesting properties, but I can't find any right now. It does, though, give a different way of thinking about implication. It's more visual than the pure logical version, given that it uses sets (which can act like spaces).

I'd like to make some notes about relations. To make things work well, usual equality – along with the greater-than and less-than relations – are not defined for functors. This is because equality between functions makes more sense when the domain is considered. We should be able to say $(\Gamma\ \text{succ}=\text{fac})\ \mathbb{N}$. But if equality also worked on sets, our claim would become $\Gamma\ \text{succ}\ \mathbb{N}=\text{fac}\ \mathbb{N}$, which is a weaker claim than we wanted. Hence, we have to map from the inside out, mapping over the functions, then the set on the outside. $\equiv$ is provided for equality between anything other than functions.

An alternative that always uses $\equiv$ is to cast sets to zip lists before forking. $(\Gamma\ \text{succ}\equiv\text{fac})\ \text{zipList}\ \mathbb{N}$ is still the stricter claim. This is because lists maintain their order, so elements can be compared pairwise. However, I'm not sure whether it's realistic to expect people to remember to cast sets to lists just to allow forking. I think, though, that this is preferable, since the result is $\top$ or $\bot$, not $\{\top\}$, $\{\top,\bot\}$ or $\{\bot\}$ as it would be with the set solution. Maybe we should default to zip lists, even for things like $\mathbb{C}$, then cast them to sets (or just non-zip lists) as necessary.