Mantel's theorem proof by induction Hello so i tried to proof this by recurrence  i think i made a mistake but i dont know where exactly
So i have to prove
($P(n)$): for every triangle-free graph with $n$ vertices and $m$ edges we have $m \le n^2/4$.
Let's prove this by induction on $n$:


*

*If $n=0$ then the only graph that contain $n$ vertices is the empty graph and its a triangle-free graph and $0 \le 0^2/4$;

*Let $n>0$ and assume $P(n)$ is correct, and $G$ is a triangle-free graph with $n$ vertices. Let $y= (y_1, \dots, y_k)$ be a path in $G$. If we link a new vertex to $y_1,y_3,y_5,\dots,$ we will get $G'$ a triangle-free graph  with $n+1$ vertices and at the maximum  $n^2/4 + \lceil k/2\rceil$ edges, where $k\le n$ so $\lceil k/2\rceil \le (n+1)/2$ so $G'$ has at the maximum $(n+1)^2/4$ edges and with this $P(n+1)$ is correct.


So $P(n)$ is verified for every $n \in \mathbb N$.
 A: The flaw in this argument is a general danger to watch out for when using induction in graph theory.
Take any argument for proving that property $X$ implies property $Y$ (e.g. that $X=$"triangle-free" implies $Y=$"at most $n^2/4$ edges" or that $X=$"planar" implies $Y=$"$4$-colorable") which looks like this: 

Assume that all $n$-vertex graphs with property $X$ also have property $Y$. Let $G$ be an $n$-vertex graph with property $X$ and extend it [in some way] to an $(n+1)$-vertex graph with property $X$. By [some argument related to how we extended $G$], it still has property $Y$, so we conclude that all $(n+1)$-vertex graphs have property $Y$.

Whenever your proof has this structure, it relies on a hidden assumption: that any $(n+1)$-vertex graph with property $X$ can be built from an $n$-vertex graph with property $X$. 
Sometimes this is true. For example, if property $X$ is just "$G$ is a graph" then everything works out. Notably, if property $X$ is "$G$ is a tree", then we're also good: any $(n+1)$-vertex tree can be obtained by adding a leaf to an $n$-vertex tree.
But usually this is false. In your case, for instance, you extend $G$ to a graph $G'$ on $n+1$ vertices by finding a path in $G$, and adding a new vertex adjacent to every second vertex on the path. Not all triangle-free graphs on $n+1$ vertices can be obtained in this way from triangle-free graphs on $n$ vertices. All $(n+1)$-vertex graphs which cannot be built in this way are graphs to which your proof doesn't apply. So your argument is incomplete.
The general cure is to structure your proof differently:

Assume that all $n$-vertex graphs with property $X$ have property $Y$. Let $G$ be an $(n+1)$-vertex graph and delete a vertex [in some way] to get an $n$-vertex graph $G'$ with property $X$. By the induction hypothesis, $G'$ has property $Y$, so [by some argument related to how we deleted a vertex] $G$ also has property $Y$.

Here we also have something to show: that given an $(n+1)$-vertex graph with property $X$, we can delete a vertex to leave an $n$-vertex graph with property $X$. But this is true much more often. In particular, it's true of triangle-free graphs: if $G$ is triangle-free, and we delete any vertex, then the resulting graph is still triangle-free.
