It seems correct that any single given algorithm must either have polynomial runtime or not. Is there a specific algorithm that (does or does not actually lie in $P$, but) can neither be proven nor disproven to do so?
Is there a decision procedure for "$\in P$"?
Do we know $P$ vs. $NP$ to be decidable? Could it be proven undecidable in the way that an algorithm with proven "optimal" (i. e. proven asymptotically fastest) runtime is non-constructively provided, and then one proves that it is undecidable whether the optimal algorithm has polynomial runtime or not?
The following problem is undecidable:
Given an algorithm $A$, decide whether it runs in polynomial time.
Indeed, if you could decide this problem, then you could decide the halting problem, in the following way. Let $M$ be an input to the halting problem (we want to know whether $M$ halts on the empty input). Construct an algorithm $A$ which, on input $n$, runs $M$ for $n$ steps, and if $M$ halts, counts from $1$ to $2^n$. Then $M$ halts iff $A$ doesn't run in polynomial time.
You seem to be conflating several different meanings of decidable:
- Decidable by an algorithm.
- Can be proved or disproved.
- Is true or false.
It is meaningless to ask whether "P vs. NP" can be decided by an algorithm, since there's no input here. It is meaningful to ask whether "P vs. NP" is determined by the "axioms of mathematics" (say, ZFC) or not; see what Scott Aaronson has to say about it. Finally, in classical logic every statement is either true or false, and in particular either P=NP or P≠NP.
P is a class of languages, not a class of algorithms. A language (or problem) is in P if there is some Turing machine that decides it in a polynomial number of steps. So, for example, determining whether a graph is connected is in P, since a TM can determine that efficiently. However, there are arbitrarily inefficient algorithms to determine connectivity: for example, an algorithm could waste time counting to $2^n$ before looking at the graph. If you want to know whether a particular algorithm runs in polynomial time, that is undecidable, as Yuval shows.
No, because that isn't even a computational problem. Suppose that you wanted to design a Turing machine that determined if given languages were in P. What would the input to your Turing machine be? Remember – it has to be a finite string. Probably the closest you could get is to give a Turing machine as input and ask if the language accepted by that machine is in P (i.e., either the given TM decides the language in polynomial time or some other TM does). But that is undecidable for the same reasons as above.
No because, again, that isn't a computational problem: it's something that's either true or false. In this case, there's no input at all.