Validating Mathematical Structures
Kazuhiko Sakaguchi
University of Tsukuba
Validating Mathematical Structures Kazuhiko Sakaguchi University of - - PowerPoint PPT Presentation
Validating Mathematical Structures Kazuhiko Sakaguchi University of Tsukuba IJCAR 2020 Packed classes [Garillot et al. 2009; Garillot 2011] Hierarchies of mathematical structures are a key ingredient of modern formalizations of mathematics.
University of Tsukuba
2 / 21
choiceType countType zmodType porderType countZmodType finType lmodType ringType normedZmodType finPOrderType numDomainType latticeType countComRingType countComUnitRingType finComRingType countIdomainType finComUnitRingType countFieldType finIdomainType countDecFieldType countClosedFieldType finFieldType countRingType countUnitRingType finRingType finUnitRingType finLalgType finUnitAlgType finZmodType finLmodType finGroupType eqType falgType fieldExtType splittingFieldType finAlgType finLatticeType algType comAlgType unitAlgType comUnitAlgType closedFieldType numClosedFieldType comRingType comUnitRingType idomainType fieldType decFieldType numFieldType realFieldType realDomainType lalgType vectType unitRingType archiFieldType rcfType bDistrLatticeType cbDistrLatticeType tbDistrLatticeType ctbDistrLatticeType finDistrLatticeType bLatticeType tbLatticeType finCDistrLatticeType distrLatticeType
finOrderType 3 / 21
4 / 21
5 / 21
6 / 21
7 / 21
7 / 21
7 / 21
8 / 21
zero : ∀ A : Monoid.type, A add : ∀ A : Monoid.type, A → A → A
mul : ∀ A : Semiring.type, A → A → A
Monoid.sort Semiring.sort Group.sort Ring.sort
Ring.semiringType Ring.groupType Ring.monoidType Semiring.monoidType Group.monoidType
9 / 21
zero : ∀ A : Monoid.type, A add : ∀ A : Monoid.type, A → A → A
mul : ∀ A : Semiring.type, A → A → A
Monoid.sort Semiring.sort Group.sort Ring.sort
Ring.semiringType Ring.groupType Ring.monoidType Semiring.monoidType Group.monoidType
9 / 21
zero : ∀ A : Monoid.type, A add : ∀ A : Monoid.type, A → A → A
mul : ∀ A : Semiring.type, A → A → A
Monoid.sort Semiring.sort Group.sort Ring.sort
Ring.semiringType Ring.groupType Ring.monoidType Semiring.monoidType Group.monoidType
9 / 21
zero : ∀ A : Monoid.type, A add : ∀ A : Monoid.type, A → A → A
mul : ∀ A : Semiring.type, A → A → A
Monoid.sort Semiring.sort Group.sort Ring.sort
Ring.semiringType Ring.groupType Ring.monoidType Semiring.monoidType Group.monoidType
9 / 21
zero : ∀ A : Monoid.type, A add : ∀ A : Monoid.type, A → A → A
mul : ∀ A : Semiring.type, A → A → A
Monoid.sort Semiring.sort Group.sort Ring.sort
Semiring.sort (Ring.semiringType T)
Ring.semiringType Ring.groupType Ring.monoidType Semiring.monoidType Group.monoidType
9 / 21
zero : ∀ A : Monoid.type, A add : ∀ A : Monoid.type, A → A → A
mul : ∀ A : Semiring.type, A → A → A
Monoid.sort Semiring.sort Group.sort Ring.sort
Semiring.sort (Ring.semiringType T)
Ring.semiringType Ring.groupType Ring.monoidType Semiring.monoidType Group.monoidType
9 / 21
10 / 21
11 / 21
12 / 21
12 / 21
13 / 21
Monoid.sort ?M → Monoid.sort ?M
13 / 21
Monoid.sort ?M → Monoid.sort ?M
Monoid.sort ?M ≡ Semiring.sort ?SR
13 / 21
Monoid.sort ?M → Monoid.sort ?M
Monoid.sort ?M ≡ Semiring.sort ?SR
13 / 21
13 / 21
Group.sort ?G → Group.sort ?G
13 / 21
Group.sort ?G → Group.sort ?G
Group.sort ?G ≡ Semiring.sort ?SR
13 / 21
Group.sort ?G → Group.sort ?G
Group.sort ?G ≡ Semiring.sort ?SR
13 / 21
14 / 21
15 / 21
15 / 21
16 / 21
16 / 21
17 / 21
17 / 21
17 / 21
18 / 21
19 / 21
20 / 21
21 / 21
Reynald Affeldt, Cyril Cohen, Marie Kerjean, Assia Mahboubi, Damien Rouhling, and Kazuhiko Sakaguchi. “Competing inheritance paths in dependent type theory: a case study in functional analysis”. In: IJCAR ’20. Vol. 12167.
Andrea Asperti, Wilmer Ricciotti, Claudio Sacerdoti Coen, and Enrico Tassi. “Hints in Unification”. In: TPHOLs ’09.
Gilles Barthe. “Implicit coercions in type systems”. In: TYPES ’95. Vol. 1158. LNCS. Springer, 1996, pp. 1–15. doi: 10.1007/3-540-61780-9_58. Cyril Cohen, Kazuhiko Sakaguchi, and Enrico Tassi. “Hierarchy Builder: algebraic hierarchies made easy in Coq with Elpi (System Description)”. In: FSCD ’20. Vol. 167.
François Garillot. “Generic Proof Tools and Finite Group Theory. (Outils génériques de preuve et théorie des groupes finis)”. PhD thesis. École Polytechnique, Palaiseau, France, 2011. url: https://tel.archives-ouvertes.fr/pastel-00649586. François Garillot, Georges Gonthier, Assia Mahboubi, and Laurence Rideau. “Packaging Mathematical Structures”. In: TPHOLs ’09. Vol. 5674. LNCS. Springer, 2009, pp. 327–342. doi: 10.1007/978-3-642-03359-9_23.
1 / 14
Georges Gonthier et al. “A Machine-Checked Proof of the Odd Order Theorem”. In: ITP ’13. Vol. 7998. LNCS. Springer, 2013, pp. 163–179. doi: 10.1007/978-3-642-39634-2_14. Assia Mahboubi and Enrico Tassi. “Canonical Structures for the Working Coq User”. In: ITP ’13. Vol. 7998. LNCS. Springer, 2013, pp. 19–34. doi: 10.1007/978-3-642-39634-2_5. Amokrane Saïbi. “Typing Algorithm in Type Theory with Inheritance”. In: POPL ’97. ACM, 1997, pp. 292–301. doi: 10.1145/263699.263742. The mathlib Community. “The Lean Mathematical Library”. In: CPP ’20. ACM, 2020, pp. 367–381. doi: 10.1145/3372885.3373824.
2 / 14
choiceType countType zmodType countZmodType finType finZmodType lmodType ringType countComRingType countComUnitRingType countIdomainType countFieldType countDecFieldType countClosedFieldType countRingType countUnitRingType finGroupType eqType falgType fieldExtType splittingFieldType finLmodType finRingType finAlgType finUnitAlgType finComRingType finComUnitRingType finIdomainType finFieldType finLalgType finUnitRingType algType unitAlgType closedFieldType numClosedFieldType comRingType comUnitRingType idomainType fieldType numDomainType decFieldType numFieldType realFieldType realDomainType lalgType vectType unitRingType archiFieldType rcfType 3 / 14
choiceType countType zmodType countZmodType finType lmodType ringType countComRingType countComUnitRingType finComRingType countIdomainType finComUnitRingType countFieldType finIdomainType countDecFieldType countClosedFieldType finFieldType countRingType countUnitRingType finRingType finUnitRingType finLalgType finUnitAlgType finZmodType finLmodType finGroupType eqType falgType fieldExtType splittingFieldType finAlgType algType unitAlgType closedFieldType numClosedFieldType comRingType comUnitRingType idomainType fieldType numDomainType decFieldType numFieldType realFieldType realDomainType lalgType vectType unitRingType archiFieldType rcfType 4 / 14
choiceType countType zmodType countZmodType finType lmodType ringType countComRingType countComUnitRingType finComRingType countIdomainType finComUnitRingType countFieldType finIdomainType countDecFieldType countClosedFieldType finFieldType countRingType countUnitRingType finRingType finUnitRingType finLalgType finUnitAlgType finZmodType finLmodType finGroupType eqType falgType fieldExtType splittingFieldType finAlgType algType comAlgType unitAlgType comUnitAlgType closedFieldType numClosedFieldType comRingType comUnitRingType idomainType fieldType numDomainType decFieldType numFieldType realFieldType realDomainType lalgType vectType unitRingType archiFieldType rcfType 5 / 14
choiceType countType zmodType porderType countZmodType finType lmodType ringType normedZmodType finPOrderType numDomainType latticeType countComRingType countComUnitRingType finComRingType countIdomainType finComUnitRingType countFieldType finIdomainType countDecFieldType countClosedFieldType finFieldType countRingType countUnitRingType finRingType finUnitRingType finLalgType finUnitAlgType finZmodType finLmodType finGroupType eqType falgType fieldExtType splittingFieldType finAlgType finLatticeType algType comAlgType unitAlgType comUnitAlgType closedFieldType numClosedFieldType comRingType comUnitRingType idomainType fieldType decFieldType numFieldType realFieldType realDomainType lalgType vectType unitRingType archiFieldType rcfType bDistrLatticeType cbDistrLatticeType tbDistrLatticeType ctbDistrLatticeType finDistrLatticeType bLatticeType tbLatticeType finCDistrLatticeType distrLatticeType
finOrderType 6 / 14
7 / 14
8 / 14
9 / 14
10 / 14
A hierarchy H is a finite set of structures partially ordered by a non-strict (reflexive) inheritance relation ∗. We denote the corresponding strict (irreflexive) inheritance relation by +. A ∗ B and A + B respectively mean that B non-strictly and strictly inherits from A.
The (non-strict) common subclasses of A, B ∈ H are C := {C ∈ H | A ∗ C ∧ B ∗ C}. The minimal common subclasses of A and B are mcs(A, B) := C \ {C ∈ H | ∃C′ ∈ C, C′ + C}.
A hierarchy H is said to be well-formed if the minimal common subclasses of any two structures are unique; that is, |mcs(A, B)| ≤ 1 for any A, B ∈ H.
11 / 14
An extended hierarchy ¯ H := H ˙ ∪ {⊤} is a hierarchy H extended with ⊤ which means a structure that strictly inherits from all the structures in H; thus, the inheritance relation is extended as follows: A ¯ ∗ ⊤ ⇐ ⇒ true, ⊤ ¯ ∗ B ⇐ ⇒ false (if B = ⊤), A ¯ ∗ B ⇐ ⇒ A ∗ B (if A = ⊤ and B = ⊤).
The join is a binary operator on an extended well-formed hierarchy ¯ H, defined as follows: join(A, B) =
(if A, B ∈ H and mcs(A, B) = {C}), ⊤ (otherwise).
12 / 14
For any structures A, B, and C in an extended well-formed hierarchy ¯ H, C non-strictly inherits from join(A, B) if and only if C non-strictly inherits from both A and B: join(A, B) ¯ ∗ C ⇐ ⇒ A ¯ ∗ C ∧ B ¯ ∗ C.
The join operator on an extended well-formed hierarchy is associative, commutative, and idempotent; that is, an extended well-formed hierarchy is a join-semilattice.
13 / 14
/* C is the set of all the common subclasses of A and B. */
/* There is no join of A and B. */
/* C is the join of A and B. */
/* The join of A and B is ambiguous. */
14 / 14