a leftmost derivation
When a sentential form has several variables waiting to be expanded, which one do you rewrite next? A leftmost derivation makes a strict rule of it: always expand the LEFTMOST variable. It is like reading and writing a sentence strictly left to right, never jumping ahead to fill a later blank before an earlier one. This discipline tames the chaos of arbitrary rewrite order.
Formally, a derivation is leftmost if at every step the production is applied to the leftmost variable occurring in the current sentential form. We sometimes mark these steps with a subscript, =>lm. For example with E → E + E | a, the string a + a + a has the leftmost derivation E =>lm E + E =>lm a + E =>lm a + E + E =>lm a + a + E =>lm a + a + a, where every step rewrites the first remaining variable. The point of fixing 'leftmost' is that it removes the freedom to reorder independent choices, so the only choices left are which RULE to apply.
The key fact: for a given parse tree there is EXACTLY ONE leftmost derivation, and one leftmost derivation determines exactly one parse tree. So leftmost derivations are in one-to-one correspondence with parse trees — which makes them the right tool for defining ambiguity precisely (a grammar is ambiguous iff some string has two distinct leftmost derivations, equivalently two distinct parse trees) and the natural model for top-down parsers, which build a leftmost derivation as they scan the input from left to right. Note carefully: leftmost and rightmost derivations of the same string can be different sequences, yet still correspond to the SAME parse tree.
Grammar S → A B, A → a A | a, B → b. Leftmost derivation of 'aab': S =>lm A B =>lm a A B =>lm a a B =>lm a a b. Every step expands the leftmost variable (A before B).
At each step always rewrite the leftmost variable; this makes derivation and parse tree correspond one-to-one.
Each parse tree has exactly one leftmost derivation and one rightmost derivation; the leftmost and rightmost sequences for a string may differ yet describe the SAME tree. Ambiguity = two distinct leftmost derivations (= two distinct parse trees).