Direct Sum Calculator

Test bases, sums, and independence with precision. Reveal intersection size, total dimension, and valid decompositions. Turn subspace inputs into reliable direct-sum insights and exports.

Calculator Input

Enter one vector per line. Separate coordinates with commas or spaces.

Include RREF and nullspace tables in the result section.

Example Data Table

Example Basis of U Basis of W Target Vector dim(U) dim(W) dim(U + W) dim(U ∩ W) Direct Sum?
Orthogonal axes in ℝ³ (1,0,0), (0,1,0) (0,0,1) (3,4,5) 2 1 3 0 Yes
Shared direction in ℝ² (1,1) (2,2) (3,3) 1 1 1 1 No

Formula Used

For subspaces U and W, the calculator first removes dependent input vectors to build clean bases. It then uses reduced row echelon form to measure each subspace dimension.

If the intersection contains only the zero vector, every vector in the sum has a unique decomposition. Otherwise, the sum may still exist, but directness fails.

How to Use This Calculator

  1. Enter basis vectors for subspace U, one vector per line.
  2. Enter basis vectors for subspace W using the same ambient dimension.
  3. Optionally add a target vector to test whether it belongs to U + W.
  4. Choose the display precision and tolerance for zero detection.
  5. Submit the form to view dimensions, basis sets, directness, and decomposition details.
  6. Use the export buttons in the result block to download CSV or PDF output.

Input structure and validation

The calculator accepts two lists of coordinate vectors, one for U and one for W. Each line is one vector; coordinates may use commas or spaces. All vectors must share the same ambient dimension n. A numeric tolerance defines when values are treated as zero; the default is 1e-9.

Independent basis extraction

Generating sets may contain repeats or dependent vectors. The tool builds an n by k column matrix and applies reduced row echelon form to identify pivot columns. Only pivot columns are kept, producing a clean basis that preserves span. The displayed dim(U) and dim(W) therefore reflect the true dimensions. For k vectors, reduction scales roughly O(n*k^2) arithmetic operations.

Sum space measurement

To compute U plus W, the calculator concatenates the cleaned bases and reduces the combined matrix. The rank is reported as dim(U + W). In R3 with U = {(1,0,0),(0,1,0)} and W = {(0,0,1)}, the rank is 3, so the sum equals the full space. Lower rank indicates a proper subspace. The report lists input counts and cleaned basis sizes for easy audit.

Intersection diagnostics

The intersection is detected by solving U a = W b, rewritten as [U | -W] [a b]^T = 0. A nullspace basis yields coefficient pairs that generate intersection vectors. An empty intersection basis means the intersection is trivial; otherwise, the tool reports dim(U ∩ W) and shows witness vectors that certify shared directions.

Direct sum decision rule

The direct sum condition is verified using two consistent checks: the intersection must be trivial, and dim(U + W) must equal dim(U) + dim(W). In R2, U = {(1,1)} and W = {(2,2)} gives dim(U) = 1 and dim(W) = 1, but dim(U + W) = 1, so the result is not direct.

Target decomposition and outputs

If a target vector x is supplied, the calculator solves U a + W b = x using the cleaned bases. When x lies in the sum, one decomposition is returned, and if the sum is direct the decomposition is unique. Results export to CSV and a printable PDF view. For n = 2 or 3, an interactive Plotly graph plots U, W, and x from the origin.

FAQs

1) What does “direct sum” mean here?

It reports U ⊕ W when U ∩ W is {0} and dim(U + W) = dim(U) + dim(W). Then every vector in the sum has exactly one u + w decomposition.

2) Why is dim(U) smaller than my input count?

Your list may include dependent or repeated vectors. The tool keeps only pivot columns from row reduction, which form an independent basis with the same span. Dimensions are computed from that cleaned basis.

3) What does the tolerance setting do?

During row reduction, values below the tolerance are treated as zero. Increase it for noisy decimal inputs; decrease it for exact integer work. Very large tolerance can misclassify near-independent vectors.

4) When will the Plotly graph appear?

The graph renders only when the ambient dimension is 2 or 3. It plots basis vectors for U and W and the target vector from the origin. For higher dimensions, the page shows numeric results without a plot.

5) How should I format vectors?

Enter one vector per line. Use commas or spaces between coordinates, for example: 1, 0, -2. Keep all vectors the same length. Blank lines are ignored.

6) Is the decomposition always unique?

Only if the sum is direct. If U and W intersect nontrivially, the same target vector can be written in multiple ways. The calculator still returns a valid example decomposition when the system is solvable.

Notes