-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBundle.m
27 lines (15 loc) · 937 Bytes
/
Bundle.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
BeginPackage["DiffGeo`"];
Begin["`Private`"];
Bundle::nosect = "Bundle works only on sections, `1` is not a section.";
Bundle[x_ /; Not[SectionQ[x]]] := Throw[Message[Bundle::nosect, x]];
Bundle[Times[x_ /; ConstQ[x], y_ /; And[SectionQ[y], VectBundleQ[Bundle[y]]]]] := Bundle[y];
Bundle[Times[x_ /; ScalQ[x], y_ /; And[SectionQ[y], VectBundleQ[Bundle[y]]]]] /; (Domain[x] === Domain[y]) := Bundle[y];
Bundle[x_Plus /; SectionQ[x]] := Bundle[First[x]];
Bundle[x_TensProd] := TensProdBundle @@ (Bundle /@ (List @@ x));
Bundle[x_IntProd] := ExtPowBundle[CotangentBundle[Domain[First[x]]], Rank[First[x]][[2]] - Length[x] + 1];
Bundle[x_ExtProd] := ExtPowBundle[CotangentBundle[Domain[First[x]]], Plus @@ (Rank[#][[2]]& /@ (List @@ x))];
Bundle[x_ExtDer] := ExtPowBundle[CotangentBundle[Domain[First[x]]], Rank[First[x]][[2]] + 1];
Bundle[x_LieDer] := Bundle[First[x]];
Bundle[x_LieBr] := Bundle[First[x]];
End[];
EndPackage[];