Hilbert Theorem Tool Calculator

Turn vectors into clear components using Hilbert ideas. Pick weights, see matrices, confirm orthogonality fast. Use this tool to learn, verify, and share outputs.

Calculator

Enter a vector x and a basis for a subspace. The tool returns the orthogonal projection, distance, and diagnostics.

Provide exactly k lines in the basis box.
All weights must be positive.
For a valid inner product, use symmetric positive definite W.
Separate values with spaces or commas.
Example lines: "1 0 1" then "0 1 1".

Example data table

This example uses the default values shown in the form.

n k x v₁ v₂ Inner product Projection p Distance ||x−p||
3 2 [2, 1, -1] [1, 0, 1] [0, 1, 1] Standard [0.666667, -0.333333, 0.333333] 2.309401

Formula used

This calculator applies the Hilbert Projection Theorem in a finite-dimensional inner-product space. Given a subspace S = span{v₁,…,vₖ} and a vector x, there is a unique p ∈ S minimizing the distance ||x−p||, and the remainder r = x−p is orthogonal to S.

With an inner product ⟨u,v⟩ = uᵀWv (standard, diagonal weights, or custom matrix), set B = [v₁ … vₖ]. The coefficients c satisfy the normal equations:

(BᵀWB)c = BᵀWx,  and  p = Bc,  r = x − p.

The tool also checks max|⟨r,vᵢ⟩| and the Pythagorean identity ||x||² ≈ ||p||² + ||r||².

How to use this calculator

  1. Choose n and k to match your vectors.
  2. Enter x as n numbers.
  3. Enter exactly k basis vectors, one per line.
  4. Pick an inner product: standard, diagonal weights, or a matrix W.
  5. Optional: enable Gram–Schmidt for a cleaner basis.
  6. Press Submit to view results and export files.

FAQs

1) What is this tool computing?

It computes the orthogonal projection of a vector onto a subspace, plus the orthogonal remainder and distance. It is a numeric form of the Hilbert Projection Theorem in finite dimensions.

2) What does “inner product matrix W” mean?

It defines ⟨u,v⟩ = uᵀWv. With W symmetric positive definite, it behaves like a weighted geometry. Distances and orthogonality are measured using that W, not the usual dot product.

3) Why can the Gram matrix become singular?

If your basis vectors are linearly dependent, or if W does not define a valid inner product, then G = BᵀWB may be singular. Remove dependent vectors, or switch to a better-conditioned basis.

4) What does the orthogonality check show?

For a correct projection, r = x − p should satisfy ⟨r, vᵢ⟩ ≈ 0 for all basis vectors. The tool reports the maximum absolute value, so smaller is better.

5) When should I use Gram–Schmidt?

Use it when the basis is nearly dependent or badly scaled. Orthonormal vectors improve numerical stability and make it easier to interpret coefficients, especially under a weighted inner product.

6) What does the condition estimate mean?

cond₁(G) roughly measures sensitivity to rounding and input noise. Large values suggest that small changes in inputs can cause noticeable coefficient changes. Consider rescaling vectors or orthonormalizing.

7) Are results exact?

No. Computations use floating-point arithmetic and may show small residuals. Increase precision, try orthonormalization, or use a better-conditioned basis to reduce visible error.

8) Can I export my work?

Yes. After running a calculation, use the CSV and PDF buttons to download a compact report containing the key inputs and outputs. Run a new calculation to update the export.

Built for study, checks, and lightweight reporting.

Related Calculators

Field Extension DegreePolynomial Root StructureSolvability By RadicalsIrreducibility Test ToolMinimal Polynomial FinderNormal Extension CheckerSeparable Polynomial TestDiscriminant CalculatorCyclotomic Field CalculatorGalois Correspondence Tool

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.