tuesday event
May. 28th, 2021 07:32 amJohn De Goes is Programming Without Type Classes
Type classes have become a cornerstone of statically-typed functional programming, powering abstractions like monoid and monad. Yet, type classes often have generalized names, which don’t reflect their purpose in specific domains; and they incur higher learning costs, especially when emulated in languages without them.
In this presentation, John De Goes discusses the pros and cons of using type classes, and presents a systematic method for building powerful functional components that do not require type classes. Attendees will learn how to preserve the benefits of principled, algebraic functional programming, without forcing type classes on coworkers or users.
my book with Table of Contents
Oct. 9th, 2019 04:18 pmhttps://gumroad.com/l/lcbk02
Chapter 1. Functions
- General Ideas
- Main Definitions
- Special Classes of Functions
- Binary Relations
- Binary Operations
Chapter 2. Abstractions of Algebra
- Monoids
- Semigroups
- Magmas
Chapter 3. Partial Orders, Graphs, and DAGs
Chapter 4. Boolean Logic
- The Language of First-Order Logic
- Valid and Sound Arguments
- Proofs
- Normal Forms
Chapter 5. Non-Boolean Logic
- The Meaning of Non-Booleanness
- Proof in Intuitionistic Logic
Chapter 6. Quantifiers
- Universal Quantifier
- Existential Quantifier
- Connectives and Quantifiers in Boolean Logic
- Connectives and Quantifiers in Intuitionistic Logic
Chapter 7. Models and Theories
- Algebraic and Geometric Theories
- Models
Chapter 8. Category: Multi-Tiered Monoid
Chapter 9. Working with Categories
- Arrows in a Category
- Initial and Terminal Objects
Chapter 10. Manipulating Objects in a Category
- Product, Sum
- Equalizer, Coequalizer
- Pullback, Pushout
Chapter 11. Relations Between Categories
- Functors
- Building New Categories
- Product of Two Categories
- Sum of Two Categories
- Contravariant Functor
- Variance in Programming Languages
Chapter 12. Relations Between Functors
- Natural Transformations
- Adjoint Functors
- Limits
Chapter 13. Cartesian Closed Categories
- Basic Ideas
- Examples
- Definition: Bicartesian Closed Category
Chapter 14. Monads
- Main Ideas
- Every Adjunction Gives a Monad
Chapter 15. Monads: Algebras and Kleisli
- Category of Algebras
- Free Algebras as Functors
- Forgetting and Freedom
- Kleisli Category
just occurred to me
Aug. 29th, 2019 09:24 amThe search of a "universal foundation" of math is actually the search of a universal model for all possible math theories.
Now the idea looks totally weird. It's been 90 years now since Gödel showed something to the world. And still...
There's no universal foundation! A foundation is just another theory.
a bunch of links
Mar. 10th, 2019 08:12 amModel Theory and Category Theory - high level, but easy reading
Solving the mystery behind Abstract Algorithm’s magical optimizations - here the author implements, in lambda, algorithms with unusually fast performance. Explanations follow (links inside)
A link to the author's github project
amazingly simple set theory
Mar. 8th, 2019 01:59 pmPST also verifies the:
- Continuum hypothesis. This follows from (5) and (6) above;
- Axiom of replacement. This is a consequence of (A4);
- Axiom of choice. Proof. The class Ord of all ordinals is well-ordered by definition. Ord and the class V of all sets are both proper classes, because of the Burali-Forti paradox and Cantor's paradox, respectively. Therefore there exists a bijection between V and Ord, which well-orders V. ∎
The well-foundedness of all sets is neither provable nor disprovable in PST.
Leinster wrote in 2012: "rethinking".
People went crazy.
And it seems like nobody fucking knows there's a difference between a theory and a model.
That's how Chaitin was stating that there are "mathematical truths" that are true but don't follow from axioms.
For god's sake, it's been 90 years since Gödel explained it all. And? Anybody asked, how come ZFC is not based on ZFC? (sigh)
news of the century
Jan. 10th, 2019 08:46 pmDo you know what "continuum hypothesis" is? It's about whether there is an intermediate size set between a countable (ℵ0), for example, natural numbers, and 2^countable (ℵ1). It's been proven over 50 years ago that neither the existence nor the non-existence follows from the axioms of Zermelo-Fraenkel. So, when mathematicians say that they base their absolutely strict and correct theorems on set theory (I don't believe them), we can always ask - which one?
Now the things got more serious.
Suppose you are a serious "machine learning data scientist", and you want to base your tea-leaves guesses on a solid math. That is, figure out the theory behind taking billions of pictures of cats and dogs and detecting cats on them (my former colleagues was focusing on figuring out whether he has a cat or a mouse, and figured that if the fur is uniform gray, the "algorithm" says it's a mouse. Do you have a Russian Blue?)
So, what we do, while "detecting", is a kind of data compression. It's closer to something like mapping, 2^N -> N.
Now, surprise. The feasibility of this operation, in general settings, is equivalent to having a finite number of intermediate sizes between ℵ0 and ℵ1.
Details are here: https://www.nature.com/articles/s42256-018-0002-3
Learnability can be undecidable
"The mathematical foundations of machine learning play a key role in the development of the field. They improve our understanding and provide tools for designing new learning paradigms. The advantages of mathematics, however, sometimes come with a cost. Gödel and Cohen showed, in a nutshell, that not everything is provable. Here we show that machine learning shares this fate. We describe simple scenarios where learnability cannot be proved nor refuted using the standard axioms of mathematics. Our proof is based on the fact the continuum hypothesis cannot be proved nor refuted. We show that, in some cases, a solution to the ‘estimating the maximum’ problem is equivalent to the continuum hypothesis. The main idea is to prove an equivalence between learnability and compression."OTOH, Andreas Blass was rather good at bashing CT, like.
Update. https://mathoverflow.net/questions/319622/sets-are-a-popular-construction-in-programming-languages-is-there-a-solid-theor?noredirect=1#comment796756_319622 - меня попрекают отсутствием веры в математику! Вера в математику, Карл! Тут что-то такое кроется, о чем я не догадывался. Хоть я и работаю иезуитом.
Chaitin's constant
Nov. 27th, 2018 08:45 pmA probability, no digit of which can be calculated.
import scala.reflect.ClassTag
trait NonEnumerableSet[T] extends Set[T] {
private def notEnumerable =
throw new UnsupportedOperationException("This set is not enumerable")
override def isEmpty: Boolean = notEnumerable
def iterator: Iterator[T] = notEnumerable
override def toArray[S >: T : ClassTag]: Array[S] = notEnumerable
override def +(elem: T): Set[T] = notEnumerable
override def -(elem: T): Set[T] = notEnumerable
}
is a nonempty set equipped with a ternary operation satisfying the relations
More generally, a ternary operation in some variety of algebras satisfying the first pair of equations is called a Mal'cev operation. A Mal’cev operation is called associative if it also satisfies the latter equation (i.e. it makes its domain into a heap).
heap to monoid is like affine space to linear space
книжечку присоветовали
Oct. 26th, 2018 09:21 pmPractical Foundations of Mathematics
Paul Taylor
talking about functions in Haskell
Jul. 5th, 2018 01:49 pmTLDR: there's no way you can define in set theory a function that does not return a result. (Actually you can, but then the whole sets axiomatics should be overhauled.)
foundations of math
Aug. 27th, 2017 10:59 pmsrc
trisection of an angle
Aug. 7th, 2017 06:09 pmSo there.
Just occurred to me. Reducing facts of real life to math entities is a kind of Dunning-Kruger disease. You can't get the complexity and all the aspects, but math you know, so kaboom - a monad! a linear space! a probability! a derivative! an integral!
Sad.
Same with logic, by the way.