Equivalences involving ℕ #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
This file defines some additional constructive equivalences using encodable and the pairing
function on ℕ.
An equivalence between bool × ℕ and ℕ, by mapping (tt, x) to 2 * x + 1 and (ff, x) to
2 * x.
Equations
- equiv.bool_prod_nat_equiv_nat = {to_fun := function.uncurry nat.bit, inv_fun := nat.bodd_div2, left_inv := equiv.bool_prod_nat_equiv_nat._proof_1, right_inv := equiv.bool_prod_nat_equiv_nat._proof_2}
@[simp]
@[simp]
@[simp]
An equivalence between ℤ and ℕ, through ℤ ≃ ℕ ⊕ ℕ and ℕ ⊕ ℕ ≃ ℕ.
An equivalence between α × α and α, given that there is an equivalence between α and ℕ.
Equations
- e.prod_equiv_of_equiv_nat = ((e.prod_congr e).trans nat.mkpair_equiv).trans e.symm