A Machine Proof System of Point Geometry Based on Coq
Abstract
:1. Introduction
2. The Formal Description of Definitions
2.1. Type and Proof
2.2. Basic Definition of Point Geometry and Its Formal Description
3. Formal Description and Proof of Geometric Propositions
3.1. Geometric Predicates
- Hypothesis: Point P is midpoint of segment .
- Hypothesis: Point N is the midpoint of segment .
- Hypothesis: Point M is the midpoint of segment .
- Hypothesis: and intersect at point G.
- Conclusion: Three points, A, B, and C, are collinear.
Example First_exam: ∀ A B C M N P G : Point,
A = O → Midpoint P A B → Midpoint N A C → Midpoint M B C → Xcollin
N B P C G → collin A G M.
3.2. Rules and Proof Mode
3.2.1. Rules
3.2.2. Proof Mode
- intros: Adds assumptions to the current context.
- apply H: Applies the hypothesis or rule H.
- rewrite: A tactic for replacement.
- unfold: Used to expand the definition.
- destruct: For discussion by the situation.
1 goal --------------------------------------------------------------------------- ∀ A B N C P G M : Point, A = O → Midpoint P A B → Midpoint N A C → Midpoint M B C → Xcollin N B P C G → collin A G M.
|
- A, B, N, C, P, G, M: Point
|
- A, B, N, C, P, G, M :
|
- H : A = O
|
Point
|
- H0: B = 2 * P
|
- H : A = O
|
- H1: C = 2 * N
|
- H0: Midpoint P A B
|
- H2: B + C = 2 * M
|
- H1: Midpoint N A C
|
- H3: ∀ u v r s: R, (u + v) = (r + s) → u * N
|
- H2: Midpoint M B C
|
+ v * B = r * P + s * C → (r + s) * G = r
|
- H3: Xcollin N B P C G
|
* P + s * C
|
--------------------------
|
-----------------------------------------------
|
collin A G M
|
∃ m, G = m * M
|
4. Proof Tactics
4.1. Oelim
4.1.1. Origin
4.1.2. Method of Eliminating the Origin
Algorithm 1Oelim | |
Input: Current proof state . | |
Output: Algebraic proof state | |
1: Expand the geometric predicate and introduce the hypothesis into the context. | |
2: if then | |
3: for do | ▹m is the number of hypotheses |
4: if then | ▹ Conclusion g is |
5: ; | |
6: Elim O with rules of O; return; | |
7: end if | |
8: end for | |
9: else | |
10: Elim O with rules of O; return; | |
11: end if |
4.2. Linear Point Geometry Decision Procedures Based on Real Numbers
Algorithm 2Psolver |
|
4.3. A Proof Method for a Hilbert Intersection Problem
4.3.1. Framework of HilbertX
Algorithm 3 Framework of HilbertX | |
Input: Current proof state and optional parameters a b c d. | |
Output: “Done” if the goal is proven, otherwise | |
1: ; | ▹ return information |
2: if type of then | |
3: Psolver ; | |
4: if then return “Done”; | |
5: else return; | |
6: end if | |
7: else | |
8: Hilxcol_K; | |
9: ; | |
10: if then return “Done”; | ▹ return information |
11: else return; | |
12: end if | |
13: end if |
4.3.2. Generation of Intersection Information Items
4.3.3. Step-by-Step Proof and Proof by Tactic
- parallelogram ABCD: .
- M is the midpoint of AB: .
- P is the intersection of AC and BD: .
- :
- Lemma Para_exam: ∀ A B C D M P : Point,
- A=O → Parall A B C D → Midpoint M A B → Xcollin A C M D P → Vec A C = 3 * Vec A P.
- Proof. HilbertX 2 1 2 1. Qed.
- ------------------------------------
- After unfolding predictions and eliminating the 0, we obtain the following hypotheses:
- H: A = O.
- H0: C = B + D.
- H1: B = 2 * M.
- H2: ∀ u v r s : R,
- u + v = r + s → u * O + v * C = r * M + s * D → (r + s ) * P = r * M + s * D.
- We begin to prove the goal: C = 3 * P.
- Firstly, we construct the equation Hx: 2 * O + 1 * C = 2 * M + 1 * D.
- By the rule of Xcollin, we obtain the equation of P: Hx: (2 + 1) * P = 2 * M + 1 * D.
- Finally, the proposition can be proven by the algebraic operations of points. Done.
5. Proof System
5.1. Structure of the System
5.2. Proof Method
- Theorem Morley:
- ∀ (A B C’ P Q R’ : Point) (a b r : R) (w u v : C),
- A = O → triangle0 A B C’ (3 * a) (3 * b) → triangle0 A B R’ a b → triangle0 A Q C’ a (PI - a - r) → triangle0 B C’ P b r → w = Cexp (0 +i (PI / 3) → u = Cexp (0 +i (- 2 * a) → v = Cexp (0 +i (- 2 * b) → r = (PI / 3 - a - b) → (CPmult w Q) - R’ = CPmult (w ^ 2) P.
- Proof.... Qed.
6. Conclusions
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Gao, X.S. An introduction to Wu’s method of mechanical geometry theorem proving. In Proceedings of the IFIP TC12/WG12. 3 International Workshop on Automated Reasoning, Beijing, China, 13–16 July 1992. [Google Scholar]
- Deepak, K.; Sun, Y.; Wang, D.K. An efficient method for computing comprehensive Grobner base. J. Symb. Comput. 2013, 52, 124–142. [Google Scholar]
- Mehne, H.H.; Mirjalili, S. A parallel numerical method for solving optimal control problems based on whale optimization algorithm. Knowl.-Based Syst. 2018, 151, 59–87. [Google Scholar] [CrossRef]
- Plotkin, B. Universal Algebra, Algebraic Logic, and Databases; Springer Science & Business Media: Berlin/Heidelberg, Germany, 2012. [Google Scholar]
- Shi, H. On the resultant formula for mechanical theorem proving. Math. Mech. Res. Prepr. 1989, 4, 77–86. [Google Scholar]
- Chou, S.C.B.; Gao, X.S.; Zhang, J.-Z. Automated generation of readable proofs with geometric invariants: II. theorem proving with full-angles. J. Autom. Reason. 1996, 17, 349–370. [Google Scholar] [CrossRef]
- Zhang, J. Outlines for point-geometry. Stud. Coll. Math. 2018, 21, 1–8. [Google Scholar]
- Zhang, J.; Peng, X.; Chen, M. Self-evident automated proving based on point geometry from the perspective of Wu’s method identity. J. Syst. Sci. Complex. 2019, 32, 78–94. [Google Scholar] [CrossRef]
- Fang, B.; Sighireanu, M.; Pu, G.G. Formal modelling of list based dynamic memory allocators. Sci. China Inf. Sci. 2018, 61, 122103. [Google Scholar] [CrossRef] [Green Version]
- Jiang, D.C.; Li, W. The verification of conversion algorithms between finite automata. Sci. China Inf. Sci. 2018, 61, 028101. [Google Scholar] [CrossRef] [Green Version]
- Liu, W.Y.; Bai, Y.J.; Jiao, L. Safety guarantee for time-delay systems with disturbances. Sci. China Inf. Sci. 2023, 66, 132102. [Google Scholar] [CrossRef]
- Rao, Y.; Xie, L.; Guan, H.; Li, J.; Zhou, Q. A Method for Expanding Predicates and Rules in Automated Geometry Reasoning System. Mathematics 2022, 10, 1177. [Google Scholar] [CrossRef]
- Castéran, P.; Bertot, Y. Interactive Theorem Proving and Program Development. coq’art: The Calculus of Inductive Constructions; Springer Science & Business Media: Berlin/Heidelberg, Germany, 2013. [Google Scholar]
- Chlipala, A. Certified Programming with Dependent Types: A Pragmatic Introduction to the Coq Proof Assistant; MIT Press: Cambridge, MA, USA, 2022. [Google Scholar]
- Nipkow, T.; Wenzel, M.; Paulson, L.C. Isabelle/HOL: A Proof Assistant for Higher-Order Logic; Springer: Berlin/Heidelberg, Germany, 2002. [Google Scholar]
- Harrison, J. Hol light: An overview. In Proceedings of the Theorem Proving in Higher Order Logics: 22nd International Conference, Munich, Germany, 17–20 August 2009. [Google Scholar]
- Wang, J.; Fu, M.; Qiao, L.; Feng, X. Formalizing sparcv8 instruction set architecture in coq. Sci. Comput. Program. 2020, 187, 102371. [Google Scholar] [CrossRef]
- Fervari, R.; Trucco, F.; Ziliani, B. Verification of dynamic bisimulation theorems in Coq. J. Log. Algebr. Methods Program. 2021, 120, 100642. [Google Scholar] [CrossRef]
- Tran, D.D.; Ogata, K. Formal verification of tls 1.2 by automatically generating proof scores. Comput. Secur. 2022, 123, 102900. [Google Scholar] [CrossRef]
- Barrière, A.; Blazy, S.; Pichardie, D. Formally Verified Native Code Generation in an Effectful JIT: Turning the CompCert Backend into a Formally Verified JIT Compiler. Proc. ACM Program. Lang. 2023, 7, 249–277. [Google Scholar] [CrossRef]
- Zúñiga, A.; Bel-Enguix, G. On Coevaluation Behavior and Equivalence. Mathematics 2022, 10, 3800. [Google Scholar] [CrossRef]
- Vladimir, V. An experimental library of formalized mathematics based on the univalent foundations. Math. Struct. Comput. Sci. 2015, 25, 1278–1294. [Google Scholar]
- Álvaro, P.; Vladimir, V.; Michael, A.W. A univalent formalization of the p-adic numbers. Math. Struct. Comput. Sci. 2015, 25, 1147–1171. [Google Scholar]
- Narboux, J.; Durand-Guerrier, V. Combining pencil/paper proofs and formal proofs, a challenge for Artificial Intelligence and mathematics education. In Mathematics Education in the Age of Artificial Intelligence: How Artificial Intelligence Can Serve Mathematical Human Learning; Richard, P.R., Vélez, M.P., Van, V.S., Eds.; Springer International Publishing: Cham, Switzerland, 2022; pp. 167–192. [Google Scholar]
- Boldo, S.; Clément, F.; Martin, V.; Mayero, M.; Mouhcine, H. A Coq Formalization of Lebesgue Induction Principle and Tonelli’s Theorem. In Proceedings of the 25th International Symposium on Formal Methods (FM 2023), Lübeck, Germany, 7–9 March 2023. [Google Scholar]
- Fu, Y.; Yu, W. Formalizing Calculus without Limit Theory in Coq. Mathematics 2021, 9, 1377. [Google Scholar] [CrossRef]
- Yan, S.; Yu, W. Formal Verification of a Topological Spatial Relations Model for Geographic Information Systems in Coq. Mathematics 2023, 11, 1079. [Google Scholar] [CrossRef]
- Boldo, S.; Clément, F.; Faissole, F.; Martin, V.; Mayero, M. A Coq formalization of Lebesgue integration of nonnegative functions. J. Autom. Reason. 2022, 66, 175–213. [Google Scholar] [CrossRef]
- Narboux, J. A decision procedure for geometry in coq. In Proceedings of the International Conference on Theorem Proving in Higher Order Logics, Park City, UT, USA, 14–17 September 2004; pp. 225–240. [Google Scholar]
- Beeson, M.; Narboux, J.; Wiedijk, F. TProof-checking euclid. Ann. Math. Artif. Intell. 2019, 85, 213–257. [Google Scholar] [CrossRef] [Green Version]
- Boutry, P.; Gries, C.; Narboux, J.; Schreck, P. Parallel postulates and continuity axioms: A mechanized study in intuitionistic logic using coq. J. Autom. Reason. 2019, 62, 1–68. [Google Scholar] [CrossRef] [Green Version]
- Boutry, P.; Braun, G.; Narboux, J. Formalization of the arithmetization of euclidean plane geometry and applications. J. Symb. Comput. 2019, 90, 149–168. [Google Scholar] [CrossRef] [Green Version]
- Quaresma, P.; Graziani, P. Measuring the Readability of Geometric Proofs: The Area Method Case. J. Autom. Reason. 2023, 67, 5. [Google Scholar] [CrossRef]
- Fritz, T. A generalization of Strassen’s Positivstellensatz. Commun. Algebra 2021, 49, 482–499. [Google Scholar] [CrossRef]
Geometry Propositions | Proof Mode Line Numbers | Tactic Line Numbers |
---|---|---|
First_exam | 7 | 1 |
Para_exam | 14 | 1 |
PointGeo | Content | Line Numbers | Outline |
---|---|---|---|
PF.v | Basic definition | 95 | 32 |
Pbasics.v | Properties | 304 | 67 |
Plemma.v | Rules | 273 | 61 |
Pconstruct.v | Predicates | 76 | 26 |
PTactic.v | Proof tactics | 316 | 41 |
Proj.v | Machine proof | 1783 | 188 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Lei, S.; Guan, H.; Jiang, J.; Zou, Y.; Rao, Y. A Machine Proof System of Point Geometry Based on Coq. Mathematics 2023, 11, 2757. https://doi.org/10.3390/math11122757
Lei S, Guan H, Jiang J, Zou Y, Rao Y. A Machine Proof System of Point Geometry Based on Coq. Mathematics. 2023; 11(12):2757. https://doi.org/10.3390/math11122757
Chicago/Turabian StyleLei, Siran, Hao Guan, Jianguo Jiang, Yu Zou, and Yongsheng Rao. 2023. "A Machine Proof System of Point Geometry Based on Coq" Mathematics 11, no. 12: 2757. https://doi.org/10.3390/math11122757
APA StyleLei, S., Guan, H., Jiang, J., Zou, Y., & Rao, Y. (2023). A Machine Proof System of Point Geometry Based on Coq. Mathematics, 11(12), 2757. https://doi.org/10.3390/math11122757