I'm attempting to formalize a series of proofs about topology from a book [1] in Isabelle.
I want to encode the idea that a topological space (X,T) consists of a set X of "points" (elements of some arbitrary type 'a), and a set of subsets of X, called T, such that:
- A1. if an element p is in X, then there exists at least one set N in T that also contains p.
- A2. if sets U and V are in T, and if p∈(U∩V), then there must exist at a set N in T where N⊆(U∩V) and x∈N. (If two sets intersect, then there must be a neighborhood that covers the intersection.).
Currently I have the following definition:
class topspace =
fixes X :: "'a set"
fixes T :: "('a set) set"
assumes A1: "p∈X ≡ ∃N∈T. p∈N"
assumes A2: "U∈T ∧ V∈T ∧ x∈(U∩V) ⟹ ∃N∈T. x∈N ∧ N⊆(U∩V)"
begin
(* ... *)
end
So far, so good. I'm able to add various definitions and prove various lemmas and theorems about hypothetical topspace
instances.
But how do I actually create one? Unless I'm misinterpreting things, the examples I've seen so far for the instance
and instantiate
keywords all seem to be been about declaring that one particular abstract class (or type or locale) is an instance of another.
How do I tell Isabelle that a particular pair of sets (e.g. X={1::int, 2, 3}
, T={X,{}}
) form a topspace
?
Likewise, how can I use my definition to prove that X={1::int, 2, 3}, T={}
does not fit the requirements?
Finally, once I show that a particular concrete object X meets the definition of a topspace
, how do I tell Isabelle to now make use of all the definitions and theorems I've proven about topspace
when proving things about X?
BTW, I'm using class
because I don't know any better. If it's not the right tool for the job, I'm happy to do something else.
[1]: A Bridge to Advanced Mathematics by Dennis Sentilles