# Counting homomorphisms from non-free Boolean algebras to the free Boolean algebra on $n$ generators

I have been foraying a bit into belief revision theory and formal epistemology recently, and that has ended up at me having to explore some universal algebra and combinatorics. I'll cut straight to the mathematical content of my question.

Let $$B$$ be a non-free Boolean algebra with $$n$$ generators. How could I think about counting the number of nontrivial Boolean algebra homomorphisms $$\phi : B \rightarrow \mathrm{F}_n$$, where $$\mathrm{F}_n$$ is the free Boolean algebra with $$n$$ generators? Is there a general method that I could apply here? I was thinking that perhaps I could consider homomorphisms from Boolean algebras within particular equational classes and start trying to compute some of those examples before generalizing.

I'd ideally like to generalize this to other types of structures to i.e from arbitrary Heyting algebras to the free Heyting algebra, but I figure starting with Boolean algebras is a good path.

Counting homomorphisms into finite Boolean algebras is straightforward. $$F_n$$ is just the Boolean algebra $$\{ 0, 1 \}^{2^n}$$, where the $$2^n$$ homomorphisms $$F_n \to \{ 0, 1 \}$$ are just given by all possible assignments of truth values to the $$n$$ generators. So the number of homomorphisms $$B \to F_n$$, for any Boolean algbebra $$B$$, is the number of homomorphisms $$B \to \{ 0, 1 \}$$ to the $$2^n$$th power.
The set of homomorphisms $$B \to \{ 0, 1 \}$$ is the Stone space of $$B$$, and how to calculate it depends on how you're given $$B$$, but in any case this argument reduces the general case to the case $$n = 0$$. If $$B$$ is finite (which is equivalent to being finitely generated) it is necessarily isomorphic to $$\{ 0, 1 \}^k$$ for some $$k$$ and then there are $$k$$ such homomorphisms. If $$B$$ is infinite then by Stone duality the Stone space must be infinite.
• Correction on the last sentence: there are infinite Boolean algebras with countable Stone spaces. For example, the algebra of finite and cofinite subsets of a countable set has Stone space isomorphic to $\omega+1$ (the one-point compactification of a countable discrete set). Commented May 31 at 23:04