How many charts are minimally required to cover any compact 2-manifold? As mentioned in one of the answers to the question: Upper bound on the number of charts needed to cover a topological manifold,

Every topological $n$-dimensional manifold $M$ (compact or not) admits a cover by $n+1$
charts.

For compact 2-manifolds, are 3 charts really necessary? Can anyone point out an example that minimally requires 3 charts? Is it the real-projective plane? If so, is it true that only 2 charts are required to cover any compact 2-manifold that is not a connected sum of real projective planes with or without holes/boundaries?
 A: Below, all surfaces are assumed to be connected (unless stated otherwise).
A (possibly disconnected) surface is called planar if it is homeomorphic to a subset of the plane.
A surface is called closed if it is compact and has empty boundary. A surface is called open if is is noncompact and has empty boundary.
A compact surface $S$ is called the $n$-holed sphere if it is homeomorphic to the surface obtained by removing from the 2-dimensional sphere interiors of pairwise disjoint closed disks. Such surface $S$ is denoted $S_{0,n}$: It has genus $0$ and $n$ boundary components. We have $\chi(S_{0,n})=2-n$. Given $S=S_{0,n}$, the complement $S-\partial S$ is
called the $n$-times punctured sphere; it is homeomorphic to the complement to a subset of cardinality $n$ in $S^2$.
Lemma 1. If $S$ is a closed surface of even Euler characteristic, then $S$ can be obtained by gluing two copies of $S_{0,n}$ along their respective boundaries, where $\chi(S)=2(2-n)$.
Proof. According to the classification of surfaces, the homeomorphism class of a closed surface is uniquely determined by its Euler characteristic and orientability. Thus, we first find a natural number $n$ by solving the equation $\chi(S)=2(2-n)$ (which is possible since $\chi(S)$ is even). Then glue two copies $S_{0,n}\times \{i\}, i=1,2$, of $S_{0,n}$ by a homeomorphism $f$ of boundaries. This homeomorphism, of course, is not unique. One such homeomorphism $f_0$ corresponds to the identity map $\partial S_{0,n}\to \partial S_{0,n}$. It will yield an orientable surface (an exercise). Another such homeomorphism, $f_1$, is obtained by composing $f_0$ with an orientation-reversing self-homeomorphism of one of the boundary components of $S_{0,n}\times \{1\}$. It is an exercise to check that unless $n=1$ (i.e. $S=S^2$), the surface obtained by gluing via $f_1$ is non-orientable. Moreover, for either   homeomorphism $f$, the resulting closed surface $\Sigma_f$ has Euler characteristic equal to
$$
\chi(S_{0,n}\times \{0\}) + \chi(S_{0,n}\times \{1\} ) - \chi(\partial S_{0,n})= 2(2-n) - 0= 2(n-2)=\chi(S).  
$$
Lemma follows. qed
Now, given the decomposition of a surface $S$ as above as the union of $S_{0,n}\times \{i\}, i=1,2$, we can enlarge slightly each
$S_{0,n}\times \{i\}, i=1,2$, in $S$ to an open surface  $\Sigma_i, i=1,2$, each homeomorphic to the $n$ times punctured sphere so that $\Sigma_1\cap \Sigma_2$ is homeomorphic to the disjoint union of $n$ copies of the open annulus. Both $\Sigma_1, \Sigma_2$ are, of course, planar. Thus, we obtain:
Corollary 1. If $S$  is a closed surface of even Euler characteristic then it is the union of two planar surfaces.
By thinking of such planar surfaces in $S$ as "charts" in $S$, this corollary can be restated by saying that every closed surface of even Euler characteristic (oriented or not) can be covered by two charts. Of course, every closed oriented has even Euler characteristic and, thus, we obtain:
Corollary 2. Every closed orientable surface can be covered by two charts.
Proposition 1. The real projective plane $RP^2$ cannot be covered by two charts.
Proof.  I will need the notion of the Lusternik–Schnirelmann category, which is an invariant of a topological space $X$
smallest integer $k=cat(X)$ such that there is an open covering
$$
\{U_{i}\}_{1\leq i\leq k+1}$$
of $X$ with the property that each inclusion map
$U_{i}\hookrightarrow X$ is nullhomotopic.
It is easy to see that if $S$ is an orientable surface, then every embedding $S\to RP^2$ is nullhomotopic. (The key is that every
orientation-preserving simple loop in $RP^2$ is nullhomotopic.) From this, it follows that if  an open covering $\{U_{i}\}_{{1\leq i\leq k+1}}$ is such that each $U_i$ is a chart, then $k\ge cat(RP^2)$.
It is well-known that $cat(RP^2)=2$ and, more generally, $cat(RP^n)=n$ for every $n$, see for instance
Cornea, Octav; Lupton, Gregory; Oprea, John; Tanré, Daniel, Lusternik-Schnirelmann category, Mathematical Surveys and Monographs. 103. Providence, RI: American Mathematical Society (AMS). xvii, 330 p. (2003). ZBL1032.55001.
Proposition follows. qed
I originally thought that every closed surface other than the projective plane can be covered by two charts, but I was mistaken. One can prove:
Proposition 2. If $S$ is a closed surface of odd Euler characteristic then $S$ cannot be covered by two charts.
The proof is a bit long (and my answer is already quite long), so I omit it. Note that the proof of Proposition 1 does not apply here since embeddings of planar surfaces into $S$ no longer need to be null-homotopic.
Instead, given a cover by two charts of a closed surface $S$, one repeatedly modifies this cover so that, eventually, the intersection of the two charts has zero Euler characteristic. From this, one concludes that $\chi(S)$ is even. There might be a better algebraic topology argument, but, at the moment, I just do not see it.
I will now proceed to compact surfaces with boundary. Recall that compact surfaces $S$ are classified by three invariants: Euler characteristic $\chi(S)$, orientability and the number $\beta(S)=k$ of boundary components.
Then $S$ can be obtained from  a closed surface $\Sigma$ by removing interiors of $k$ pairwise disjoint closed disks.  Then
$\chi(\Sigma) -k=\chi(S)$. Thus,
$$
 \chi(S)+ k = \chi(\Sigma)\le 2. 
 $$
Conversely, suppose that we are given two integers $x, k$, where $k\ge 1$ and $x+k\le 2$.
Lemma 2. Suppose that $x, k$ are integers,  $k\ge 1$ and $g=x+k\le 2$. If $g$ is odd then there exists a nonorientable surface
$S$ with $\chi(S)=x$ and $\beta(S)=k$.  If $g$ is even then there are both orientable and nonorientable surfaces with this property.
Moreover, in both cases, $S$ can be obtained from the 2-dimensional disk $D^2$ by attaching rectangles $R_1,...,R_m$:
For each $i$ we  glue $R_i$ to $D^2$ by attaching two opposite sides of $R_i$ to $S$ by identifying them with certain arcs $a_i, a_i'\subset S^1=\partial D^2$ so that the arcs
$$
 a_1, a'_1,...,a_m, a'_m
 $$
are pairwise disjoint.
I may write a proof of this lemma later on (it is by induction on $|x|$ and $k$).
For the purpose at hand, of constructing a cover of $S$ by two charts, we note that the rectangles $R_i\subset S$ can be further enlarged to pairwise disjoint open subsets $A_i\subset S$ such that:
$$
 A_i\cap \partial S= R_i\cap \partial S,
 $$
and $A_i$ is homeomorphic to the rectangle $R_i$ with two opposite sides removed.
Now, we are ready to discuss covers  of surfaces with boundary by charts.
Definition. Given a surface with boundary $S$, a chart in $S$ is an open subset $U\subset S$ which is homeomorphic to an open subset of the closed half-plane $H={\mathbb R}\times [0,\infty)$.
Note that each $A_i$ is homeomorphic to an open subset
$B_i\subset H$ (the two remaining sides of $R_i$ are mapped to intervals in the boundary line of $H$) and that these maps together give rise to a topological embedding
$$
 A_1\sqcup ... \sqcup A_m\to H. 
 $$
Theorem. If $S$ is a compact surface with nonempty boundary then $S$ can be covered by two charts.
Proof. As one chart, I will take the complement
$$
 D^2\setminus \bigcup_{i=1}^m (a_i\cup a'_i). 
 $$
As another chart, I will take the union
$$
 A_1\cup ...\cup A_m. 
 $$
qed
