aboutsummaryrefslogtreecommitdiff
path: root/proof.md
diff options
context:
space:
mode:
authorericmarin <maarin.eric@gmail.com>2026-03-31 11:14:57 +0200
committerericmarin <maarin.eric@gmail.com>2026-03-31 16:43:27 +0200
commitd1b25fbde6b01529fd1bcfdd5778b6cb378eb865 (patch)
tree0e121831cad6af60415eccccfbdb4c337d841c3a /proof.md
parentdbfc224384cd38b26c3e32d4c4dd8be7bb6d5bdc (diff)
downloadvein-d1b25fbde6b01529fd1bcfdd5778b6cb378eb865.tar.gz
vein-d1b25fbde6b01529fd1bcfdd5778b6cb378eb865.zip
added ONNX Add and ONNX Sub
Diffstat (limited to 'proof.md')
-rw-r--r--proof.md28
1 files changed, 28 insertions, 0 deletions
diff --git a/proof.md b/proof.md
index 7fb6413..a376bb9 100644
--- a/proof.md
+++ b/proof.md
@@ -46,6 +46,34 @@ Equal to Gemm with ![alpha=1](https://latex.codecogs.com/svg.image?\inline&space
### Reshape
Just identity mapping.
+### Add
+ONNX Add node is defined as:
+![C = A + B](https://latex.codecogs.com/svg.image?&space;C=A&plus;B)
+
+The translation defines the interactions:
+![Add(c_i, b_i) ~ a_i](https://latex.codecogs.com/svg.image?Add(c_i,b_i)\sim&space;a_i)
+
+By definition this interaction is equal to:
+![c_i = a_i + b_i](https://latex.codecogs.com/svg.image?c_i=a_i&plus;b_i)
+
+By grouping the operations we get:
+![C = A + B](https://latex.codecogs.com/svg.image?C=A&plus;B)
+
+### Sub
+ONNX Sub node is defined as:
+![C = A - B](https://latex.codecogs.com/svg.image?C=A-B)
+
+The translation defines the interactions:
+![Add(c_i, neg_b_i) ~ a_i](https://latex.codecogs.com/svg.image?Add(c_i,neg_i)\sim&space;a_i)
+![Mul(neg_b_i, Concrete(-1)) ~ b_i](https://latex.codecogs.com/svg.image?Mul(neg_i,Concrete(-1))\sim&space;b_i)
+
+By definition this interaction is equal to:
+![c_i = a_i + neg_b_i](https://latex.codecogs.com/svg.image?c_i=a_i&plus;neg_i)
+![neg_b_i = -1 * b_i](https://latex.codecogs.com/svg.image?neg_i=-1*b_i)
+
+By grouping the operations we get:
+![C = A - B](https://latex.codecogs.com/svg.image?C=A-B)
+
## Soundness of Interaction Rules
### Materialize
The Materialize agent transforms a Linear agent into a tree of explicit mathematical operations