In the branch of mathematics called order theory, a modular lattice is a lattice that satisfies the following self-dual condition,
where "x", "a", "b" are arbitrary elements in the lattice,  ≤  is the partial order, and  ∨  and  ∧ (called join and meet respectively) are the operations of the lattice. This phrasing emphasizes an interpretation in terms of projection onto the sublattice ["a", "b"], a fact known as the diamond isomorphism theorem. An alternative but equivalent condition stated as an equation (see below) emphasizes that modular lattices form a variety in the sense of universal algebra.
Modular lattices arise naturally in algebra and in many other areas of mathematics. In these scenarios, modularity is an abstraction of the 2nd Isomorphism Theorem. For example, the subspaces of a vector space (and more generally the submodules of a module over a ring) form a modular lattice.
In a not necessarily modular lattice, there may still be elements b for which the modular law holds in connection with arbitrary elements x and a (for "a" ≤ "b"). Such an element is called a right modular element. Even more generally, the modular law may hold for any a and a fixed pair ("x", "b"). Such a pair is called a modular pair, and there are various generalizations of modularity related to this notion and to semimodularity.
Modular lattices are sometimes called Dedekind lattices after Richard Dedekind, who discovered the modular identity in several motivating examples.
Introduction.
The modular law can be seen as a restricted associative law that connects the two lattice operations similarly to the way in which the associative law λ(μ"x") = (λμ)"x" for vector spaces connects multiplication in the field and scalar multiplication.
The restriction "a" ≤ "b" is clearly necessary, since it follows from "a" ∨ ("x" ∧ "b") = ("a" ∨ "x") ∧ "b". In other words, no lattice with more than one element satisfies the unrestricted consequent of the modular law.
It is easy to see that "a" ≤ "b" implies "a" ∨ ("x" ∧ "b") ≤ ("a" ∨ "x") ∧ "b" in every lattice. Therefore, the modular law can also be stated as
The modular law can be expressed as an equation that is required to hold unconditionally. Since "a" ≤ "b" implies "a" 
 "a" ∧ "b" and since "a" ∧ "b" ≤ "b", replace "a" with "a" ∧ "b" in the defining equation of the modular law to obtain:
This shows that, using terminology from universal algebra, the modular lattices form a subvariety of the variety of lattices. Therefore, all homomorphic images, sublattices and direct products of modular lattices are again modular.
Examples.
The lattice of submodules of a module over a ring is modular. As a special case, the lattice of subgroups of an abelian group is modular.
The lattice of normal subgroups of a group is modular. But in general the lattice of all subgroups of a group is not modular. For an example, the lattice of subgroups of the dihedral group of order 8 is not modular.
The smallest non-modular lattice is the "pentagon" lattice "N"5 consisting of five elements 0, 1, "x", "a", "b" such that 0 ; "x" ; "b" ; 1, 0 ; "a" ; 1, and "a" is not comparable to "x" or to "b". For this lattice,
"x" ∨ ("a" ∧ "b") = "x" ∨ 0 = "x" ; "b" = 1 ∧ "b" = ("x" ∨ "a") ∧ "b"
holds, contradicting the modular law. Every non-modular lattice contains a copy of "N"5 as a sublattice.
Properties.
Every distributive lattice is modular.
 proved that, in every finite modular lattice, the number of join-irreducible elements equals the number of meet-irreducible elements. More generally, for every k, the number of elements of the lattice that cover exactly k other elements equals the number that are covered by exactly k other elements.
A useful property to show that a lattice is not modular is as follows:
 A lattice G is modular if and only if, for any "a", "b", "c" ∈ "G",
formula_1
Sketch of proof: Let G be modular, and let the premise of the implication hold. Then using absorption and modular identity:
 "c" = ("c"∧"b") ∨ "c" = ("a"∧"b") ∨ "c" = "a" ∧ ("b"∨"c") = "a" ∧ ("b"∨"a") = "a"
For the other direction, let the implication of the theorem hold in G. Let "a","b","c" be any elements in G, such that "c" ≤ "a". Let "x" = ("a"∧"b") ∨ "c", "y" = "a" ∧ ("b"∨"c"). From the modular inequality immediately follows that "x" ≤ "y". If we show that "x"∧"b" = "y"∧"b", "x"∨"b" = "y"∨"b", then using the assumption "x" = "y" must hold. The rest of the proof is routine manipulation with infima, suprema and inequalities.
Diamond isomorphism theorem.
For any two elements "a","b" of a modular lattice, one can consider the intervals ["a" ∧ "b", "b"] and ["a", "a" ∨ "b"]. They are connected by order-preserving maps
φ: ["a" ∧ "b", "b"] → ["a", "a" ∨ "b"] and
ψ: ["a", "a" ∨ "b"] → ["a" ∧ "b", "b"]
that are defined by φ("x") = "x" ∨ "a" and ψ("y") = "y" ∧ "b".
The composition ψφ is an order-preserving map from the interval ["a" ∧ "b", "b"] to itself which also satisfies the inequality ψ(φ("x")) = ("x" ∨ "a") ∧ "b" ≥ "x". The example shows that this inequality can be strict in general. In a modular lattice, however, equality holds. Since the dual of a modular lattice is again modular, φψ is also the identity on ["a", "a" ∨ "b"], and therefore the two maps φ and ψ are isomorphisms between these two intervals. This result is sometimes called the diamond isomorphism theorem for modular lattices. A lattice is modular if and only if the diamond isomorphism theorem holds for every pair of elements.
The diamond isomorphism theorem for modular lattices is analogous to the second isomorphism theorem in algebra, and it is a generalization of the lattice theorem.
Modular pairs and related notions.
In any lattice, a modular pair is a pair ("a, b") of elements such that for all "x" satisfying "a" ∧ "b" ≤ "x" ≤ "b", we have ("x" ∨ "a") ∧ "b" = "x", i.e. if one half of the diamond isomorphism theorem holds for the pair. An element "b" of a lattice is called a right modular element if ("a, b") is a modular pair for all elements "a", and an element "a" is called a left modular element if ("a, b") is a modular pair for all elements "b".
A lattice with the property that if ("a, b") is a modular pair, then ("b, a") is also a modular pair is called an M-symmetric lattice. Thus, in an M-symmetric lattice, every right modular element is also left modular, and vice-versa. Since a lattice is modular if and only if all pairs of elements are modular, clearly every modular lattice is M-symmetric. In the lattice "N"5 described above, the pair ("b, a") is modular, but the pair ("a, b") is not. Therefore, "N"5 is not M-symmetric. The centred hexagon lattice "S"7 is M-symmetric but not modular. Since "N"5 is a sublattice of "S"7, it follows that the M-symmetric lattices do not form a subvariety of the variety of lattices.
M-symmetry is not a self-dual notion. A dual modular pair is a pair which is modular in the dual lattice, and a lattice is called dually M-symmetric or M*-symmetric if its dual is M-symmetric. It can be shown that a finite lattice is modular if and only if it is M-symmetric and M*-symmetric. The same equivalence holds for infinite lattices which satisfy the ascending chain condition (or the descending chain condition).
Several less important notions are also closely related. A lattice is cross-symmetric if for every modular pair ("a, b") the pair ("b, a") is dually modular. Cross-symmetry implies M-symmetry but not M*-symmetry. Therefore, cross-symmetry is not equivalent to dual cross-symmetry. A lattice with a least element 0 is ⊥-symmetric if for every modular pair ("a, b") satisfying "a" ∧ "b" = 0 the pair ("b, a") is also modular.
History.
The definition of modularity is due to Richard Dedekind, who published most of the relevant papers after his retirement.
In a paper published in 1894 he studied lattices, which he called "dual groups" () as part of his "algebra of modules" and observed that ideals satisfy what we now call the modular law. He also observed that for lattices in general, the modular law is equivalent to its dual.
In another paper in 1897, Dedekind studied the lattice of divisors with gcd and lcm as operations, so that the lattice order is given by divisibility.
In a digression he introduced and studied lattices formally in a general context. He observed that the lattice of submodules of a module satisfies the modular identity. He called such lattices "dual groups of module type" (). He also proved that the modular identity and its dual are equivalent.
In the same paper, Dedekind also investigated the following stronger form of the modular identity, which is also self-dual:
 ("x" ∧ "b") ∨ ("a" ∧ "b") = ["x" ∨ "a"] ∧ "b".
He called lattices that satisfy this identity "dual groups of ideal type" (). In modern literature, they are more commonly referred to as distributive lattices. He gave examples of a lattice that is not modular and of a modular lattice that is not of ideal type.
A paper published by Dedekind in 1900 had lattices as its central topic: He described the free modular lattice generated by three elements, a lattice with 28 elements (see picture).