Abstract:We formalize Pick's theorem for finding the area of a simple polygon whose vertices are integral lattice points. We are inspired by John Harrison's formalization of Pick's theorem in HOL Light, but tailor our proof approach to avoid a primary challenge point in his formalization, which is proving that any polygon with more than three vertices can be split (in its interior) by a line between some two vertices. We detail the approach we use to avoid this step and reflect on the pros and cons of our eventual formalization strategy. We use the theorem prover Isabelle/HOL, and our formalization involves augmenting the existing geometry libraries in various foundational ways (e.g., by adding the definition of a polygon and formalizing some key properties thereof).
What problem does this paper attempt to address?
The problem that this paper attempts to solve is: to formalize Pick's Theorem in the Isabelle/HOL theorem prover, that is, how to calculate the area of a simple polygon whose vertices are integer lattice points. Specifically, Pick's Theorem provides a method to calculate the area of a polygon through the number of integer lattice points inside and on the boundary of the polygon.
### Problem Background
Pick's Theorem was first proved by George Pick in 1899. It describes the relationship between the area of a simple polygon (i.e., a polygon without self - intersections or holes) and the number of integer lattice points inside and on its boundary. The formula is as follows:
\[ A = I+\frac{B}{2}-1 \]
where:
- \( A \) is the area of the polygon.
- \( I \) is the number of integer lattice points inside the polygon.
- \( B \) is the number of integer lattice points on the boundary of the polygon.
### Main Challenges
During the process of formalizing Pick's Theorem, the main challenges faced by the authors include:
1. **Formalization of geometric arguments**: Informal geometric arguments usually rely on intuitive diagrammatic proofs, and formalizing these arguments requires dealing with abstract definitions, which are often far from geometric intuition.
2. **Dividing polygons**: Previous work (such as John Harrison's formalization in HOL Light) encountered a particularly difficult step, that is, proving that any polygon with more than three vertices can be divided into two smaller polygons by a line segment connecting two vertices. This process is very cumbersome and difficult to formalize.
### Solutions
To avoid the above challenges, the authors of this paper adopted the following strategies:
1. **Distinguish between convex and non - convex polygons**: For convex polygons, directly use their properties for division; for non - convex polygons, construct a path completely outside the polygon, thus avoiding the complexity of arbitrarily dividing non - convex polygons.
2. **Introduce new definitions and lemmas**: Expand the geometric library in Isabelle/HOL and add the definition of polygons and the formalization of some of their key properties.
3. **Utilize existing results**: Use the already formalized Jordan curve theorem and its variants, which help simplify the proof process.
### Formalization Methods
The authors use strong induction to prove by induction on the number of vertices of the polygon:
- **Base case**: For a triangle (i.e., a polygon with three vertices), directly verify that Pick's Theorem holds.
- **Inductive step**: For polygons with more vertices, they are divided into two cases according to whether they are convex polygons:
- **Convex polygons**: Find a suitable line segment to divide it into two smaller polygons and apply the inductive hypothesis.
- **Non - convex polygons**: Construct a path completely outside the polygon, divide the polygon into "pockets" and "filled polygons", and apply the inductive hypothesis.
### Conclusion
Through the above methods, the authors successfully formalized Pick's Theorem in Isabelle/HOL and provided new formalization techniques, especially for the treatment of non - convex polygons. Although they encountered challenges similar to previous work during the process, their methods provide a valuable reference for subsequent research.