Proving that a category is cartesian closed Let $Alg(1)$ be a category whose objects are sets with a unary operation, with no axioms. Morphisms of the category are functions of sets which preserve the operation. I need to show that this category is cartesian closed and that the exponential $B^A$ is $Hom(A \times \mathbb{N},B)$ where $\mathbb{N}$ is the algebra of natural numbers with the successor operation that sends a function $h$ to $h'(a,n) = h(a,n+1)$.
Here is my incomplete attempt. Any other viable approach is welcome. Now, I tried to prove this using the universality of the counit, that is to show that for each $f \in Hom(C \times A, B)$ there exists a unique $f': C \rightarrow Hom(A \times \mathbb{N},B)$ such that $f = (f'\times 1_A) \circ e$, where $e$ is the evaluation map, defined as $e: Hom(A \times \mathbb{N},B) \times A \rightarrow B$ by sending $e(\varphi,a) \mapsto \varphi(a,0)$. It is easy to see that $f'(c) \mapsto \varphi_c(-,0):=f(c,-)$ satisfies the requirement above. If we extend by $\varphi_c(-,1):=f(s(c),-)$, where $s$ is the unary operation on $C$ we get that $f'$ preserves the unary operation: $f'(s(c))=s(f'(c))=s(\varphi_c(-,0))=\varphi_c(-,1)=f(s(c),-)$, which again works when composed with $e$ and $f$. The only thing that I am missing is to show that this $f'$ is unique, if the above is correct of course.
 A: I'll use $\cal A$ to denote the category $Alg(1)$. Note that $\cal A$ is the category whose objects are endomorphisms, and it can be identified with the functor category $\mathbf{Set}^\Bbb N$, where $\Bbb N$ is the category with a single object and with natural numbers as arrows and their addition as composition. That's because $\Bbb N$ is the free category on the graph $\Large\circlearrowleft$, so any functor $\Bbb N\to\mathbf{Set}$ is determined by the choice of some endomorphism. Furthermore every natural transformation between two such functors is just a map respecting the operation.
In a functor category, limits are computed pointwise, so the product of two operations $f:A\to A$ and $g:B\to B$ is just the product map $f\times g:A\times B\to A\times B$. We want to show that for each $\alpha:A\to A$, the functor $-\times\alpha$ has a right adjoint.
So we define for every $\beta:B\to B$ an object $β^α:\mathcal A(α×s,β)\to\mathcal A(α×s,β)$ which is the operation sending $h$ to the map $(a,n)\mapsto h(a,s(n))$, where $s:\Bbb N\to\Bbb N$ is the successor operation $n\mapsto n+1$. Then we define $e:β^α×α\toβ$ to be given by the map
$$e:\mathcal A(α×s,β)\times A\to B,\ (h,a)=h(a,0)$$
We need to check that $e(β^α×α)=βe$. So take $(h,a)$, then
$$e(β^αh,αa)=β^αh(αa,0)=h(αa,1)=h((α×s)(a,0))=βh(a,0)=βe(h,a)$$
Now given $f:γ×α\toβ$, where $γ:C\to C$ is an operation, we want an $f':γ\toβ^α$ such that $e(f'×1_A)=f$, that means $f':C\to\mathcal A(α×s,β)$ has to satisfy
$$
f'(c)(a,0)=f(c,a)\\ 
f'(c)(a,n+1)=β^αf'(c)(a,n)=f'γ(c)(a,n)\\
f'(c)(αa,n+1)=βf'(c)(a,n)
$$
The first two conditions determine $f'(c)$ inductively on $A×\Bbb N$. To verify the third condition, assume by induction that
$$
f'γ(c)(αa,n)=βf'(c)(a,n)
$$
The initial case $n=0$ is just the fact that $f$ preserves the operation.
Then
$$
f'(c)(αa,n+2)=f'γ(c)(αa,n+1)=f'γγ(c)(αa,n)=βf'γ(c)(a,n)=βf'(c)(a,n+1)
$$
which completes the induction.
