1. notice
  2. English
  3. logic-topic
  4. 1. logic
  5. 2. basic
  6. 3. map
  7. 4. order
  8. 5. combinatorics
  9. calculus
  10. 6. real-numbers
  11. 7. limit-sequence
  12. 8. division-algebra
  13. 9. Euclidean-space
  14. 10. Minkowski-space
  15. 11. polynomial
  16. 12. analytic-Euclidean
  17. 13. analytic-Minkowski
  18. 14. analytic-struct-operation
  19. 15. ordinary-differential-equation
  20. 16. volume
  21. 17. integral
  22. 18. divergence
  23. 19. limit-net
  24. 20. topology
  25. 21. compact
  26. 22. connected
  27. 23. topology-struct-operation
  28. 24. exponential
  29. 25. angle
  30. geometry
  31. 26. manifold
  32. 27. metric
  33. 28. metric-connection
  34. 29. geodesic-derivative
  35. 30. curvature-of-metric
  36. 31. Einstein-metric
  37. 32. constant-sectional-curvature
  38. 33. simple-symmetric-space
  39. 34. principal-bundle
  40. 35. group
  41. 36. stereographic-projection
  42. 37. Hopf-bundle
  43. field-theory
  44. 38. point-particle-non-relativity
  45. 39. point-particle-relativity
  46. 40. scalar-field
  47. 41. scalar-field-current
  48. 42. scalar-field-non-relativity
  49. 43. projective-lightcone
  50. 44. spacetime-momentum-spinor-representation
  51. 45. Lorentz-group
  52. 46. spinor-field
  53. 47. spinor-field-current
  54. 48. electromagnetic-field
  55. 49. Laplacian-of-tensor-field
  56. 50. Einstein-metric
  57. 51. interaction
  58. 52. harmonic-oscillator-quantization
  59. 53. spinor-field-misc
  60. 54. reference
  61. 中文
  62. 55. notice
  63. 逻辑
  64. 56. 逻辑
  65. 57. 基础
  66. 58. 映射
  67. 59. 序
  68. 60. 组合
  69. 微积分
  70. 61. 实数
  71. 62. 数列极限
  72. 63. 可除代数
  73. 64. Euclidean 空间
  74. 65. Minkowski 空间
  75. 66. 多项式
  76. 67. 解析 (Euclidean)
  77. 68. 解析 (Minkowski)
  78. 69. 解析 struct 的操作
  79. 70. 常微分方程
  80. 71. 体积
  81. 72. 积分
  82. 73. 散度
  83. 74. 网极限
  84. 75. 拓扑
  85. 76. 紧致
  86. 77. 连通
  87. 78. 拓扑 struct 的操作
  88. 79. 指数函数
  89. 80. 角度
  90. 几何
  91. 81. 流形
  92. 82. 度规
  93. 83. 度规的联络
  94. 84. Levi-Civita 导数
  95. 85. 度规的曲率
  96. 86. Einstein 度规
  97. 87. 常截面曲率
  98. 88. simple-symmetric-space
  99. 89. 主丛
  100. 90. 群
  101. 91. 球极投影
  102. 92. Hopf 丛
  103. 场论
  104. 93. 非相对论点粒子
  105. 94. 相对论点粒子
  106. 95. 纯量场
  107. 96. 纯量场的守恒流
  108. 97. 非相对论纯量场
  109. 98. 光锥射影
  110. 99. 时空动量的自旋表示
  111. 100. Lorentz 群
  112. 101. 旋量场
  113. 102. 旋量场的守恒流
  114. 103. 电磁场
  115. 104. 张量场的 Laplacian
  116. 105. Einstein 度规
  117. 106. 相互作用
  118. 107. 谐振子量子化
  119. 108. 旋量场杂项
  120. 109. 参考

note-math

For humans, one way to understand natural numbers is counting.

For computers (cf. logic.typ), the source of representing natural numbers is periodic circuits. The binary in memory can directly represent numbers. For example, for 3 bits:

binary decimal
000 0
001 1
010 2
011 3
100 4
101 5
110 6
111 7

A computer’s arithmetic unit can perform calculations on numbers.

There are also various more complex computer behaviors like “functions that recursively call themselves”, which is also a form of counting.

However, the number of elements in the set of natural numbers is infinite, while bits and computer memory are finite. Human memory is also finite.

Problem of infinite space: Reality cannot construct circuits and memory of infinite space. Even if it could, it would be limited by the finite speed of electric current.

But “potential infinity” can be achieved using potentially infinite time.

Assuming the upper limit of memory is infinite but memory usage per cycle is finite, then a program has infinitely possible inputs, which is also a form of potential infinity.

Theoretically, all natural numbers can be counted one by one. However, there are even sets with an uncountable number of elements. They are infinite and cannot be counted. Example

  • All subsets of , or (i.e., all functions from to )
  • All functions from to itself,

Verifying the correctness of set theory/languages requires a parser, or for mathematical languages, also called a prover.

Motivation for sets/types

  • Modularity and multiplicative decomposition to simplify cognition

    Example The subject-verb-object SVO in natural language. Suppose there are 10 nouns and 10 verbs. If we “forgot the SVO rules”, then verifying the grammatical correctness of a three-word sentence would require at most attempts. If we understand and use SVO rules, it would require at most attempts.

  • If the number of elements in a set is infinite, then the set/type will be conceptually finite, making it possible to state within a finite time

Complex mathematical objects are stored in variable names, so humans still need to check the correctness of all complex definitions stored in variable names, which is why code readability is very important

A prover allows humans to reduce from needing to review all steps to reviewing definitions (and checking the compiler’s logical code), skipping a large number of detailed proof steps, and still being able to determine the correctness of the proof result

The human brain compiler can omit and supplement omissions, trading temporary efficiency for error-proneness and forgetfulness

In addition to verifying the correctness of proofs, provers can also have other uses, for example, similar to tools in programming languages, they can have friendly and interactive compiler error messages, and LSP (language server protocol) tools

prover 的例子: acornprover, lean

Let’s not go into details here for now, just a brief overview

[proposition] [theorem] An unproved proposition/theorem is a function from type to ,


          
theorem p(x: T) {

          
  // ...

          
}

          
theorem p(x: T) {

          
  // ...

          
}

is proven := the prover’s calculation result for always returns true. Can be understood as (usually omitting = true)


          
forall(x: T) {

          
  p(x) = true

          
}

          
forall(x: T) {

          
  p(x) = true

          
}

Although we have not yet given the construction rules for types

[set] A set of type is essentially a function from type to , . But using a wrapper layer is sometimes convenient


          
structure Set[K] {

          
    contains: K -> Bool

          
}

          
structure Set[K] {

          
    contains: K -> Bool

          
}

A set of type is represented as


          
a: Set[K]

          
a: Set[K]

An element of type belongs to is represented as


          
a.contains(x)

          
a.contains(x)

or


          
x ∈ a

          
x ∈ a

The empty set empty[T] corresponds to the constant false function. The universe set universe[T] corresponds to the constant true function.

According to the definition of subset in common set theory, it can be written as

Equality can be understood as a binary Boolean function

equal(x: T, y: T) -> Bool

Satisfies transitivity

a = b and b = c implies a = c

  • forall, exists (all, exist)

            
forall(a: T) {

            
  // ...

            
}

            
exists(a: T) {

            
  // ...

            
}

            
forall(a: T) {

            
  // ...

            
}

            
exists(a: T) {

            
  // ...

            
}

Or written as

  • inference (推导)

            
p implies q

            
p implies q

Or written as

  • equivalent

            
p = q

            
p = q

Or


            
p iff q

            
p iff q

or


            
(p implies q) and (q implies p)

            
(p implies q) and (q implies p)

or written as

The following calculation results can be proven to be equal by exhaustion

Similarly, to represent the case of “infinite elements”, define the De Morgan law for infinite elements

Similar to the redundancy of , set/type construction rules may also have redundancy, or many equivalent definitions

follow various rules for bool in finite cases, define

[commutative-forall-exists]

same for

[distributive-forall-exists]

(Need to assume the existence of function ?)

Natural language examples of derivation

If it rains, I won’t go out
It’s raining
So I won’t go out

This example is similar to a conditional branch


          
let rain : bool;

          
let out : bool;

          
match (rain) {

          
  true => out = false,

          
  false => out = undefined,

          
};

          
let rain : bool;

          
let out : bool;

          
match (rain) {

          
  true => out = false,

          
  false => out = undefined,

          
};

Similar to the if block in common programming languages, it automatically skips the execution area when the condition is not met


          
if (rain = true) {

          
  out = false

          
}

          
if (rain = true) {

          
  out = false

          
}

For mathematical language, that is

  • prover reads
  • prover reads is true (possibly from definition)
  • prover reads is true
  • prover assigns the boolean value of to true based on this condition (from memory)

If “void implication” similar to skipping an if block is accepted, then there will be

and find that is

[reverse-inference] Reverse inference. If the result is that I went out, then it must not be the result of rain. If the result of the conditional branch is out = true, this is not the result of rain = true. Since the boolean value of an ideal binary computer must be one or the other, it can only be the result of rain = false. This can be written as a conditional branch


          
match (out) {

          
  true => rain = false,

          
  false => rain = undefined,

          
};

          
match (out) {

          
  true => rain = false,

          
  false => rain = undefined,

          
};

Mathematically, reverse inference is written as the formula , and defined as equivalent to

[natural-number]

natural number

natural number set is an inductive type


            
inductive ℕ {

            
  0

            
  suc(ℕ)

            
}

            
inductive ℕ {

            
  0

            
  suc(ℕ)

            
}

Computers cannot handle infinity. To enable computers to represent the set of natural numbers with finite characters and memory, we treat and the function as finite symbols in memory addresses, such that

is equivalent to telling the computer how to continuously using an instruction stream? This also relates to induction.

The cost of finite characters is potentially infinite time, always relying on counting or periodic circuits.

definition

Since “definition language expansion” is long, it is usually abbreviated to “definition” “def”

[product]

let be set, then is set

The expression is a product data structure.

Abbreviation . in finite case, number of elements

[sum]

let be set then is a set

also known as tagged union

in finite case, number of element

[function]

let be set. Define function space , the rule for map is

or

denoted by

denoted by . in finite case, number of elements

In a prover, the definition and behavior of a function are: input type + output type + if the same input is checked, the output is specified to be the same

Prop . can correspond to

[subtype]

Adding a proposition to a type and using logic and can yield a “subtype”. It’s similar to a subset, but uses dependent types to add a layer of wrapper.


            
define(a: Set[K]) -> Type {

            
  structure {

            
    val: K

            
  } constraint {

            
    a.contains(val)

            
  }

            
}

            
define(a: Set[K]) -> Type {

            
  structure {

            
    val: K

            
  } constraint {

            
    a.contains(val)

            
  }

            
}

If a theorem about type is proven, sometimes, it’s easy to see that it holds for certain subtypes. But for a computer, the theorem might need to be rewritten. One way to mitigate this tedium is to use typeclasses to represent structural types and their properties, so that theorems are based on typeclasses, thus increasing reuse and reducing repetition.

function space introduces higher-level infinity

Something counter-intuitive at first glance is that we seem to know all or all , yet we cannot count them cardinal-increase uncountable. But, what exactly does “knowing all “ mean? In fact, trying to consider the problem of “finding an infinite subset of in a general way” will reveal that it’s not simple.

Similarly, although countable can already define some real numbers e.g. , if not using or , only countable constructions cannot obtain all

[subset]

Since false, according to vacuous implication,

denoted by . in finite case, number of elements

let

Or if “construct set theory with type theory”, then the definition of equality of sets reduce to the definition of equality of functions

let

[union]

[intersection]

Note that the elements of union and intersection are restricted to type . In ordinary set theory, if one tries to define the intersection of an empty family of sets, if not restricted to type (or restricted to a certain set), then due to the vacuous argument, the result of the intersection of an empty family of sets is the universal set , and the universal set is not a set, which violates the rules of set theory construction

The intuition that the intersection of an empty family of sets is the universal set: because intersection is decreasing with respect to , thus the intersection continuously increases towards the empty family of sets

Based on the index mapping , infinite versions of product, sum can be defined

  • [product-index]

product component

or

  • [sum-index]

sum component

[hierarchy-order-of-set]

The type/set constructed above is called zero (hierarchy) order type/set

or

We can assume

Again using type construction rules, what is obtained is also defined as belonging to

Can also continue

. And so on …

Example

  • 
                    
    typeclass G: Group {
    
                    
      mul(g: G, h: G) -> G
    
                    
      inverse(g: G) -> G
    
                    
      // property of group
    
                    
    }
    
                    
    typeclass G: Group {
    
                    
      mul(g: G, h: G) -> G
    
                    
      inverse(g: G) -> G
    
                    
      // property of group
    
                    
    }

looks like the set of natural numbers , so should we assume a new hierarchy ? Then for , continue to use the type construct rule … (will it lead to needing infinite language rules?)

belongs to and belongs to , but these two “belongs to” language rules are different

[universal-type]

The problem of universal-type, or the problem of type of every type

What is easy to overlook here is, what does “type” in “type of every type” refer to? What does the so-called “type” mean?

Assuming the program defines a concept of universal-type, and universal-type can in turn be used to construct “type”, then universal-type refers to itself in the construction rules of “type”, leading to non-terminating languages or programs.

Example [Russell-paradox]

defined using set theory rules

Then try to calculate the boolean of another proposition . Since = true, the prover only needs to calculate the boolean of , then finds not, so it tries to calculate the boolean inside not, but this goes back to calculating the boolean of , entering a circuit deadlock.

Example [self-referential-paradox] Self-referential paradox. “This sentence is false”


              
this_sentence_is_false : bool = false;

              
loop {

              
  match (this_sentence_is_false) {

              
    false => this_sentence_is_false = true,

              
    true => this_sentence_is_false = false,

              
  }

              
}

              
this_sentence_is_false : bool = false;

              
loop {

              
  match (this_sentence_is_false) {

              
    false => this_sentence_is_false = true,

              
    true => this_sentence_is_false = false,

              
  }

              
}

[dependent-distributive]

let be set of sets, let , and let be set of sets, index by its elements

union & intersection

draft of proof: 展开, 使用 distributive-forall-exists

sum & product

[set-minus]

. if then define

[symmetric-set-minus]