A lock is a section of canal or river that is closed off by watertight gates at either end to enable boats to be raised or lowered to the same water level as the stretch of canal ahead.
For example, if the stretch of water ahead is at a higher level, water is poured into the lock chamber once the boat has entered it until it is equal to the water level ahead. Then the forward gate is opened and the boat is able to continue its journey at the higher water level. When a boat is going from a high to a lower level of water, the procedure is the opposite, with water being removed from the lock. Most modern locks are operated automatically, although in Ireland there are some in existence that are still operated by lock keepers.
The invention of both canals and canal locks can be traced to Leonardo da Vinci. Leonardo was a genius, who had many ideas that were not understood until centuries after he died. He drew designs for canal locks in his notebooks as far back as the fifteenth century. He was interested in the idea of a canal linking Florence to the sea, but his plan was never realised.