• 0 Posts
  • 200 Comments
Joined 2 years ago
cake
Cake day: June 12th, 2023

help-circle


  • Which is really a roundabout way of saying a tensor is a multilinear relationship between arbitrary products of vectors and covectors. They’re inherently geometric objects that don’t depend on a choice of coordinate system. The box of numbers is just one way of looking at a tensor, like a matrix is to a linear transformation on a vector space





  • What I described isn’t necessarily functional. This is just a principle for ensuring objects represent clear and well-defined contracts. The idea is that to mutate something, you should own it; that means interfaces / public APIs, which can be called externally, should take immutable arguments. You can still mutate instance members internally because those are owned by the instance. If mutation is really necessary between two objects then it should be coordinated by an object owning them both.


  • That’s a footgun sure but at least you can avoid it once you’re aware of the problem.

    I never write function signatures with mutable interfaces. It’s always IEnumerable, IReadOnlyCollection, or IReadOnlyList; otherwise, use a concrete type. The latter is typical for private/protected methods that are called with instance members of a concrete type rather than public interfaces. If you want to mutate an object, you should own it. Public methods are invoked with data not owned by the instance.

    For example, a lot of extension methods in LINQ have a signature IEnumerable<T> --> IEnumerable<T>, and internally the first thing they do is call .ToList(). The interface makes minimal assumptions about the input data, then puts it into a concrete type you can manipulate efficiently. You can similarly define a method for IReadOnlyList and explicitly make it mutable via .ToList(), rather than use IList and check .IsReadOnly. Both ensure correctness but the former does it at the type level, at design time, instead of relying on runtime checks.

    C# is old and full of oldness. But it’s also an excellent language that can be written beautifully if you know how. And there’s lots of great code to learn from in the open-source dotnet core runtime repo and related projects.








  • Kogasa@programming.devtoScience Memes@mander.xyzListen here, Little Dicky
    link
    fedilink
    English
    arrow-up
    2
    arrow-down
    1
    ·
    3 months ago
    1. I also have a masters in math and completed all coursework for a PhD. Infinitesimals never came up because they’re not part of standard foundations for analysis. I’d be shocked if they were addressed in any formal capacity in your curriculum, because why would they be? It can be useful to think in terms of infinitesimals for intuition but you should know the difference between intuition and formalism.

    2. I didn’t say “infinitesimals don’t have a consistent algebra.” I’m familiar with NSA and other systems admitting infinitesimal-like objects. I said they’re not standard. They aren’t.

    3. If you want to use differential forms to define 1D calculus, rather than a NSA/infinitesimal approach, you’ll eventually realize some of your definitions are circular, since differential forms themselves are defined with an implicit understanding of basic calculus. You can get around this circular dependence but only by introducing new definitions that are ultimately less elegant than the standard limit-based ones.


  • Ok, but no. Infinitesimal-based foundations for calculus aren’t standard and if you try to make this work with differential forms you’ll get a convoluted mess that is far less elegant than the actual definitions. It’s just not founded on actual math. It’s hard for me to argue this with you because it comes down to simply not knowing the definition of a basic concept or having the necessary context to understand why that definition is used instead of others…