leanprover-community / leanprover-community/mathlib4

Add the Moore-Penrose pseudo-inverse

Open
#24,787 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

t-algebra
Dominant language
Lean
Stars
4.1k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

Note that the naive definition of

import Mathlib

variable {m n R : Type*} [CommRing R] [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n]

noncomputable def pinv (A : Matrix m n R) : Matrix n m R :=
  (Aᵀ * A)⁻¹ * Aᵀ

only works when FIntype.card m >= Fintype.card n, and even then only when rank A = Fintype.card n.

Some possible references for a generalized definition:

A quick attempt at the second one seems to start with:

def IsMoorePenroseInverse {α β γ δ} [HMul α β γ] [HMul β α δ] [HMul γ α α] [HMul δ β β] [Star γ] [Star δ]
    (A : α) (As : β) :=
  A * As * A = A ∧ As * A * As = As ∧ star (A * As) = A * As ∧ star (As * A) = As * A

Zulip threads:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the issue's naive pinv definition and the proposed IsMoorePenroseInverse typeclass-style predicate, then read the linked papers and Zulip threads for the intended generalized definition. Done would require an agreed Moore–Penrose inverse design over the stated algebraic structures, together with its supporting mathlib definitions and theorems.

Written by the indexing model from the issue text.

Assessment

Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.