-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
144 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import SciLean.Data.DataArray.Operations.Diag | ||
|
||
namespace SciLean | ||
|
||
|
||
open DataArrayN | ||
|
||
def_fun_prop antisymmpart in A | ||
with_transitive | ||
[RealScalar R] : IsContinuousLinearMap R by sorry_proof | ||
|
||
#generate_linear_map_simps DataArrayN.antisymmpart.arg_A.IsLinearMap_rule | ||
|
||
abbrev_fun_trans antisymmpart in A : fderiv R by | ||
fun_trans | ||
|
||
abbrev_fun_trans antisymmpart in A : fwdFDeriv R by | ||
autodiff | ||
|
||
abbrev_fun_trans antisymmpart in A : adjoint R by | ||
equals (fun x => x.crossmatrix) => | ||
sorry_proof | ||
|
||
abbrev_fun_trans antisymmpart in A : revFDeriv R by | ||
unfold revFDeriv | ||
autodiff | ||
|
||
abbrev_fun_trans antisymmpart in A : revFDerivProj R Unit by | ||
unfold revFDerivProj | ||
autodiff | ||
|
||
abbrev_fun_trans antisymmpart in A : revFDerivProjUpdate R Unit by | ||
unfold revFDerivProjUpdate | ||
autodiff |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import SciLean.Data.DataArray.Operations.Diag | ||
|
||
namespace SciLean | ||
|
||
variable | ||
{I : Type*} [IndexType I] [DecidableEq I] | ||
{J : Type*} [IndexType J] [DecidableEq J] | ||
{R : Type*} [RealScalar R] [PlainDataType R] | ||
|
||
|
||
open DataArrayN | ||
|
||
def_fun_prop cross in x with_transitive : IsContinuousLinearMap R by sorry_proof | ||
def_fun_prop cross in y with_transitive : IsContinuousLinearMap R by sorry_proof | ||
def_fun_prop cross in x y with_transitive : Differentiable R by sorry_proof | ||
|
||
#generate_linear_map_simps DataArrayN.cross.arg_x.IsLinearMap_rule | ||
#generate_linear_map_simps DataArrayN.cross.arg_y.IsLinearMap_rule | ||
|
||
|
||
abbrev_fun_trans cross in x y : fderiv R by | ||
rw[fderiv_wrt_prod (by fun_prop)] | ||
fun_trans | ||
|
||
abbrev_fun_trans cross in x y : fwdFDeriv R by | ||
rw[fwdFDeriv_wrt_prod (by fun_prop)] | ||
autodiff | ||
|
||
abbrev_fun_trans cross in x : adjoint R by | ||
equals (fun z => y.cross z) => | ||
sorry_proof | ||
|
||
abbrev_fun_trans cross in y : adjoint R by | ||
equals (fun z => z.cross x) => | ||
funext z | ||
apply AdjointSpace.ext_inner_left R | ||
intro y | ||
rw[← adjoint_ex _ (by fun_prop)] | ||
simp[DataArrayN.inner_def, DataArrayN.cross, | ||
sum_over_prod, sum_pull] | ||
-- expand the sum explicitely and call ring | ||
sorry_proof | ||
|
||
abbrev_fun_trans cross in x y : revFDeriv R by | ||
rw[revFDeriv_wrt_prod (by fun_prop)] | ||
unfold revFDeriv | ||
autodiff | ||
|
||
abbrev_fun_trans cross in x y : revFDerivProj R Unit by | ||
unfold revFDerivProj | ||
autodiff | ||
|
||
abbrev_fun_trans cross in x y : revFDerivProjUpdate R Unit by | ||
unfold revFDerivProjUpdate | ||
autodiff |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import SciLean.Data.DataArray.Operations.Multiply | ||
|
||
namespace SciLean | ||
|
||
open DataArrayN | ||
|
||
def_fun_prop crossmatrix in x | ||
with_transitive : IsContinuousLinearMap R by sorry_proof | ||
|
||
#generate_linear_map_simps DataArrayN.crossmatrix.arg_x.IsLinearMap_rule | ||
|
||
abbrev_fun_trans crossmatrix in x : fderiv R by autodiff | ||
|
||
abbrev_fun_trans crossmatrix in x : fwdFDeriv R by autodiff | ||
|
||
abbrev_fun_trans crossmatrix in x : adjoint R by | ||
equals (fun A => A.antisymmpart) => | ||
sorry_proof | ||
|
||
abbrev_fun_trans crossmatrix in x : revFDeriv R by | ||
unfold revFDeriv | ||
autodiff | ||
|
||
abbrev_fun_trans crossmatrix in x : revFDerivProj R Unit by | ||
unfold revFDerivProj | ||
autodiff | ||
|
||
abbrev_fun_trans crossmatrix in x : revFDerivProjUpdate R Unit by | ||
unfold revFDerivProjUpdate | ||
autodiff |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters