# Pi Series

Yesterday 3.14 was the Happy Pi-day, how to derive Pi in a sum series?

Penne used 2 sum techniques: Cauchy Product of 2 sums, then change variable.

# Cartan-Brauer Hua Theorem

Study Abstract Algebra, must see thru “General” with Concrete examples to grasp key concepts :
Ring ( Matrix)
Similar matrix
Commutative
Central (of Ring)

Matrix or Integer or Polynomial are all Rings.

Why called it a Ring? It is like CLOCK integer number (0,1, 2,…11,12) or “Z mod 12”, German calls it like “Ring”- shaped Clock. 中文叫环， 法文Anneau , 德文= 英 都叫 Ring.

# Langlands Programme 数学大一统

Langlands Programme:

Bridge between 2 Math Camps :
Algebra – Analysis

Implication: If a problem can’t solve by Algebra，then use Analysis :

Fermat’s Last Theorem 358 years unsolved by Algebra, Andrew Wiles proved by contradiction with Elliptic Curve / Modular Form.

Key Players:

2. André Weil
3. 吴宝珠 Ngoh BaoChao (Vietnamese French, École Normale Supérieure）

Building AI apps with Haskell on Android devices that have a UI is possible, but requires a few steps and tools. Here’s a general idea of what you can do:

1. Write the AI logic in Haskell: This can be done using functional programming concepts and libraries like Haskell’s `lens` or `cabal`.
2. Compile the Haskell code to run on Android: This can be done using tools like Haskell for Android (HFa) or Mobile Haskell, which allow you to compile Haskell code into an APK that can run on Android devices.
3. Create the UI for the app: This can be done using Android UI tools like Android XML or using a cross-platform UI toolkit like Flutter.
4. Integrate the AI logic into the app’s UI: This can be done by calling the AI functions from within the UI code and passing data back and forth between the two.

Keep in mind that building AI apps can be complex and time-consuming, and that optimizing the app for mobile devices can also be challenging. Additionally, finding Haskell developers with expertise in both AI and mobile app development may be difficult.

# Monad in Category Theory

A monad in category theory is a way to describe a concept of computation within a mathematical framework. To apply a monad in the context of category theory, one typically needs to:

1. Define the category in which the monad is to be applied.
2. Define the endofunctor that generates the monad. An endofunctor is a functor from a category to itself.
3. Define the two natural transformations that form the monad structure: “unit” and “bind.” The “unit” natural transformation maps objects in the category to the monad, while the “bind” natural transformation maps morphisms in the category to morphisms in the monad.
4. Show that the endofunctor and natural transformations satisfy the monad laws, which ensure that the monad structure is well-behaved.

Once the monad is defined, it can be used to model a variety of computational concepts, such as data structures, computations, and effects. Monads are commonly used in functional programming and are a fundamental concept in the study of category theory and its applications to computer science.

ChatGPT Jan 30 Version. Free Research Preview

Open sidebar

A Monad in Haskell is a type class with a specific set of functions that allow you to build and chain computations in a predictable and composable manner. Here are the key steps to apply a Monad in Haskell:

1. Define a type: To use a Monad, you need to define a custom type to hold your computations. This type must be an instance of the Monad type class.
2. Implement the `return` function: `return` takes a value and returns a Monad that wraps this value. This function is used to inject values into your computation.
3. Implement the `(>>=)` function: `(>>=)`, also known as the “bind” operator, is used to chain computations together. It takes a Monad and a function that transforms the value inside the Monad and returns a new Monad.
4. Use Monadic functions: Once you have defined your Monad type, you can use Monadic functions, such as `mapM` and `filterM`, to perform operations on your computations.

Here’s a simple example of how to create a Monad in Haskell:

`kotlinCopy code`data MyMonad a = MyMonad a``instance Monad MyMonad where``  return x = MyMonad x``  (MyMonad x) >>= f = f x``

In this example, `MyMonad` is a custom type that holds a value of type `a`, and `return` and `(>>=)` are implemented to wrap and chain the computations, respectively.

# Haskell Backend with Android UI

To write an application with a Haskell back-end and an Android front-end, you’ll need to use a method of interoperation between the two languages, such as a Foreign Function Interface (FFI) or a third-party library.

One approach could be to write the business logic in Haskell and then expose it as a REST API. The Android front-end can then make API calls to the Haskell back-end to access the logic.

Here’s a high-level overview of the steps you can follow:

1. Write the business logic in Haskell: Use Haskell to implement the core logic of your application. You can use any appropriate libraries and frameworks to assist with this.
2. Expose the logic as a REST API: Use a library such as Servant or Scotty to expose the logic as a REST API. This will allow other systems, including your Android front-end, to interact with the logic through HTTP requests.
3. Build the Android front-end: Use Android’s native development tools, such as Android Studio and the Android SDK, to build the user interface for your application. You can use Retrofit or another library to make API calls to the Haskell back-end from your Android code.
4. Deploy the Haskell back-end: You can deploy the Haskell back-end on a server or cloud platform and configure it to serve the REST API.
5. Test and iterate: Once you have the basic architecture in place, you can test the application and iterate on it until it meets your requirements.

Note that this is just one approach to building an application with a Haskell back-end and an Android front-end. There may be other approaches that are better suited to your specific use case.

ChatGPT Jan 30 Version. Free Research Preview. Our goal is

# FPL Comparison Overview

Which is the best Functional Programming language : Haskell, Scala, Rust, C++, Python, Typescript?

It’s subjective to say which is the best functional programming language as it depends on various factors such as personal preference, specific use case, and project requirements. However, here’s a brief overview of some popular functional programming languages:

1. Haskell: A pure functional language that is known for its strong type system and theoretical foundations. It’s popular among researchers and academics.
2. Scala: A hybrid functional/object-oriented language that runs on the JVM and can be used for a wide range of applications.
3. Rust: A systems programming language that combines functional and imperative programming paradigms, and emphasizes safety and concurrency.
4. C++: A multi-paradigm language that supports functional programming, but is primarily used for systems programming and performance-critical applications.
5. Python: A multi-paradigm language that has functional programming features, but is primarily used for scripting and general-purpose programming.
6. TypeScript: A statically typed language that builds on JavaScript and adds features for large-scale applications, including functional programming constructs.

In conclusion, the best functional programming language for you will depend on your specific use case and preferences.

Can Haskell run on JVM or Android

Yes, Haskell can run on the Java Virtual Machine (JVM) through the use of a Haskell to Java bytecode compiler, such as JHC or Jakarta Haskell Compiler. However, it’s not a native runtime for the JVM and may not perform as well as a language that was designed to run on the JVM, such as Scala.

As for running Haskell on Android, there are some experimental projects that aim to bring Haskell to Android, but it’s not a widely supported platform for Haskell at this time.

How is Haskell UI ?

Haskell is primarily a back-end language and is not widely used for building user interfaces. However, it’s possible to create graphical user interfaces (GUIs) in Haskell using libraries such as GTK, Qt, and wxWidgets.

These libraries provide a way to create windows, buttons, and other GUI elements using Haskell code. However, building a GUI in Haskell can be more challenging compared to using a GUI framework in a language that is specifically designed for UI development, such as Java or C#.

In summary, while it’s possible to build UIs in Haskell, it may not be the most convenient or efficient option for most UI development tasks.

Can Haskell interoperate with C++ or Java

Yes, Haskell can interoperate with both C++ and Java. There are several ways to achieve this, including:

1. FFI (Foreign Function Interface): Haskell provides a standard FFI, which allows Haskell functions to be called from other languages and vice versa. This enables interoperation with C++ and Java by writing wrapper functions in these languages that call Haskell code.
2. Third-party libraries: There are also libraries available, such as HsFFI and hs-java, that provide more convenient ways to interact with C++ and Java code from Haskell.

In conclusion, while Haskell is a purely functional language and has a different programming paradigm compared to C++ and Java, it is possible to interface with these languages and leverage their libraries and tools in Haskell projects

# Double Integrals

Applied in Gamma function (eg . ½ !)

# Yoneda Lemma Embedding

Yoneda is a Japanese mathematician, who met the Category Theory (CT) inventor Harvard Prof MacLane in Paris, both waiting for the train at ‘Gare du Nord’ station. Yoneda mentioned his discovery to Prof that all Categories in fact can be ‘faithfully’ viewed as “Set”, like my example of 家族 Category C consists of 吴氏家族x with object a (= 我), b(=兄/弟)， is exactly (faithfully) depicted in 吴氏家谱 of the “Set of F” between (x->a ) to (x->b).
F is a Functor (like function) called ‘Natural Transformation’.

MacLane called this Lemma Yoneda, the only Theorem / Lemma in CT.

# Use Chat-GPT to build a GPT

Use Chat-GPT to build a GPT.

# When Descartes fought with Fermat

Fermat and Descartes both invented the Analytical Geometry (解析几何) by different approaches – Fermat’s method (using a rough notion of “Limit”) is better, also laid the foundation of “Calculus” for Newton who admitted he stood on the shoulder of a giant (Fermat).

Lycée Pierre de Fermat (Classe Préparatoire) was my “alma mater” (1977-1979) where Fermat worked as a Toulouse (AirBus City) Chief Judge in 17CE.

# Probability

Probability:
17CE : inventors Pascal & Fermat,
thru 19CE mostly by French mathematicians using (Finite) Set Theory.

Forgotten : Renaissance era the Italian Cardano (reveal to the world the “i” complex number secret in solving cubic equation) who gave the operations “+” or “x” for probability of 2 dependent or independent events, respectively.

After 20 CE ,
“Modern Probability” by Russian.

# Gaussian Integral by Laplace trick

Gaussian Integral (I) by Laplace trick :

1. I² : change to double integral,
2. Fubini’s condition : if ‘convergence”, then dx.dy = dy.dx

# Colles in Lycée Pierre de Fermat

1977-1979 evenings at 6 pm – 7 pm, I walked on these big staircases of Lycée Fermat with nervous mind, on the way to “Colles” (Weekly Oral Interrogations) for Maths / Physics / Chemistry or Foreign Language.

# Yoneda Lemma

Superman 白天是 office worker , 晚上 化身变 大侠。其实 白天/夜晚两人是同一人： 这就是 Category Theory 的 (日本数学家 “Yoneda Lemma“）: Isomorphism (“Equality” in Category sense)

# Functional JavaScript: 5 Rules

https://www.sitepoint.com/make-javascript-functional/

To summarize, here are the five rules that will help you achieve functional code:

• Keep your functions pure.
• Always declare variables and functions using const.
• Use arrow notation for functions.
• Avoid using `for` loops.
• Use type declaration comments and avoid type coercion shortcuts.

# Functional Programming vs Object-Oriented

FP: Object fixed, behavior (Functor) varies

OO: Object varies, behavior (polymorphism) fixed.

# Hermitian Matrix

Complex-value Matrix aka Hermitian Matrix, Fourier Transform towards FFT.

Charles Hermite ：(小15 年)师弟 of Galois from same Lycée Louis Le Grand with same high school Math teacher Mr. Richard.

key concepts: Orthogonal, orthonormal, conjugate, inverse

# SO(n), O(n), Affine

https://m.toutiao.com/article/7168883187471368717/?app=news_article&timestamp=1669378409&use_new_style=1&req_id=202211252013290102112000731D3D36CE&group_id=7168883187471368717&tt_from=android_share&utm_medium=toutiao_android&utm_campaign=client_share&share_token=70233650-abc9-4332-bf1d-7f6937ddc48e

# “找他爸”不用记公式

“Derive From 1st Principle”.

https://v.ixigua.com/rCNy238/

# French Math Terms: Suites, Series , Séquence

(French) “les Suites = Séries,

“les Séries” = “Sum of series”.

Séquence (eg Fibonacci) is the same (English) Sequence.

[1] 简易版：

[2] 详细版：

# Group Theory for A-level ?

Group Theory included in A-level Junior College / High School ? Yes , only for H3 & Further Math(?), not for majority H2 Science students. In French Baccalaureate , Group Theory is taught for Science students.

This math teacher found those who had learnt Group Theory (or even Set Theory) do well in University Modern Math.

https://v.ixigua.com/MWPyGkn/

# 中国近现代数学史

https://v.ixigua.com/MxguTWP/

1. 启蒙 第一代： 1900 – 1949 （留美博士： 姜立夫 / 江泽涵 (翻译 同调Homology/同伦 Homotopy) / 杨武之（杨振宁的父亲，陈省身的老师）， 留法博士：熊庆来 (华罗庚的恩师), 留日： 陈健功 / 苏步青 ）

1a: 外国教授来华教书： Bertrand Russell (UK, Logic), Hadamard (France),维纳(USA, MIT), etc.

1b. 数学系建立： 北京大学， 南开， 浙江/复旦，东南大学（现 南京大学）。

2. 第二代： 1949 – 1978 （中间10年断层： 文化大革命）- 留法博士：陈省身 (“Gauss II”)，留英：华罗庚 (3 years under Cambridge Prof Hardy)

2a: 1950s 中学数学教育改革， 大量翻译外国中学教材： 范氏大代数 (College Algebra), 葛氏三角(Grandville Trigonometry), 欧式几何。

3. 第三代： 1978 邓小平恢复大学科研教育 – 本土：陈景润 （厦门大学本科毕业，华罗庚 的 研究生），留法博士： 吴文俊

3a. 1985 中国参加IMO Olympiad 比赛。1989-1990 首 2 次 中国得 IMO 团体冠军。

4. 第四代： 留美博士：丘城桐（陈省身的学生）， 张益唐（北大 硕士 / Purdue PhD)

5. 第五代： 留美博士： 田刚（丘城桐的哈佛学生）

6. 第六代本土］： 北大：韦东奕， 清华：“求真学院”（丘城桐回国建立 80数学 天才 培训班：本科+硕/博 = 8 年）

# Charles Hermite

【数学家却经常数学考试不及格】
Charles Hermite是 Galois 的同校&同师傅的Lycée Louis Le Grand学弟（小15届），数学老师Richard留着Galois 的旧作业交给Hermite 学习。

Hermite 跛脚， 被 军校 Ecole Polytechnique “X” 踢出大学一年级。（他是最后一名考进“X“, after 5 attempts）!

# 韦神 解 Quintic Polynomial Équation

How did he come out with x= a – 2/a ?👍

https://v.ixigua.com/MHaMRVQ/

a^5 = 8 => a = 1.5157

x = a- 2/a = 0.1962

a^5 = – 4 => a = -1.31950791

x = a-2/a = 0.1962

# Inequality “≤”

Inequality ” ≤ “is an EQUIVALENCE RELATION “∼” (3 properties : Reflexive 自反, Symmetric 对称性 , Transitive 传递性 ) ， more interesting than “<“.

” ≤ “： 一正二定三相等

eg. 1. Congruence/Similarity (Geometry).

1. Function 函数 / Mapping 映射 (between Sets)
2. Functor 函子 (between Categories)
3. Natural Transformation 自然变换 ( between Functors)
4. Morphism (Homo-, Endo-, Iso-, -Auto between Groups, Rings, Vector Space…)
5. Homeomorphism 同胚 (between Topologies eg. Mug and Donut )

https://v.ixigua.com/MHkr5r2/

# DI Method – Integration by Parts

Integration by Parts: American “DI Method” is better. GCE-A Method is recursive, more steps.

# GM ≦ AM Trick

“General Manager smaller than Assistant Manager”

Put 27 cubes (Length =a, Width=b, Height =c), inside a big Cube of side (a+b+c), can’t fill the big Cube completely.

$27abc leq (a+b+c)^{3}$

$sqrt [3] {abc} leq frac {a+b+c}{3}$
Generalized:

GM ≦AM

GM = Geometric Mean
AM = Arithmetic Mean

$sqrt [n] {x_1 x_2 x_3 dots x_n} leq frac {x_1+x_2+x_3...+xn}{n}$

$mbox {Application}$
$mbox {Prove:} : 1003^{2005} > 2005!$

Solution: use ‘Promote’ technique to general case:

$sqrt[n] {1.23...n} < frac {1+2...+n}{n}$
Let n=2005
$sqrt[2005] {1.23...2005} < frac {1+2...+2005}{2005}$
$sqrt[2005] {2005!} < frac {(2005)(2006)/2}{2005}$
$sqrt[2005] {2005!} <1003$
$1003^{2005} > 2005!$ [QED]

# Pure vs Applied Math

Since 1850, Pure Math leading with Abstract Algebra “Group Theory”, etc …however, after 2000, Applied Math catching up with Pure Math in IT (Category Theory, Fuzzy Logic, AI, Algebraic Toplology…).

# CarMichael Number

17 yo MIT Prodigy Larson proved CarMichael Number (c), using 张益唐 Twin Primes Gap and Bertrand’s Postulate (n < c < 2n).

# Category Intuition

The basic intro to CT.

Free Group, Free Vector Space are the “Category Theory” version of Group and Vector Space by “U” Functor – the “Forgetful” functor !

# 数学的4个层次 maturity level

Level 1: PSLE

Level 2: Secondary School (O and A-Level)

Level 4: Mathematical Thinkers (Grand Masters: Leibniz, Galois, Gauss, Descartes, Pascal, Fermat, Poincaré)

# 单/满/双/射， 等势

https://v.ixigua.com/MenTLrP/

Function 函数 is a “special” case of Mapping 映射 (L’application) with ONLY 1 Image, whereas Mapping can have 0, or 1 or >2 images.

The British GCE “abuse” the term “Function” for all cases.