What’s wrong with this proof that a square is diffeomorphic to a circle? I am studying the rigorous definition of manifolds and diffeomorphisms, and am confused about the following. Intuition would suggest a square is not diffeomorphic to a circle because the square has sharp corners which are not differentiable, whereas the circle does not. (I have also heard people make statements along these lines.)
On the other hand, I am free to equip the square with charts that make it smooth. In fact, any reasonable way I can imagine to cover the square with charts leads to smooth transition maps, just like for the circle. The charts have no knowledge of the square's "corners."
So is the square in fact diffeomorphic to the circle, and if so, what do people mean when they talk about shapes with "sharp corners" not being smooth? (To be clear, I'm talking about the boundaries of these shapes as 1D manifolds.)

EDIT: Here is my atlas for the square, consisting of two charts, that I claim is a $C^\infty$-atlas.
Let $Q$ denote the unit square in $\mathbb R^2$, i.e., $Q=\{(x,0)\cup(1,x)\cup(x,1)\cup(0,x)|0\leq x\leq1]\}$ (ordered pairs denote points in $\mathbb R^2$, not intervals). Equip this set with the topology inherited from the standard topology on $\mathbb R^2$. 
For simplicity, let $A=Q\backslash(0,0), B=Q\backslash(0,1)$.
Here are my two charts:
$(A,\phi_A:A\to\mathbb R)$
$(x,0)\mapsto x$
$(1,x)\mapsto 1+x$
$(x,1)\mapsto 3-x)$
$(0,x)\mapsto 4-x)$
$\,$
$(B,\phi_B:B\to\mathbb R)$
$(1,x)\mapsto x$
$(x,1)\mapsto 2-x)$
$(0,x)\mapsto 3-x)$
$(x,0)\mapsto 3+x$
I'd rather not go through the painstaking task of writing out the chart transition maps from $A$ to $B$ and vice versa, but I think it's straightforward to see that they are $C^\infty$ maps from $\mathbb R$ to $\mathbb R$.
 A: Using your notation, you're right that you can define an atlas for $Q$ that makes it diffeomorphic to $S^1$ with the usual smooth structure. However, there isn't a smooth bijective map $S^1 \rightarrow Q \subset \mathbb{R}^2$ since the ambient space determines whether a map is smooth or not. In fact, a smooth manifold is just a Hausdorff topological space together with a smooth atlas, so ignoring the rest of $\mathbb{R}^2$ allows you to give it different smooth structures. Some textbooks emphasize this with notation like $(M, \{\phi_i\}_{i \in I})$. Hope this helps.
A: Take the square equipped with the subspace topology from the plane $\mathbb R^2$. Purely as a topological space, the square is homeomorphic to the circle, so the two are topologically indistinguishable. Hence when you say "the square" and talk about its "corners", you are referencing more than just its topology. When you specify the square as a subset of $\mathbb R^2$ as you did here it is not clear what structure you equip it with: just the subspace topology, or something more?
Fix a $C^\infty$ manifold $(X,\mathcal O_X)$, where $\mathcal O_X$ denotes the $C^\infty$ structure. Suppose $Y$ is a topological manifold (merely a topological space with a property but no extra structure) homeomorphic to $X$. In your context $X$ would be the circle with its usual $C^\infty$ structure and $Y$ would be the square. You can use any homeomorphism $f:X\cong Y$ to transport the $C^\infty$ structure from $X$ to $Y$ and get a $C^\infty$ manifold $(Y,f_\ast\mathcal O_X)$, but from a $C^\infty$ perspective this creature is just a replication of $(X,\mathcal O_X)$.
But suppose your topological manifold $Y$ is a subspace of the plane, like the square $Y\subset \mathbb R^2$. The output $(Y,f_\ast\mathcal O_X)$ of the above procedure is indifferent to this information. Your intuition, on the other hand, relies on the subspace inclusion $Y\subset \mathbb R^2$ because it implicitly uses the differentiable structure on $\mathbb R^2$ to identify the corners.
Here's a way to identify the corners using the differentiable structure on the ambient space: the square does not admit differentiable curves through its corners. Indeed observe that there is no differentiable curve $(-\varepsilon,\varepsilon)\to \mathbb R^2$ onto a neighborhood in the square (!) of a corner. The reason for this is that the one sided derivatives at zero are vectors in $\mathbb R^2$ with different directions (each is in the direction of a different side of the square). On the other hand, the circle has the $C^\infty$ parametrization $\theta\mapsto (\cos \theta,\sin \theta)$.
