Calculating the dimension of a projective variety? I am having difficulty determining the dimension of a projective variety in general.
For example, I am confused about the dimension of the projective variety $X-Y=0$ in $\mathbb{P}^3$. 
I was thinking that the dimension of this variety is $1$ because it defines a line.  However, I am confused because if we also consider the line $Z=0$, then this is also of dimension $1$.  But then the co-dimension of each variety is $2$, and $2+2=4>3$, implying that these varieties do not intersect (I'm not sure about this part - I know that when the co-dimensions add to less than or equal to $n$ that we have a non-empty intersection... is the converse true?). On the other hand, I know using common sense that these varieties intersect at the point $[1:1:0]$. 
If someone could help me understand this example, I would really appreciate it. Please bear with me if I've made silly mistakes... I was only just introduced to these concepts. Thank you!

The dimension of a variety defined by a single equation $f=0$, called an hypersurface, highly depends of the dimension of the underlying space. In fact, such variety has dimension $n-1$ in $\mathbb P^n$. For taking your example again, $f = x-y = 0$ in $\mathbb P^n$, the linear subspace associated is $[t:-t:s_1:\dots:s_{n-1}]$. Assume for example $s_n = 1$ and you obtain $n-1$ parameters $t, s_1, \dots, s_{n-2}$ which shows that $\dim(Y) = n-1$.
Essentially the last coordinate in $\mathbb P^1$ is just the point at infinity (in fact, in $\mathbb P^n$ the last coordinate is the hyperplane at infinity). 
For example, the line $[t:-t:0:s]$ is essentially the affine line $[t:-t:0:1]$ for $t \in k$ plus the point at infinity $[1:-1:0:0]$. So in comparaison in $\mathbb A^3$ you only added one point which clearly does not change the dimension. So you can focuse on dimension of affine variety, and here a "count of parameters" is enough for simple case. 
