I am currently working on the chapter 4 of the CLRS and trying to solve an exercice, I want to prove that the solution to T(n) = T(⌈n/2⌉)+1 is O(lg(n)) ( lg in base 2 ). In fact I already succeeded with basic algebric manipulation but I wanted to try another method and I clearly see there is a problem on this try but I don't know what is it, please help me.
Here is the reasoning I propose : I want to proceed by change of variables. A change of variables is basically the creation of a new variable m with m = f(n) for a particular function f : N -> N. I will not choose a candidate for f for now. Let's write some algebra. Supposing that the bound is true for any natural number x such as x < m, lets proove it is true for m as well. By hypothesis, we do have T(m) <= c*lg(⌈m/2⌉)+1 for a positive constant c and our objective is to show that T(m) <= c*lg(m). We will try to do this by prooving that c*lg(m) >= c*lg(⌈m/2⌉)+1 ( which is greater than T(m) as we said ).
c*lg(m) >= c*lg(⌈m/2⌉)+1 is equivalent to c*lg(m)-c*lg(⌈m/2⌉) >= 1 which is equivalent to c*(lg(m)-lg(⌈m/2⌉)) >= 1 which is equivalent to lg(m)-lg⌈m/2⌉ >= c which is equivalent to lg(m/(⌈m/2⌉)) >= c ( because of the logarithm properties ) which is equivalent to m/⌈m/2⌉ >= exp(c) which is equivalent ( by definition of m ) to f(n)/⌈f(n)/2⌉ >= exp(c). As f takes an integer and gives an integer, we can write that ⌈f(n)/2⌉*2 = f(n) so f(n)/⌈f(n)/2⌉ >= exp(c) is equivalent to f(n) >= exp(c)*⌈f(n)/2⌉ which is equivalent to 2*f(n) >= exp(c)*f(n) which is totally equivalent to 2 => exp(c) AND f(n) >= 0 so, as we worked only with equivalences, we can conclude that c*lg(m) >= c*lg(⌈m/2⌉)+1 is completely equivalent to 2 => exp(c) AND f(n) >= 0 no matter the value of m, no matter the value of f(n) ( even a constant or a random function seems to work the only important things being it is not negative ) the only thing that matters is 2 => exp(c) and f(n) >= 0 ( which means c <= 1 ( which is very very strange for me by the way ) and f(n) >= 0 )
Can you help me to know where is the error ( if there is one but it seems obvious to me ) in my reasoning please ? Thank you