Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(data/rat/denumerable): computable denumerability of Q (#1104)
* feat(data/rat/denumerable): computable denumerability of Q * blah * fix build * remove unnecessary decidable_eq * add header * delete rat.lean and update imports * fix build * prove exists_not_mem_finset * massively speed up encode * minor change
- Loading branch information
1 parent
5040c81
commit 3ad3522
Showing
12 changed files
with
224 additions
and
8 deletions.
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
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
File renamed without changes.
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,30 @@ | ||
/- | ||
Copyright (c) 2019 Chris Hughes. All rights reserved. | ||
Released under Apache 2.0 license as described in the file LICENSE. | ||
Author: Chris Hughes | ||
-/ | ||
|
||
import data.rat.basic data.equiv.denumerable | ||
|
||
namespace rat | ||
open denumerable | ||
|
||
instance : infinite ℚ := | ||
infinite.of_injective (coe : ℕ → ℚ) nat.cast_injective | ||
|
||
private def denumerable_aux : ℚ ≃ { x : ℤ × ℕ // 0 < x.2 ∧ x.1.nat_abs.coprime x.2 } := | ||
{ to_fun := λ x, ⟨⟨x.1, x.2⟩, x.3, x.4⟩, | ||
inv_fun := λ x, ⟨x.1.1, x.1.2, x.2.1, x.2.2⟩, | ||
left_inv := λ ⟨_, _, _, _⟩, rfl, | ||
right_inv := λ ⟨⟨_, _⟩, _, _⟩, rfl } | ||
|
||
instance : denumerable ℚ := | ||
begin | ||
let T := { x : ℤ × ℕ // 0 < x.2 ∧ x.1.nat_abs.coprime x.2 }, | ||
letI : infinite T := infinite.of_injective _ denumerable_aux.injective, | ||
letI : encodable T := encodable.subtype, | ||
letI : denumerable T := of_encodable_of_infinite T, | ||
exact denumerable.of_equiv T denumerable_aux | ||
end | ||
|
||
end rat |
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