Return(a<=b) in compare function!

sir, as you have told in previous lecture that by lower_bound function we can get first element >=key.
Now by passing compare function in lb and when writing reverse condition 'return(a<=b)'we must get first element less than or equal to key but we are getting something else.
in example, for 100 as key, we must get 1 as it is first element less than or equal to 100 but we are getting 100
itself,why???

you are understanding the function wrong. lower bound function will give the nearest possible number that is less than or equal to the number you gave, hence 100 will be the answer for 100, not 1.

ok, and why are we suctracting 1 in line 15 as we can get index of 100 directly by :

int index=lower_bound(coins,coins+n,compare)-coins;

by default the function is a < b
so for values like 120 it would give 200 as answer so we subtract 1 from index but it creates problems for us when the value is equal, so we modified the function to be a <= b so it would give the greater index for equal values, ie lower bound of 100 will not be 100 but 200, hence we need to subtract 1

@varu you can read the documentation here http://www.cplusplus.com/reference/algorithm/lower_bound/