-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prove that Kuratowski finite decidable sets are finite
- Loading branch information
Showing
4 changed files
with
111 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
\import Data.Array | ||
\import Function | ||
\import Function.Meta ($) | ||
\import Logic | ||
\import Logic.Meta | ||
\import Paths | ||
\import Set | ||
\import Set.Fin | ||
|
||
\class KFinSet (n : Nat) \extends BaseSet | ||
| finSurj : ∃ (f : Fin n -> E) (isSurj f) | ||
\where { | ||
\lemma fromArray {A : \Set} (l : Array A) (p : \Pi (a : A) -> ∃ (i : Fin l.len) (l i = a)) : KFinSet A l.len \cowith | ||
| finSurj => inP (l,p) | ||
|
||
\lemma toArray (A : KFinSet) : ∃ (l : Array A) (\Pi (a : A) -> ∃ (i : Fin l.len) (l i = a)) | ||
=> TruncP.map A.finSurj $ \lam (f,p) => (f,p) | ||
|
||
\lemma KFin+Dec=>Fin (A : KFinSet) {d : DecSet A} : FinSet A | ||
=> \case toArray A \with { | ||
| inP (l,q) => | ||
\let l' => nub l | ||
\in FinSet.fromArray l' (\lam a => TruncP.map (q a) $ \lam p => | ||
\let t => nub-isSruj l p.1 | ||
\in (t.1, t.2 *> p.2)) (nub-isInj l) | ||
} | ||
} |