Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to main content

Automatic Differentiation with Higher Infinitesimals, or Computational Smooth Infinitesimal Analysis in Weil Algebra

  • Conference paper
  • First Online:
Computer Algebra in Scientific Computing (CASC 2021)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 12865))

Included in the following conference series:

  • 697 Accesses

Abstract

We propose an algorithm to compute the \(C^\infty \)-ring structure of arbitrary Weil algebra. It allows us to do some analysis with higher infinitesimals numerically and symbolically. To that end, we first give a brief description of the (Forward-mode) automatic differentiation (AD) in terms of \(C^\infty \)-rings. The notion of a \(C^\infty \)-ring was introduced by Lawvere [10] and used as the fundamental building block of smooth infinitesimal analysis and synthetic differential geometry [11]. We argue that interpreting AD in terms of \(C^\infty \)-rings gives us a unifying theoretical framework and modular ways to express multivariate partial derivatives. In particular, we can “package” higher-order Forward-mode AD as a Weil algebra, and take tensor products to compose them to achieve multivariate higher-order AD. The algorithms in the present paper can also be used for a pedagogical purpose in learning and studying smooth infinitesimal analysis as well.

This work was supported by the Research Institute for Mathematical Sciences, an International Joint Usage/Research Center located in Kyoto University.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 79.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 99.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

Notes

  1. 1.

    Such implementation is inherently a partial approximation: there are \(2^{\aleph _0}\)-many smooth functions, but there are only countably many computable (floating) functions.

References

  1. Cox, D., Little, J., O’Shea, D.: Using Algebraic Geometry, 2nd edn. Springer, New York (2005). http://www.cs.amherst.edu/~dac/uag.html

  2. Elliott, C.: Beautiful differentiation. In: International Conference on Functional Programming (ICFP) (2009). http://conal.net/papers/beautiful-differentiation

  3. Elliott, C.: The simple essence of automatic differentiation. In: Proceedings of the ACM on Programming Languages, vol. 2. Association for Computing Machinery, New York, July 2018. https://doi.org/10.1145/3236765

  4. Ishii, H.: Computational algebra system in Haskell (2013). https://konn.github.io/computational-algebra

  5. Ishii, H.: A purely functional computer algebra system embedded in Haskell. In: Gerdt, V.P., Koepf, W., Seiler, W.M., Vorozhtsov, E.V. (eds.) CASC 2018. LNCS, vol. 11077, pp. 288–303. Springer, Cham (2018). https://doi.org/10.1007/978-3-319-99639-4_20

    Chapter  MATH  Google Scholar 

  6. Ishii, H.: smooth: Computational smooth infinitesimal analysis (2020). https://github.com/konn/smooth

  7. Ishii, H.: A succinct multivariate lazy multivariate tower AD for Weil algebra computation. In: Fujimura, M. (ed.) Computer Algebra. RIMS Kôkyûroku, vol. 2185, pp. 104–112. Research Institute for Mathematical Sciences, Kyoto University, Kyoto, Japan (2021)

    Google Scholar 

  8. Joyce, D.: Algebraic geometry over \(C^\infty \)-rings (2016)

    Google Scholar 

  9. Kmett, E.A.: ad: Automatic differentiation (2010). https://hackage.haskell.org/package/ad

  10. Lawvere, F.W.: Categorical dynamics. Topos Theor. Methods Geom. 30, 1–28 (1979)

    MathSciNet  MATH  Google Scholar 

  11. Moerdijk, I., Reyes, G.E.: Models for Smooth Infinitesimal Analysis. Springer, New York (1991). https://doi.org/10.1007/978-1-4757-4143-8

  12. Nishimura, H., Osoekawa, T.: General Jacobi identity revisited again. Int. J. Theor. Phys. 46(11), 2843–2862 (2007). https://doi.org/10.1007/s10773-007-9397-z

    Article  MathSciNet  MATH  Google Scholar 

  13. Pearlmutter, B., Siskind, J.: Lazy multivariate higher-order forward-mode AD, vol. 42, pp. 155–160 (2007). https://doi.org/10.1145/1190216.1190242

  14. Wikipedia: Automatic differentiation (2021). https://en.wikipedia.org/w/index.php?title=Automatic_differentiation&oldid=995938170#Automatic_differentiation_using_dual_numbers

Download references

Acknowledgments

The author is grateful to Prof. Akira Terui, for encouraging to write this paper and many helpful feedbacks, and to anonymous reviewers for giving constructive comments.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Hiromi Ishii .

Editor information

Editors and Affiliations

A Succinct Multivariate Lazy Tower AD

A Succinct Multivariate Lazy Tower AD

For completeness, we include the referential implementation of the Tower-mode AD in Haskell, which can be used in Algorithm 2. The method presented here is a mixture of Lazy Multivariate Tower [13] and nested Sparse Tower [9]. For details, we refer readers to the related paper by the author in RIMS Kôkyûroku [7].

The idea is simple: we represent each partial derivative as a path in a tree of finite width and infinite heights. A path goes down if the function is differentiated by the 0th variable. It goes right if there will be no further differentiation w.r.t. 0th variable, but differentiations w.r.t. remaining variable can take place. This intuition is depicted by the following illustration of the ternary case:

figure v

This can be seen as a special kind of infinite trie (or prefix-tree) of alphabets \(\partial _{x_i}\), with available letter eventually decreasing.

This can be implemented by a (co-)inductive type as follows:

figure w

A tree can have an infinite height. Since Haskell is a lazy language, this won’t eat up the memory and only necessary information will be gradually allocated. Since making everything lazy can introduce a huge space leak, we force each coefficient when their corresponding data constructors are reduced to weak head normal form, as expressed by field strictness annotation .

Then a lifting operation for univariate function is given by:

figure z

Here, we use type-level constraint to represent to a subclass of smooth functions, e.g. for elementary functions. Constraint of form \(\forall x k.\ \texttt {c}\ x => \texttt {c}\ (\texttt {STower}\ k\ x)\) is an example of so-called Quantified Constraints. This requires to be implemented for any succinct Tower AD, provided that their coefficient type, say , is also an instance of . This constraint is used recursively when one implements an actual implementation of instance . For example, instance (for elementary floating point operations) can be written as follows:

figure ah

In this way, we can implement Tower AD for a class of smooth function closed under differentiation, just by specifying an original and their first derivatives.

More general n-ary case of lifting operator is obtained in just the same way:

figure ai

Rights and permissions

Reprints and permissions

Copyright information

© 2021 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Ishii, H. (2021). Automatic Differentiation with Higher Infinitesimals, or Computational Smooth Infinitesimal Analysis in Weil Algebra. In: Boulier, F., England, M., Sadykov, T.M., Vorozhtsov, E.V. (eds) Computer Algebra in Scientific Computing. CASC 2021. Lecture Notes in Computer Science(), vol 12865. Springer, Cham. https://doi.org/10.1007/978-3-030-85165-1_11

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-85165-1_11

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-85164-4

  • Online ISBN: 978-3-030-85165-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics