When the spoken name of a disjointed letter contains a madd letter followed by original sukun, it creates madd lazim harfi. It is “harfi” because the prolongation occurs in the name of a letter rather than in an ordinary word. It can also be muthaqqal or mukhaffaf.
«لام» contains alif before its final still mim.
«ميم» contains madd ya before its final still mim.
«قاف» contains alif before its final still fa.
The established extended measure is three alifs in this exposition. After that, consider whether the final still consonant of one letter-name assimilates into the next name. That interaction distinguishes the heavy and light forms without changing the fundamental cause of the madd.