LSP is not about inheritance.
In her paper, Liskov B. defines subtyping through the principles of substitutability and invariance. She begins by formalizing the concept of a (behavioral) type, which focuses on the externally observable behavior of an object rather than its internal structure or implementation. Building on this foundation, she introduces the concept of behavioral subtyping, emphasizing that a derived type must be substitutable for its base type without compromising the program’s correctness.
Notably, the types and subtyping relationships discussed in Liskov’s work diverge significantly from their counterparts in mainstream OOP languages. In OOP, types are conflated with classes, and subtyping is often reduced to a rudimentary form of inheritance. However, classes in this context are not equivalent to behavioral types, and inheritance does not embody the rigorous subtyping relationship Liskov envisioned. Consequently, the so-called Liskov Substitution Principle (LSP)—as it is often cited in OOP—is misaligned with the original ideas presented in her paper, rendering its application in these languages largely superficial.