Kernel of restriction of bilinear function to some subspace 
Let $V$ be a finite-dimensional vector space over a field $\mathbb{k}$.
  Let $\varphi:V\times V\to \mathbb{k}$
  ($\operatorname{char}\mathbb{k}\neq 2$) is bilinear (symmetric or
  skew-symmetric) or sesquilinear (hermitian or skew-hermitian)
  function. Let $W\subset V$ is a subspace and $W^{\perp}$ its
  orthogonal complement under $\varphi$. Show that $\dim W^{\perp}\geq
 \dim V-\dim W$and equality holds if $\ker \varphi \cap W=\{0\}$.

I was able to show this inequality. But I have troubles  with equality. This is what I tried so far:
We know that $W+W^{\perp}\subset V$ and hence $$\dim V\geq \dim (W+W^{\perp})=\dim W+\dim W^{\perp}-\dim (W\cap W^{\perp})$$ and also I've shown that $\dim W+\dim W^{\perp}\geq \dim V$. If I can show that $W\cap W^{\perp}=\{0\}$ then we are done, right?
Let's use that $\ker \varphi \cap W=\{0\}$. It is trivially to show that $\ker \varphi |_W=W\cap W^{\perp}$ and I want to show that $\ker \varphi |_W=\ker \varphi \cap W$. 
It is easy to note that $\ker \varphi \cap W\subseteq \ker \varphi |_W$. However, the reverse inclusion is not so obvious to me.
Indeed, if $x\in \ker \varphi |_W$ then $x\in W$ and for any $y\in W$ we have $\varphi(x,y)=0$. But in order to show that $x\in \ker \varphi$ we need to show that for all $y\in V$ we have $\varphi(x,y)=0$.
Maybe I am misunderstanding something? But anyway I would be thankful for any help, please!
 A: I assume that $\ker \varphi$ means the radical of $\varphi$, that is, the subspace $\left\{v \in V \mid \varphi\left(v,x\right) = 0 \text{ for all } x \in V\right\} = \left\{v \in V \mid \varphi\left(x,v\right) = 0 \text{ for all } x \in V\right\}$ of $V$. (The equality sign here holds because $\varphi$ is symmetric or skew-symmetric or hermitian or skew-hermitian.)

If I can show that $W\cap W^{\perp}=\{0\}$ then we are done, right?

Yes, but that's only an "if", not an "if and only if". There are cases where $W \cap W^\perp$ is not $\left\{0\right\}$ but the inequality nevertheless becomes an equality. These are precisely the cases where $\ker \varphi \cap W$ is $\left\{0\right\}$ but $\ker \left(\varphi\mid_W\right)$ is not. (For a specific example, let $\varphi$ be the hyperbolic plane form on $V = \mathbb{k}^2$, that is, the bilinear form sending $\left(\left(a_1,a_2\right),\left(b_1,b_2\right)\right)$ to $a_1b_2 + a_2b_1$, and let $W$ be the span of the first basis vector.)
I don't see how to salvage your approach (the moment you use the inequality $\dim V\geq \dim (W+W^{\perp})$, you are ceding ground that you will later need).
Here is a sketch of a correct proof: It suffices to show that
\begin{align}
\dim \left(W^\perp\right) = \dim V - \dim W + \dim\left(\ker \varphi \cap W\right) .
\label{darij1.eq.1}
\tag{1}
\end{align}
In other words, it suffices to show that
\begin{align}
\dim \left(W / \left(\ker \varphi \cap W\right) \right) = \dim \left(V / W^\perp\right)
\label{darij1.eq.2}
\tag{2}
\end{align}
(why?). But this can be proved by constructing a nondegenerate $\mathbb{k}$-bilinear form $\psi : \left(W / \left(\ker \varphi \cap W\right)\right) \times \left(V / W^\perp\right) \to \mathbb{k}$ (because if $A$ and $B$ are two finite-dimensional $\mathbb{k}$-vector spaces, and $\psi : A \times B \to \mathbb{k}$ is a nondegenerate $\mathbb{k}$-bilinear form, then $\dim A = \dim B$). To construct such a $\psi$, simply set
\begin{align}
\psi\left(w + \left(\ker \varphi \cap W\right), v + W^\perp\right) = \varphi\left(w, v\right) \qquad \text{for any $w \in W$ and $v \in V$}.
\end{align}
(Check that this works and is indeed nondegenerate!)
The proof of \eqref{darij1.eq.1} that I just sketched can also be found in full detail in my A note on bilinear forms (Corollary 7.1 (a)). In that note, I am a bit more general in that I work with an arbitrary bilinear form $f : V \times W \to \mathbf{k}$ rather than a bilinear form $\varphi : V \times V \to \mathbb{k}$ (and my $W$ is not your $W$ but rather an arbitrary $\mathbb{k}$-vector space that doesn't have to be a subspace of $V$). To apply my Corollary 7.1 (a) to your setting, you need to apply it to $\mathbb{k}$, $V$, $V$, $\varphi$ and $W$ instead of $\mathbf{k}$, $V$, $W$, $f$ and $A$, and note that my notation $\mathcal{R}_f\left(A\right)$ stands for what you would call $A^\perp$ whereas my $\mathcal{L}_f\left(V\right)$ is your $\ker \varphi$. Note that there is no difference between $\mathcal{L}_f\left(A\right)$ and $\mathcal{R}_f\left(A\right)$ when $f$ is symmetric or skew-symmetric or hermitian or skew-hermitian.
A: Let $V,W$ be finite-dimensional $\mathbb{k}$-vector spaces. Consider the bilinear function $f:V\times W\to \mathbb{k}$ and suppose that this map is non degenerate, i.e. left and right kernels of $f$ are trivial. By left and right kernels I mean the following subspaces $$\mathcal{L_f}(W)=\{v\in V: f(v,w)=0 \ \text{for all} \ w\in W\}$$ and $$\mathcal{R_f}(V)=\{w\in W: f(v,w)=0 \ \text{for all} \ v\in V\}.$$
From this map $f$ one can construct two maps $f_L:V\to W^{*}$ and $f_R:W\to V^{*}$ which are defined in the following way: for all $v\in V$ we define $f_L(v):W\to \mathbb{k}$ by $f_L(v)(w)=f(v,w)$ and the dame construction for $f_R$. 
It is an easy exercise to show that since $\mathcal{L_f}(W)$ and $\mathcal{R_f}(V)$ are trivial then $\ker f_L, \ker f_R$ are also trivial.
Then by rank-nullity theorem it follows that $V\cong \operatorname{Im}f_L$ and hence $\dim V\leq \dim W^{*}=\dim W$. And using the same reasoning one can show that $\dim W\leq \dim V$. And it follows that $\dim V=\dim W$.
Since the above map $\psi$ which was given dear Darig Grinberg is non degenerate then we get our desired equality.
To be honest I have never seen such resining before and the formula for the dimension of orthogonal complement $$\dim V=\dim W^{\perp}+\dim W-\dim (\ker \varphi \cap W)$$ i was not able to find some books. Thanks a lot for help Darij!
