1-- Finitely many open sets intersect in an open set2-- Part of Cumulus, the Grace17 mathematics library.3-- Copyright (c) 2026 Grant Passmore.4-- Released under the Apache License 2.0. See LICENSE in the repository root.5-- Authors: Grant Passmore67module Grace.Cumulus.Topology.FiniteIntersection8import Space9import Cardinal.ListSupport1011theorem IsTopology.list_intersection (X T : Set) (xs : List(T))12requires topology : IsTopology(X, T)13requires inhabited : Nonempty(listSupport{T}(xs))14shows ⋂(listSupport{T}(xs)) ∈ T15proof16induction xs17| List.nil =>18intro inhabited19exfalso20rw listSupport.nil at inhabited21obtain⟨x, hx⟩:= inhabited22exact empty.membership with x, hx23| List.cons(a, tail) using ih =>24intro inhabited25have element : a ∈ T byassumption26rw listSupport.cons27haveself : a ∈ {a} bysimp [singleton.membership]28have singletonInhabited : Nonempty({a}) :=⟨a, self⟩29havesplit : Nonempty(listSupport{T}(tail)) ∨¬Nonempty(listSupport{T}(tail)) bytauto30casessplitwith some | none31 . have inner := ih with some32have joined := familyIntersection.union2 with singletonInhabited, some33unfold insert34rw [joined, familyIntersection.singleton]35exact IsTopology.intersection2 with topology, element, inner36 . have empty : listSupport{T}(tail) =∅37by_contra different38apply none39exact Nonempty.of_ne_empty with different40unfold insert41 rwa [empty, union2.right_empty, familyIntersection.singleton]4243theorem IsTopology.finite_intersection (X T F : Set)44requires topology : IsTopology(X, T)45requires finite : Finite(F)46requires inside : F ⊆ T47requires inhabited : Nonempty(F)48shows ⋂(F) ∈ T49proof50obtain⟨xs, list, covers⟩:= Finite.list_cover with finite51have weakened := List.weaken with inside52have support := listSupport.subset with list53have equal : listSupport{F}(xs) = F54apply Subset.antisymmetric55 . exact support56 . exact covers57have carrier := listSupport.change_carrier with inside58rw carrier at equal59rw← equal60rw← equal at inhabited61exact IsTopology.list_intersection with topology, inhabited62