In this paper, we prove a Schwarz lemma for the pentablock. The pentablock $$\mathcal {P}$$
P
is defined by $$\begin{aligned} \mathcal {P}=\{(a_{21}, {\text {tr}}A, \det A) : A=[a_{ij}]_{i,j=1}^2 \in \mathbb {B}^{2\times 2}\} \end{aligned}$$
P
=
{
(
a
21
,
tr
A
,
det
A
)
:
A
=
[
a
ij
]
i
,
j
=
1
2
∈
B
2
×
2
}
where $$\mathbb {B}^{2\times 2}$$
B
2
×
2
denotes the open unit ball in the space of $$2\times 2$$
2
×
2
complex matrices. The pentablock is a bounded non-convex domain in $$\mathbb {C}^3$$
C
3
which arises naturally in connection with a certain problem of $$\mu $$
μ
-synthesis. We develop a concrete structure theory for the rational maps from the unit disc $$\mathbb {D}$$
D
to the closed pentablock $$\overline{\mathcal {P}}$$
P
¯
that map the unit circle $$\mathbb {T}$$
T
to the distinguished boundary $$b\overline{\mathcal {P}}$$
b
P
¯
of $$\overline{\mathcal {P}}$$
P
¯
. Such maps are called rational $${\overline{\mathcal {P}}}$$
P
¯
-inner functions. We give relations between $${\overline{\mathcal {P}}}$$
P
¯
-inner functions and inner functions from $$\mathbb {D}$$
D
to the symmetrized bidisc. We describe the construction of rational $${\overline{\mathcal {P}}}$$
P
¯
-inner functions $$x = (a, s, p) : \mathbb {D} \rightarrow \overline{\mathcal {P}}$$
x
=
(
a
,
s
,
p
)
:
D
→
P
¯
of prescribed degree from the zeroes of a, s and $$s^2-4p$$
s
2
-
4
p
. The proof of this theorem is constructive: it gives an algorithm for the construction of a family of such functions x subject to the computation of Fejér–Riesz factorizations of certain non-negative trigonometric functions on the circle. We use properties and the construction of rational $${\overline{\mathcal {P}}}$$
P
¯
-inner functions to prove a Schwarz lemma for the pentablock.