On this page ‘A∨B’ = span(A∪B).
We now invoke the intersect function (A∨B)⋂(A∨C) and compare that with A.
Within the code:
Non Distributive
The subspaces of a vector space form a lattice but not a ‘distributive lattice’. In particular A⋂(B∨C) may not be the same as (A⋂B)∨(A⋂C). We denote subspaces by their RREF matrices. For example let A = ((1 1)), B = ((1 0)) and C = ((0 1)). (B∨C) is then ((1 0) (0 1)) and A⋂(B∨C) is ((1 1)); whereas (A⋂B) and (A⋂C) are both () and thus (A⋂B)∨(A⋂C) is ()!The other distributive law, A∨(B⋂C) = (A∨B)⋂(A∨C), fails for the same counter example: (B⋂C) is (), A∨(B⋂C) is ((1 1)), whereas (A∨B) and (A∨C) are both ((1 0) (0 1)) and thus (A∨B)⋂(A∨C) is ((1 0) (0 1)).
In light of the above non theorems, I propose three independent spaces A, B and C meaning that A⋂(B∨C) = B⋂(C∨A) = C⋂(A∨B) = {0}. With those antecedents, both distributive laws follow but the test (A∨B)⋂(A∨C) = A suffices for testing our intersect code. Let a = dim(A), b=dim(B), c=dim(C) and d = a+b+c≤n. To choose A, B and C generate a random d×n matrix of rank d. Subdivide it into a×n, b×n and c×n matrices which respectively span A, B and C.