In a word, yes. However, prepositions are more than a little sneaky, or, rather, the words we use for prepositions are not always found in that role. Prepositions have a syntactic and grammatical function, and it is that function that defines the word as a preposition, rather than the word itself.
Occasionally, a word like with will be shown in another role: for example, in a phrasal verb like this is a difficult situation to deal with. However, it is less commonly used in phrasal verbs than other prepositions like up, off or in.
With also has some influence over the words surrounding it, like compare, for example, which takes either the meaning of drawing attention to similarities or of highlighting differences, indicated by the use of to or with.
Alistair Cook can be compared to his Essex colleague Graham Gooch in that they have both accrued thousands of runs for England; however, compared with an explosive batsman like Ben Stokes, he is a little dull.
This is not a hard and fast rule, as British English is generally more forgiving of using to in the latter sense.
Incidentally, with (or wið, its Old English equivalent) originally meant against: a sense still preserved in phrases like fight with and words like withstand. It gradually stole with sense of association from the word mid, which is still found in words like midwife.
Is ‘for’ a preposition?
Unlike with, for does not often appear in phrasal verbs, and is generally attached to a complement. Therefore, if you see for in the sentence, it is very likely you have found yourself a preposition.
Prepositionally, it is used for three main purposes: to demonstrate usage (these toys are for children only); to show passage of time (I’ve eaten here for years); or to show the complement has resulted in something (For this reason, I will resign with immediate effect).
Demonstrating the drift over the centuries that carried prepositions from purely spatial relationships into more abstract roles, for originally meant ‘in front of’ as was preserved in the word fore.
Is ‘of’ a preposition?
Blunted by continual use over the centuries, it is hard to think of such a familiar and tiny word in grammatical terms, but there are no examples in which of is not used as a preposition.
It has many prepositional uses, including its function as a replacement for the genitive case, usually for inanimate objects, like the highlights of the show, the first page of the book, etc. It can also point to a wider sense of connection in sentences, such as It gives me an enormous sense of well-being or here is a photo of my Dad.
It is also used in conjunction with an amount or number, as in thousands of people or three cans of cola.
Of has followed a strange path, however, descending from the Anglo-Saxon word æf, which meant away from or off. Perhaps this is a case of necessity triumphing over logic, with the need for something to step in to replace the genitive case.
Is ‘by’ a preposition?
Indeed it is. Appropriately enough for a word that sounds like the bi- prefix indicating two, there are two main prepositional functions for the word by. Unfortunately, these two meanings can result in confusion.
He was knocked down by the leisure centre sounds implausible, and writing coaches would normally recommend another preposition (like outside or close to) to clarify the situation. However, when you are speaking English less formally and with less time to deliberate, a sentence like I’ll send you the stories by my friend Chris by email by Wednesday evening is not uncommon.
In addition to illustrating proximity (by the seaside) and the passive voice (that pancake was cooked by somebody else), it can also show a means or method (by first post) or a methodical action (he perfected his technique by practising every day).
Despite the slight confusion surrounding its use now, its meaning now is quite consistent with its etymological roots, going all the way back to the Proto-Indo-European bhi-.
Is ‘to’ a preposition?
If you come across to in a sentence, there are two possibilities – three if you count the author misspelling the intensifier too. Firstly, it will more often than not be used as a preposition (to the Batmobile!), or as part of a prepositional phrase (in order to relieve the pressure). Secondly, it appears as a particle to show the infinitive case of verbs (to expect; I decided to wait for the bus).
As a preposition, to is used a few different ways. It can show the person or place that movement is towards (he walked to the forest; she passed the ball to her mother), or it can show a limit or terminal point (stuffed to the gills). It can also be used when discussing time – as in working nine to five or ten minutes to seven.
Etymologically, to has been true to its Dark Age roots; it meant the same then as now. Some prepositions now have to keep things manageable.