Finding the orthogonal complement to all linear functions on $(0, 1)\subset\mathbb{R}$. So, this is really a two part question. It states the following.

Let $H = L_2(0, 1)$ be a Hilbert space. Let $u_1, u_2\in L_2(0, 1)$ be given by $u_1(t) = 1$, and $u_2(t) = t$, $\forall t\in(0, 1)$. Find an expression for the orthogonal projection of $u\in L_2(0, 1)$ onto the subset of $H$ spanned by $u_1$ and $u_2$ (let this set be $S\subset H$). Find, subsequently, the distance of $f(t) = \cos(2\pi t)$ from $S$.

The following is my attempt at these questions. I know it's a lot of writing, but I'm really quite stuck here, and would appreciate some insight into this problem.
My Attempt
First Part of the Question
Firstly, my interpretation of the set $S$ was that $S = \lbrace\alpha + \beta t:\alpha,\beta\in\mathbb{C}\rbrace$ (we could've just as easily taken $\alpha, \beta\in\mathbb{R}$, but I wanted to be sure to cover all possible bases, so I took $\alpha, \beta\in\mathbb{C}$. That is to say that $S$ is the set of all linear functions on $(0, 1)\subset\mathbb{R}$. Now, I really could not come up with a function, say $u\in L_2(0, 1)$, other than the identically-zero function, such that, $\forall\in M$, $\langle u, l\rangle = 0$ (where $\langle\cdot,\cdot\rangle$, here, denotes the inner product on $L_2(0, 1)$). I'm aware of the fact that there are some measure-theoretic considerations that can be taken into account here, for example we could replace identically zero with zero almost everywhere (that is, $u(t) = 0$, $\forall t\in (0, 1)\setminus E$, where $E\subset(0, 1)$ has Lebesgue (one-dimensional) measure zero). However, I did this question as part of an examination for a module that does not require any prerequisite knowledge of measure theory, and as such I assumed that simply requiring that $u$ be identically zero would be sufficient. That being said, I wasn't exactly sure how to go about proving this claim. I assume that contradiction would be sufficient, but then what kind of assumption do I make regarding $u$? Because any function that is only zero almost everywhere is certainly not identically zero, but it is also perpendicular to $S$, which leaves me at a bit of a loss?
Nevertheless, I stuck with the conclusion that $S^\perp = \lbrace 0\rbrace\subset L_2(0, 1)$. Now, if we let $P:H\to S$ be the orthogonal projection operator onto $S$, then, since, $\forall u\in H$, $u - Pu\perp S$, we have that $u - Pu\in S^\perp$, so $u - Pu = 0$, and thus $Pu = u$. Now, this brings up its own set of issues. Most prominently, if $Pu = u$, then $u\in S$. But we can of course find plenty of non-linear elements of $L_2(0, 1)$, and thus the conclusion that $Pu = u$ doesn't make much sense at all, which of course means that there must exist non-identically zero elements of $S^\perp$, which simply brings me back to my original problem.
Second Part of the Question
As a consequence of the fact that I concluded that $S^\perp = \lbrace0\rbrace\subset L_2(0, 1)$, I figured that, since the distance from $f$ to $S$ is simply the length of the projection of $f$ onto $S^\perp$, that
$$
\mathrm{dist}(f, S) = ||f||_2
$$
which equates to $1/\sqrt{2}$, after some fairly straightforward integration. No solution has been provided for this question, since, like I said, said question came as part of an examination, so I can't really offer much more than this, but if anyone has any ideas on how to proceed, I'd greatly appreciate any advice. All the best, and thanks in advance.
 A: Ok first of all you should understand that since you are working on $(0,1)$ the vector spaces are real vector spaces (no need for complex numbers in this question). Having said that $S=\{\alpha + \beta t: \alpha,\beta\in\mathbb{R}\}$, however it would be useful if we first find out what is an orthonormal basis for our subspace $S$ and write it in a cleaner way. By Gram-Schimdt procedure we get that the two basis vectors of $S$ can be chosen as $e_1=1$ and $e_2=\sqrt{12}(t-1/2)$ (they are also normalized). The orthogonal projection of a function $u\in L^2(0,1)$ on $S$ is therefore given by $P_Su=\langle u,e_1\rangle e_1+\langle u,e_2\rangle e_2$. Now note that the function $\cos(2\pi t)$ is such that $\langle\cos(2\pi t),e_i \rangle=0$ for $i=1,2$, hence it belongs to $S^\perp$.
For what concerns the second question, in order to compute the distance of a function $f\in L^2(0,1)$ from $S$ it is sufficient to find the distance of $f$ from its orthogonal projection onto $S$: in other words you just need to compute $d(f,P_S f)=||f-P_Sf||_{L^2(0,1)}$. This is because the distance from a closed subspace (you can think at your $S$) is in general given by $d(f,S)=\inf_{g\in S}||f-g||_{L^2(0,1)}$ and this infimum is actually a minimum, with the minimizer being exactly $P_Sf$. In your case, since $P_S\cos(2\pi t)=0$, we get $d(\cos(2\pi t),S)=1/\sqrt{2}$
