Direct product is cancellative for finite algebras in any variety with zero

Statement
Suppose $$\mathcal{V}$$ is a variety of algebras that is a variety with zero. Suppose $$G,H,K$$ are finite algebras in $$\mathcal{V}$$. Further, suppose that the algebras $$G \times H$$ and $$G \times K$$ are isomorphic as algebras in $$\mathcal{V}$$. Then, $$H$$ is isomorphic to $$K$$.

Related facts

 * Direct product is cancellative for finite groups: Essentially the same proof, tailored to groups (the key specific detail for groups is that the congruences can be described using the normal subgroups that function as their kernels).

Facts used

 * 1) uses::Homomorphism set to direct product is Cartesian product of homomorphism sets: If $$A,B,C$$ are algebras, then there is a natural bijection:
 * 2) * $$\operatorname{Hom}(A,B) \times \operatorname{Hom}(A,C) \leftrightarrow \operatorname{Hom}(A,B \times C)$$.
 * 3) * The bijection is defined as: $$(\alpha,\beta) \mapsto (g \mapsto (\alpha(g),\beta(g))$$.
 * 4) uses::Homomorphism set is disjoint union of injective homomorphism sets: For algebras $$A$$ and $$B$$, let $$\operatorname{Hom}(A,B)$$ denotes the set of homomorphisms from $$A$$ to $$B$$, and $$\operatorname{IHom}(A,B)$$ denote the set of injective homomorphisms from $$A$$ to $$B$$. Then we have:

$$\operatorname{Hom}(A,B) = \bigsqcup_{~} \operatorname{IHom}(A/~, B)$$.

Here $$~$$ varies over the set of all possible congruences on the algebra $$A$$.

Proof
Given: Finite algebras $$G, H, K$$ such that $$G \times H \cong G \times K$$.

To prove: $$H \cong K$$.

Proof: Let $$L$$ be an arbitrary finite algebra in $$\mathcal{V}$$. Note that the trivial homomorphism refers to the map that sends every element to the zero element.