Projection onto finite-dimensional subspace of $L^p$

Let $a_i$ be a basis of $L^p(\Omega)$ and consider $A_n = \text{span}\{a_1, ..., a_n\}$.

Take an element $f \in L^p$. We want to define a projection onto the finite-dimensional subspace $A_n$. How do we define this? we do not have an inner product available to us.

How about this. Let $B_n = \text{span}\{b_1, ..., b_n\}$ where $b_i$ is a basis of $L^q$ ($p$ and $q$ conjugate). Then define $P_n:L^p \to L^q$ by $$P_n f = \sum_{i=1}^n\langle f, b_i \rangle_{L^p, L^q}b_i$$.

However this is in $L^q$.

What's the natural projection operator on Banach spaces? The context is Galerkin approximations to PDEs so nothing too abstract please. What's the link to the dual space? In the Hilbert space setting, the projection operator satisfies $(P_n h, h_n) = (h, h_n)$, does something similar hold here?

Thanks

There isn't one natural projection onto a given subspace. However, since you already made a choice of Schauder basis $a_i$, there is a natural choice of projection onto your spaces $A_n$. Indeed, every element $x\in L^p$ expands uniquely as $\sum c_i a_i$. Define $$P_nx = \sum_{i=1}^n c_i a_i$$
Fortunately, the norms of projections $P_n$ are uniformly bounded.
By definition, a basis is called monotone if $\|P_n\|=1$ for all $n$; these are the nicest bases to have. The Haar system is a monotone basis for $L^p$, $1<p<\infty$. For an investigation of such bases, see Monotone bases in $L_p$ by Dor and Odell.
In general, finding the coefficients $c_i$ may be hard. But for Haar system you can use the fact that it's orthonormal in $L^2$, and use the inner product of $L^2$ to find $c_i$.
Aside: in a uniformly convex space such as $L^p$, $1<p<\infty$, there is a well-defined nearest point projection onto any closed subspace. However, this is a nonlinear operator, which is unlikely to be suitable for your purpose.