feat(linalg): F2 declare from GFM table and lecture example

Add la.declare for batch MatrixSymbol from @-record tables, ship
examples/linalg-transpose, and mark formula-doc F2 done.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cflmyandCursor committed 2026-09-07 15:52:46 +08:00
1 parent b2401b8458
commit f3c49e86ae
12 files changed
+123 -8

No files matched your search

+11
View File
@@ -0,0 +1,11 @@
# linalg-transpose
Formula-document example: declare symbols with a GFM table, check \((AB)^\top = B^\top A^\top\) via `ascii` (auto-simplify).
```bash
cargo build --release -p marqdo_plugin_linalg
marqdo ext add linalg
marqdo run examples/linalg-transpose/index.mq.md
```
Design: [ext-linalg-formula-doc.md](../../doc/design/ext-linalg-formula-doc.md).
+30
View File
@@ -0,0 +1,30 @@
---
title: Transpose identity (formula document)
description: (AB)^T = B^T A^T as a runnable lecture fragment.
import la:ext/linalg/linalg.mq.md
---
# Transpose reverses products
Declare shapes in a table, form \(P = AB\), then check \((AB)^\top = B^\top A^\top\) by running the document.
# main
`shapes` =
| @ | name | rows | cols |
|---|------|------|------|
| 1 | A | 2 | 3 |
| 2 | B | 3 | 2 |
*`env` = > la.declare table=`shapes`*
*`A` = env[^A]*
*`B` = env[^B]*
*`P` = `A` * `B`*
*`Pt` = > `P`.T*
*`t` = > `Pt`.ascii*
> print text=`t`
1. `t` == "B^T*A^T"
> print text=identity-ok
2. *
> print text=identity-fail