One could argue that science fiction is very old indeed, but the early fantasy/science fiction (and "science fiction" is used loosely although maybe the ancient Greeks had stories involving automata?) tends to be set in a distant land or even another planet, not in the future.
Rip van Winkle is set in Rip's future but the narrator's present and it is not science fiction at all, but fantasy.
The motivation for the question is discovering when the idea that the people of the future would be more advanced than those of the writer's time. There was certainly a period in history where this would have been a new kind of idea -- prior to the 1600s, people believed that it was the ancient Greeks and Romans who knew things that people of the, say, 1500s did not know and needed to rediscover. Moreover, I do not think most people experienced any kind of significant technological progress during their lifetimes until maybe the late 1700s -- by the late 1700s, an educated person would have seen the advances especially in chemistry and astronomy and be able to extrapolate.
I am aware of books written in the 1800s of course, maybe the best known being Looking Backward which imagined a better future and certainly most people alive when this novel was published in 1888 would have been aware of many technological advances.
Could in fact Bellamy's novel be the first that imagined a very changed and more advanced future which I think qualifies it as a true science fiction novel? I suspect that others preceded Bellamy, since quite a few inventions that affected multiple people arose before 1888.
Note: As I thought, based on comments/answers it was relatively late that writers thought of the future as being advanced technologically and in the 1700s, it would have been a very visionary writer indeed to extrapolate the advances of that century (primarily in math but very limited in applied inventions) to a future of, say, instantaneous communications. I think it was the invention of the telegraph and then the laying of the Transatlantic Cable that must have really stimulated 19th century writers into seeing a trend. I was just reading about the idea that a message that would have taken weeks to cross the ocean taking only ten minutes. The widespread use of steam must also have impressed people. Maybe some other advances, like Babbage's were not well-known or understood by most. The advent of electric lighting and motors might have convinced people that progress was inevitable.