# Proof to a matrix identity encountered in kernelized ridge regression

In deriving kernelized ridge regression I've encountered a matrix identity that I can't quite prove:

$$X^T(XX^T+\lambda I)^{-1}=(X^TX+\lambda I)^{-1}X^T$$

Where $\lambda$ is a scalar constant and $X$ is assumed to be invertible.

I can see how this is true if the whole bracket is not an inverse itself, but after trying to apply some identities to expanding sum of inverses (namely, the Woodbury matrix identity), the whole thing just gets hopelessly complicated.

Can someone outline how this equality comes about?

The equation can be found on top of page 2 of this paper.

If you multiply by $(XX^T+\lambda I)$ on the right and by $(X^TX+\lambda I)$ on the left, your identity is $$(X^TX+\lambda I)X^T=X^T (XX^T+\lambda I),$$ which is trivial to verify.
What you need is not that $X$ is invertible, but that $\lambda>0$; that guarantees that $X^TX+\lambda I$ and $XX^T+\lambda I$ are positive definite.
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9053265452384949, "perplexity": 256.4110048587943}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-05/segments/1579251672537.90/warc/CC-MAIN-20200125131641-20200125160641-00390.warc.gz"}