data.pnat.intervalMathlib.Data.PNat.Interval

This file has been ported!

Changes since the initial port

The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

feat(data/*/interval): finset.uIcc on concrete structures (#18838)

Calculate the size of finset.uIcc in , , fin, prod, pi, multiset, finset...

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Diff
@@ -16,7 +16,7 @@ This file proves that `ℕ+` is a `locally_finite_order` and calculates the card
 intervals as finsets and fintypes.
 -/
 
-open finset pnat
+open finset function pnat
 
 instance : locally_finite_order ℕ+ := subtype.locally_finite_order _
 
@@ -27,19 +27,23 @@ lemma Icc_eq_finset_subtype : Icc a b = (Icc (a : ℕ) b).subtype (λ (n : ℕ),
 lemma Ico_eq_finset_subtype : Ico a b = (Ico (a : ℕ) b).subtype (λ (n : ℕ), 0 < n) := rfl
 lemma Ioc_eq_finset_subtype : Ioc a b = (Ioc (a : ℕ) b).subtype (λ (n : ℕ), 0 < n) := rfl
 lemma Ioo_eq_finset_subtype : Ioo a b = (Ioo (a : ℕ) b).subtype (λ (n : ℕ), 0 < n) := rfl
+lemma uIcc_eq_finset_subtype : uIcc a b = (uIcc (a : ℕ) b).subtype (λ (n : ℕ), 0 < n) := rfl
 
-lemma map_subtype_embedding_Icc : (Icc a b).map (function.embedding.subtype _) = Icc (a : ℕ) b :=
+lemma map_subtype_embedding_Icc : (Icc a b).map (embedding.subtype _) = Icc a b :=
 map_subtype_embedding_Icc _ _ _ (λ c _ x hx _ hc _, hc.trans_le hx)
 
-lemma map_subtype_embedding_Ico : (Ico a b).map (function.embedding.subtype _) = Ico (a : ℕ) b :=
+lemma map_subtype_embedding_Ico : (Ico a b).map (embedding.subtype _) = Ico a b :=
 map_subtype_embedding_Ico _ _ _ (λ c _ x hx _ hc _, hc.trans_le hx)
 
-lemma map_subtype_embedding_Ioc : (Ioc a b).map (function.embedding.subtype _) = Ioc (a : ℕ) b :=
+lemma map_subtype_embedding_Ioc : (Ioc a b).map (embedding.subtype _) = Ioc a b :=
 map_subtype_embedding_Ioc _ _ _ (λ c _ x hx _ hc _, hc.trans_le hx)
 
-lemma map_subtype_embedding_Ioo : (Ioo a b).map (function.embedding.subtype _) = Ioo (a : ℕ) b :=
+lemma map_subtype_embedding_Ioo : (Ioo a b).map (embedding.subtype _) = Ioo a b :=
 map_subtype_embedding_Ioo _ _ _ (λ c _ x hx _ hc _, hc.trans_le hx)
 
+lemma map_subtype_embedding_uIcc : (uIcc a b).map (embedding.subtype _) = uIcc a b :=
+map_subtype_embedding_Icc _ _
+
 @[simp] lemma card_Icc : (Icc a b).card = b + 1 - a :=
 by rw [←nat.card_Icc, ←map_subtype_embedding_Icc, card_map]
 
@@ -52,6 +56,9 @@ by rw [←nat.card_Ioc, ←map_subtype_embedding_Ioc, card_map]
 @[simp] lemma card_Ioo : (Ioo a b).card = b - a - 1 :=
 by rw [←nat.card_Ioo, ←map_subtype_embedding_Ioo, card_map]
 
+@[simp] lemma card_uIcc : (uIcc a b).card = (b - a : ℤ).nat_abs + 1 :=
+by rw [coe_coe, coe_coe, ←nat.card_uIcc, ←map_subtype_embedding_uIcc, card_map]
+
 @[simp] lemma card_fintype_Icc : fintype.card (set.Icc a b) = b + 1 - a :=
 by rw [←card_Icc, fintype.card_of_finset]
 
@@ -64,4 +71,7 @@ by rw [←card_Ioc, fintype.card_of_finset]
 @[simp] lemma card_fintype_Ioo : fintype.card (set.Ioo a b) = b - a - 1 :=
 by rw [←card_Ioo, fintype.card_of_finset]
 
+@[simp] lemma card_fintype_uIcc : fintype.card (set.uIcc a b) = (b - a : ℤ).nat_abs + 1 :=
+by rw [←card_uIcc, fintype.card_of_finset]
+
 end pnat

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(first ported)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
 -/
 import Data.Nat.Interval
-import Data.Pnat.Defs
+import Data.PNat.Defs
 
 #align_import data.pnat.interval from "leanprover-community/mathlib"@"1d29de43a5ba4662dd33b5cfeecfc2a27a5a8a29"
 
Diff
@@ -3,8 +3,8 @@ Copyright (c) 2021 Yaël Dillies. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
 -/
-import Mathbin.Data.Nat.Interval
-import Mathbin.Data.Pnat.Defs
+import Data.Nat.Interval
+import Data.Pnat.Defs
 
 #align_import data.pnat.interval from "leanprover-community/mathlib"@"1d29de43a5ba4662dd33b5cfeecfc2a27a5a8a29"
 
Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2021 Yaël Dillies. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
-
-! This file was ported from Lean 3 source module data.pnat.interval
-! leanprover-community/mathlib commit 1d29de43a5ba4662dd33b5cfeecfc2a27a5a8a29
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Data.Nat.Interval
 import Mathbin.Data.Pnat.Defs
 
+#align_import data.pnat.interval from "leanprover-community/mathlib"@"1d29de43a5ba4662dd33b5cfeecfc2a27a5a8a29"
+
 /-!
 # Finite intervals of positive naturals
 
Diff
@@ -55,9 +55,11 @@ theorem Ioo_eq_finset_subtype : Ioo a b = (Ioo (a : ℕ) b).Subtype fun n : ℕ
 #align pnat.Ioo_eq_finset_subtype PNat.Ioo_eq_finset_subtype
 -/
 
+#print PNat.uIcc_eq_finset_subtype /-
 theorem uIcc_eq_finset_subtype : uIcc a b = (uIcc (a : ℕ) b).Subtype fun n : ℕ => 0 < n :=
   rfl
 #align pnat.uIcc_eq_finset_subtype PNat.uIcc_eq_finset_subtype
+-/
 
 #print PNat.map_subtype_embedding_Icc /-
 theorem map_subtype_embedding_Icc : (Icc a b).map (Embedding.subtype _) = Icc a b :=
@@ -83,9 +85,11 @@ theorem map_subtype_embedding_Ioo : (Ioo a b).map (Embedding.subtype _) = Ioo a
 #align pnat.map_subtype_embedding_Ioo PNat.map_subtype_embedding_Ioo
 -/
 
+#print PNat.map_subtype_embedding_uIcc /-
 theorem map_subtype_embedding_uIcc : (uIcc a b).map (Embedding.subtype _) = uIcc a b :=
   map_subtype_embedding_Icc _ _
 #align pnat.map_subtype_embedding_uIcc PNat.map_subtype_embedding_uIcc
+-/
 
 #print PNat.card_Icc /-
 @[simp]
@@ -115,10 +119,12 @@ theorem card_Ioo : (Ioo a b).card = b - a - 1 := by
 #align pnat.card_Ioo PNat.card_Ioo
 -/
 
+#print PNat.card_uIcc /-
 @[simp]
 theorem card_uIcc : (uIcc a b).card = (b - a : ℤ).natAbs + 1 := by
   rw [coe_coe, coe_coe, ← Nat.card_uIcc, ← map_subtype_embedding_uIcc, card_map]
 #align pnat.card_uIcc PNat.card_uIcc
+-/
 
 #print PNat.card_fintype_Icc /-
 @[simp]
@@ -148,10 +154,12 @@ theorem card_fintype_Ioo : Fintype.card (Set.Ioo a b) = b - a - 1 := by
 #align pnat.card_fintype_Ioo PNat.card_fintype_Ioo
 -/
 
+#print PNat.card_fintype_uIcc /-
 @[simp]
-theorem card_fintypeUIcc : Fintype.card (Set.uIcc a b) = (b - a : ℤ).natAbs + 1 := by
+theorem card_fintype_uIcc : Fintype.card (Set.uIcc a b) = (b - a : ℤ).natAbs + 1 := by
   rw [← card_uIcc, Fintype.card_ofFinset]
-#align pnat.card_fintype_uIcc PNat.card_fintypeUIcc
+#align pnat.card_fintype_uIcc PNat.card_fintype_uIcc
+-/
 
 end PNat
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
 
 ! This file was ported from Lean 3 source module data.pnat.interval
-! leanprover-community/mathlib commit 68d1483e8a718ec63219f0e227ca3f0140361086
+! leanprover-community/mathlib commit 1d29de43a5ba4662dd33b5cfeecfc2a27a5a8a29
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -22,7 +22,7 @@ intervals as finsets and fintypes.
 -/
 
 
-open Finset PNat
+open Finset Function PNat
 
 instance : LocallyFiniteOrder ℕ+ :=
   Subtype.locallyFiniteOrder _
@@ -55,30 +55,38 @@ theorem Ioo_eq_finset_subtype : Ioo a b = (Ioo (a : ℕ) b).Subtype fun n : ℕ
 #align pnat.Ioo_eq_finset_subtype PNat.Ioo_eq_finset_subtype
 -/
 
+theorem uIcc_eq_finset_subtype : uIcc a b = (uIcc (a : ℕ) b).Subtype fun n : ℕ => 0 < n :=
+  rfl
+#align pnat.uIcc_eq_finset_subtype PNat.uIcc_eq_finset_subtype
+
 #print PNat.map_subtype_embedding_Icc /-
-theorem map_subtype_embedding_Icc : (Icc a b).map (Function.Embedding.subtype _) = Icc (a : ℕ) b :=
+theorem map_subtype_embedding_Icc : (Icc a b).map (Embedding.subtype _) = Icc a b :=
   map_subtype_embedding_Icc _ _ _ fun c _ x hx _ hc _ => hc.trans_le hx
 #align pnat.map_subtype_embedding_Icc PNat.map_subtype_embedding_Icc
 -/
 
 #print PNat.map_subtype_embedding_Ico /-
-theorem map_subtype_embedding_Ico : (Ico a b).map (Function.Embedding.subtype _) = Ico (a : ℕ) b :=
+theorem map_subtype_embedding_Ico : (Ico a b).map (Embedding.subtype _) = Ico a b :=
   map_subtype_embedding_Ico _ _ _ fun c _ x hx _ hc _ => hc.trans_le hx
 #align pnat.map_subtype_embedding_Ico PNat.map_subtype_embedding_Ico
 -/
 
 #print PNat.map_subtype_embedding_Ioc /-
-theorem map_subtype_embedding_Ioc : (Ioc a b).map (Function.Embedding.subtype _) = Ioc (a : ℕ) b :=
+theorem map_subtype_embedding_Ioc : (Ioc a b).map (Embedding.subtype _) = Ioc a b :=
   map_subtype_embedding_Ioc _ _ _ fun c _ x hx _ hc _ => hc.trans_le hx
 #align pnat.map_subtype_embedding_Ioc PNat.map_subtype_embedding_Ioc
 -/
 
 #print PNat.map_subtype_embedding_Ioo /-
-theorem map_subtype_embedding_Ioo : (Ioo a b).map (Function.Embedding.subtype _) = Ioo (a : ℕ) b :=
+theorem map_subtype_embedding_Ioo : (Ioo a b).map (Embedding.subtype _) = Ioo a b :=
   map_subtype_embedding_Ioo _ _ _ fun c _ x hx _ hc _ => hc.trans_le hx
 #align pnat.map_subtype_embedding_Ioo PNat.map_subtype_embedding_Ioo
 -/
 
+theorem map_subtype_embedding_uIcc : (uIcc a b).map (Embedding.subtype _) = uIcc a b :=
+  map_subtype_embedding_Icc _ _
+#align pnat.map_subtype_embedding_uIcc PNat.map_subtype_embedding_uIcc
+
 #print PNat.card_Icc /-
 @[simp]
 theorem card_Icc : (Icc a b).card = b + 1 - a := by
@@ -107,6 +115,11 @@ theorem card_Ioo : (Ioo a b).card = b - a - 1 := by
 #align pnat.card_Ioo PNat.card_Ioo
 -/
 
+@[simp]
+theorem card_uIcc : (uIcc a b).card = (b - a : ℤ).natAbs + 1 := by
+  rw [coe_coe, coe_coe, ← Nat.card_uIcc, ← map_subtype_embedding_uIcc, card_map]
+#align pnat.card_uIcc PNat.card_uIcc
+
 #print PNat.card_fintype_Icc /-
 @[simp]
 theorem card_fintype_Icc : Fintype.card (Set.Icc a b) = b + 1 - a := by
@@ -135,5 +148,10 @@ theorem card_fintype_Ioo : Fintype.card (Set.Ioo a b) = b - a - 1 := by
 #align pnat.card_fintype_Ioo PNat.card_fintype_Ioo
 -/
 
+@[simp]
+theorem card_fintypeUIcc : Fintype.card (Set.uIcc a b) = (b - a : ℤ).natAbs + 1 := by
+  rw [← card_uIcc, Fintype.card_ofFinset]
+#align pnat.card_fintype_uIcc PNat.card_fintypeUIcc
+
 end PNat
 
Diff
@@ -31,77 +31,109 @@ namespace PNat
 
 variable (a b : ℕ+)
 
+#print PNat.Icc_eq_finset_subtype /-
 theorem Icc_eq_finset_subtype : Icc a b = (Icc (a : ℕ) b).Subtype fun n : ℕ => 0 < n :=
   rfl
 #align pnat.Icc_eq_finset_subtype PNat.Icc_eq_finset_subtype
+-/
 
+#print PNat.Ico_eq_finset_subtype /-
 theorem Ico_eq_finset_subtype : Ico a b = (Ico (a : ℕ) b).Subtype fun n : ℕ => 0 < n :=
   rfl
 #align pnat.Ico_eq_finset_subtype PNat.Ico_eq_finset_subtype
+-/
 
+#print PNat.Ioc_eq_finset_subtype /-
 theorem Ioc_eq_finset_subtype : Ioc a b = (Ioc (a : ℕ) b).Subtype fun n : ℕ => 0 < n :=
   rfl
 #align pnat.Ioc_eq_finset_subtype PNat.Ioc_eq_finset_subtype
+-/
 
+#print PNat.Ioo_eq_finset_subtype /-
 theorem Ioo_eq_finset_subtype : Ioo a b = (Ioo (a : ℕ) b).Subtype fun n : ℕ => 0 < n :=
   rfl
 #align pnat.Ioo_eq_finset_subtype PNat.Ioo_eq_finset_subtype
+-/
 
+#print PNat.map_subtype_embedding_Icc /-
 theorem map_subtype_embedding_Icc : (Icc a b).map (Function.Embedding.subtype _) = Icc (a : ℕ) b :=
   map_subtype_embedding_Icc _ _ _ fun c _ x hx _ hc _ => hc.trans_le hx
 #align pnat.map_subtype_embedding_Icc PNat.map_subtype_embedding_Icc
+-/
 
+#print PNat.map_subtype_embedding_Ico /-
 theorem map_subtype_embedding_Ico : (Ico a b).map (Function.Embedding.subtype _) = Ico (a : ℕ) b :=
   map_subtype_embedding_Ico _ _ _ fun c _ x hx _ hc _ => hc.trans_le hx
 #align pnat.map_subtype_embedding_Ico PNat.map_subtype_embedding_Ico
+-/
 
+#print PNat.map_subtype_embedding_Ioc /-
 theorem map_subtype_embedding_Ioc : (Ioc a b).map (Function.Embedding.subtype _) = Ioc (a : ℕ) b :=
   map_subtype_embedding_Ioc _ _ _ fun c _ x hx _ hc _ => hc.trans_le hx
 #align pnat.map_subtype_embedding_Ioc PNat.map_subtype_embedding_Ioc
+-/
 
+#print PNat.map_subtype_embedding_Ioo /-
 theorem map_subtype_embedding_Ioo : (Ioo a b).map (Function.Embedding.subtype _) = Ioo (a : ℕ) b :=
   map_subtype_embedding_Ioo _ _ _ fun c _ x hx _ hc _ => hc.trans_le hx
 #align pnat.map_subtype_embedding_Ioo PNat.map_subtype_embedding_Ioo
+-/
 
+#print PNat.card_Icc /-
 @[simp]
 theorem card_Icc : (Icc a b).card = b + 1 - a := by
   rw [← Nat.card_Icc, ← map_subtype_embedding_Icc, card_map]
 #align pnat.card_Icc PNat.card_Icc
+-/
 
+#print PNat.card_Ico /-
 @[simp]
 theorem card_Ico : (Ico a b).card = b - a := by
   rw [← Nat.card_Ico, ← map_subtype_embedding_Ico, card_map]
 #align pnat.card_Ico PNat.card_Ico
+-/
 
+#print PNat.card_Ioc /-
 @[simp]
 theorem card_Ioc : (Ioc a b).card = b - a := by
   rw [← Nat.card_Ioc, ← map_subtype_embedding_Ioc, card_map]
 #align pnat.card_Ioc PNat.card_Ioc
+-/
 
+#print PNat.card_Ioo /-
 @[simp]
 theorem card_Ioo : (Ioo a b).card = b - a - 1 := by
   rw [← Nat.card_Ioo, ← map_subtype_embedding_Ioo, card_map]
 #align pnat.card_Ioo PNat.card_Ioo
+-/
 
+#print PNat.card_fintype_Icc /-
 @[simp]
 theorem card_fintype_Icc : Fintype.card (Set.Icc a b) = b + 1 - a := by
   rw [← card_Icc, Fintype.card_ofFinset]
 #align pnat.card_fintype_Icc PNat.card_fintype_Icc
+-/
 
+#print PNat.card_fintype_Ico /-
 @[simp]
 theorem card_fintype_Ico : Fintype.card (Set.Ico a b) = b - a := by
   rw [← card_Ico, Fintype.card_ofFinset]
 #align pnat.card_fintype_Ico PNat.card_fintype_Ico
+-/
 
+#print PNat.card_fintype_Ioc /-
 @[simp]
 theorem card_fintype_Ioc : Fintype.card (Set.Ioc a b) = b - a := by
   rw [← card_Ioc, Fintype.card_ofFinset]
 #align pnat.card_fintype_Ioc PNat.card_fintype_Ioc
+-/
 
+#print PNat.card_fintype_Ioo /-
 @[simp]
 theorem card_fintype_Ioo : Fintype.card (Set.Ioo a b) = b - a - 1 := by
   rw [← card_Ioo, Fintype.card_ofFinset]
 #align pnat.card_fintype_Ioo PNat.card_fintype_Ioo
+-/
 
 end PNat
 
Diff
@@ -31,169 +31,73 @@ namespace PNat
 
 variable (a b : ℕ+)
 
-/- warning: pnat.Icc_eq_finset_subtype -> PNat.Icc_eq_finset_subtype is a dubious translation:
-lean 3 declaration is
-  forall (a : PNat) (b : PNat), Eq.{1} (Finset.{0} PNat) (Finset.Icc.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (LinearOrder.toLattice.{0} PNat PNat.linearOrder)))) PNat.locallyFiniteOrder a b) (Finset.subtype.{0} Nat (fun (n : Nat) => LT.lt.{0} Nat Nat.hasLt (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) n) (fun (a : Nat) => Nat.decidableLt (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) a) (Finset.Icc.{0} Nat (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) Nat.locallyFiniteOrder ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) PNat Nat (HasLiftT.mk.{1, 1} PNat Nat (CoeTCₓ.coe.{1, 1} PNat Nat (coeBase.{1, 1} PNat Nat coePNatNat))) a) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) PNat Nat (HasLiftT.mk.{1, 1} PNat Nat (CoeTCₓ.coe.{1, 1} PNat Nat (coeBase.{1, 1} PNat Nat coePNatNat))) b)))
-but is expected to have type
-  forall (a : PNat) (b : PNat), Eq.{1} (Finset.{0} PNat) (Finset.Icc.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (DistribLattice.toLattice.{0} PNat (instDistribLattice.{0} PNat instPNatLinearOrder))))) instLocallyFiniteOrderPNatToPreorderToPartialOrderToSemilatticeInfToLatticeInstDistribLatticeInstPNatLinearOrder a b) (Finset.subtype.{0} Nat (fun (n : Nat) => LT.lt.{0} Nat instLTNat (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) n) (fun (a : Nat) => Nat.decLt (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) a) (Finset.Icc.{0} Nat (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) instLocallyFiniteOrderNatToPreorderToPartialOrderStrictOrderedSemiring (PNat.val a) (PNat.val b)))
-Case conversion may be inaccurate. Consider using '#align pnat.Icc_eq_finset_subtype PNat.Icc_eq_finset_subtypeₓ'. -/
 theorem Icc_eq_finset_subtype : Icc a b = (Icc (a : ℕ) b).Subtype fun n : ℕ => 0 < n :=
   rfl
 #align pnat.Icc_eq_finset_subtype PNat.Icc_eq_finset_subtype
 
-/- warning: pnat.Ico_eq_finset_subtype -> PNat.Ico_eq_finset_subtype is a dubious translation:
-lean 3 declaration is
-  forall (a : PNat) (b : PNat), Eq.{1} (Finset.{0} PNat) (Finset.Ico.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (LinearOrder.toLattice.{0} PNat PNat.linearOrder)))) PNat.locallyFiniteOrder a b) (Finset.subtype.{0} Nat (fun (n : Nat) => LT.lt.{0} Nat Nat.hasLt (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) n) (fun (a : Nat) => Nat.decidableLt (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) a) (Finset.Ico.{0} Nat (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) Nat.locallyFiniteOrder ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) PNat Nat (HasLiftT.mk.{1, 1} PNat Nat (CoeTCₓ.coe.{1, 1} PNat Nat (coeBase.{1, 1} PNat Nat coePNatNat))) a) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) PNat Nat (HasLiftT.mk.{1, 1} PNat Nat (CoeTCₓ.coe.{1, 1} PNat Nat (coeBase.{1, 1} PNat Nat coePNatNat))) b)))
-but is expected to have type
-  forall (a : PNat) (b : PNat), Eq.{1} (Finset.{0} PNat) (Finset.Ico.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (DistribLattice.toLattice.{0} PNat (instDistribLattice.{0} PNat instPNatLinearOrder))))) instLocallyFiniteOrderPNatToPreorderToPartialOrderToSemilatticeInfToLatticeInstDistribLatticeInstPNatLinearOrder a b) (Finset.subtype.{0} Nat (fun (n : Nat) => LT.lt.{0} Nat instLTNat (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) n) (fun (a : Nat) => Nat.decLt (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) a) (Finset.Ico.{0} Nat (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) instLocallyFiniteOrderNatToPreorderToPartialOrderStrictOrderedSemiring (PNat.val a) (PNat.val b)))
-Case conversion may be inaccurate. Consider using '#align pnat.Ico_eq_finset_subtype PNat.Ico_eq_finset_subtypeₓ'. -/
 theorem Ico_eq_finset_subtype : Ico a b = (Ico (a : ℕ) b).Subtype fun n : ℕ => 0 < n :=
   rfl
 #align pnat.Ico_eq_finset_subtype PNat.Ico_eq_finset_subtype
 
-/- warning: pnat.Ioc_eq_finset_subtype -> PNat.Ioc_eq_finset_subtype is a dubious translation:
-lean 3 declaration is
-  forall (a : PNat) (b : PNat), Eq.{1} (Finset.{0} PNat) (Finset.Ioc.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (LinearOrder.toLattice.{0} PNat PNat.linearOrder)))) PNat.locallyFiniteOrder a b) (Finset.subtype.{0} Nat (fun (n : Nat) => LT.lt.{0} Nat Nat.hasLt (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) n) (fun (a : Nat) => Nat.decidableLt (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) a) (Finset.Ioc.{0} Nat (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) Nat.locallyFiniteOrder ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) PNat Nat (HasLiftT.mk.{1, 1} PNat Nat (CoeTCₓ.coe.{1, 1} PNat Nat (coeBase.{1, 1} PNat Nat coePNatNat))) a) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) PNat Nat (HasLiftT.mk.{1, 1} PNat Nat (CoeTCₓ.coe.{1, 1} PNat Nat (coeBase.{1, 1} PNat Nat coePNatNat))) b)))
-but is expected to have type
-  forall (a : PNat) (b : PNat), Eq.{1} (Finset.{0} PNat) (Finset.Ioc.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (DistribLattice.toLattice.{0} PNat (instDistribLattice.{0} PNat instPNatLinearOrder))))) instLocallyFiniteOrderPNatToPreorderToPartialOrderToSemilatticeInfToLatticeInstDistribLatticeInstPNatLinearOrder a b) (Finset.subtype.{0} Nat (fun (n : Nat) => LT.lt.{0} Nat instLTNat (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) n) (fun (a : Nat) => Nat.decLt (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) a) (Finset.Ioc.{0} Nat (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) instLocallyFiniteOrderNatToPreorderToPartialOrderStrictOrderedSemiring (PNat.val a) (PNat.val b)))
-Case conversion may be inaccurate. Consider using '#align pnat.Ioc_eq_finset_subtype PNat.Ioc_eq_finset_subtypeₓ'. -/
 theorem Ioc_eq_finset_subtype : Ioc a b = (Ioc (a : ℕ) b).Subtype fun n : ℕ => 0 < n :=
   rfl
 #align pnat.Ioc_eq_finset_subtype PNat.Ioc_eq_finset_subtype
 
-/- warning: pnat.Ioo_eq_finset_subtype -> PNat.Ioo_eq_finset_subtype is a dubious translation:
-lean 3 declaration is
-  forall (a : PNat) (b : PNat), Eq.{1} (Finset.{0} PNat) (Finset.Ioo.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (LinearOrder.toLattice.{0} PNat PNat.linearOrder)))) PNat.locallyFiniteOrder a b) (Finset.subtype.{0} Nat (fun (n : Nat) => LT.lt.{0} Nat Nat.hasLt (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) n) (fun (a : Nat) => Nat.decidableLt (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) a) (Finset.Ioo.{0} Nat (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) Nat.locallyFiniteOrder ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) PNat Nat (HasLiftT.mk.{1, 1} PNat Nat (CoeTCₓ.coe.{1, 1} PNat Nat (coeBase.{1, 1} PNat Nat coePNatNat))) a) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) PNat Nat (HasLiftT.mk.{1, 1} PNat Nat (CoeTCₓ.coe.{1, 1} PNat Nat (coeBase.{1, 1} PNat Nat coePNatNat))) b)))
-but is expected to have type
-  forall (a : PNat) (b : PNat), Eq.{1} (Finset.{0} PNat) (Finset.Ioo.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (DistribLattice.toLattice.{0} PNat (instDistribLattice.{0} PNat instPNatLinearOrder))))) instLocallyFiniteOrderPNatToPreorderToPartialOrderToSemilatticeInfToLatticeInstDistribLatticeInstPNatLinearOrder a b) (Finset.subtype.{0} Nat (fun (n : Nat) => LT.lt.{0} Nat instLTNat (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) n) (fun (a : Nat) => Nat.decLt (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) a) (Finset.Ioo.{0} Nat (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) instLocallyFiniteOrderNatToPreorderToPartialOrderStrictOrderedSemiring (PNat.val a) (PNat.val b)))
-Case conversion may be inaccurate. Consider using '#align pnat.Ioo_eq_finset_subtype PNat.Ioo_eq_finset_subtypeₓ'. -/
 theorem Ioo_eq_finset_subtype : Ioo a b = (Ioo (a : ℕ) b).Subtype fun n : ℕ => 0 < n :=
   rfl
 #align pnat.Ioo_eq_finset_subtype PNat.Ioo_eq_finset_subtype
 
-/- warning: pnat.map_subtype_embedding_Icc -> PNat.map_subtype_embedding_Icc is a dubious translation:
-lean 3 declaration is
-  forall (a : PNat) (b : PNat), Eq.{1} (Finset.{0} Nat) (Finset.map.{0, 0} PNat Nat (Function.Embedding.subtype.{1} Nat (fun (n : Nat) => LT.lt.{0} Nat Nat.hasLt (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) n)) (Finset.Icc.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (LinearOrder.toLattice.{0} PNat PNat.linearOrder)))) PNat.locallyFiniteOrder a b)) (Finset.Icc.{0} Nat (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) Nat.locallyFiniteOrder ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) PNat Nat (HasLiftT.mk.{1, 1} PNat Nat (CoeTCₓ.coe.{1, 1} PNat Nat (coeBase.{1, 1} PNat Nat coePNatNat))) a) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) PNat Nat (HasLiftT.mk.{1, 1} PNat Nat (CoeTCₓ.coe.{1, 1} PNat Nat (coeBase.{1, 1} PNat Nat coePNatNat))) b))
-but is expected to have type
-  forall (a : PNat) (b : PNat), Eq.{1} (Finset.{0} Nat) (Finset.map.{0, 0} (Subtype.{1} Nat (fun (n : Nat) => LT.lt.{0} Nat instLTNat (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) n)) Nat (Function.Embedding.subtype.{1} Nat (fun (n : Nat) => LT.lt.{0} Nat instLTNat (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) n)) (Finset.Icc.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (DistribLattice.toLattice.{0} PNat (instDistribLattice.{0} PNat instPNatLinearOrder))))) instLocallyFiniteOrderPNatToPreorderToPartialOrderToSemilatticeInfToLatticeInstDistribLatticeInstPNatLinearOrder a b)) (Finset.Icc.{0} Nat (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) instLocallyFiniteOrderNatToPreorderToPartialOrderStrictOrderedSemiring (PNat.val a) (PNat.val b))
-Case conversion may be inaccurate. Consider using '#align pnat.map_subtype_embedding_Icc PNat.map_subtype_embedding_Iccₓ'. -/
 theorem map_subtype_embedding_Icc : (Icc a b).map (Function.Embedding.subtype _) = Icc (a : ℕ) b :=
   map_subtype_embedding_Icc _ _ _ fun c _ x hx _ hc _ => hc.trans_le hx
 #align pnat.map_subtype_embedding_Icc PNat.map_subtype_embedding_Icc
 
-/- warning: pnat.map_subtype_embedding_Ico -> PNat.map_subtype_embedding_Ico is a dubious translation:
-lean 3 declaration is
-  forall (a : PNat) (b : PNat), Eq.{1} (Finset.{0} Nat) (Finset.map.{0, 0} PNat Nat (Function.Embedding.subtype.{1} Nat (fun (n : Nat) => LT.lt.{0} Nat Nat.hasLt (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) n)) (Finset.Ico.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (LinearOrder.toLattice.{0} PNat PNat.linearOrder)))) PNat.locallyFiniteOrder a b)) (Finset.Ico.{0} Nat (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) Nat.locallyFiniteOrder ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) PNat Nat (HasLiftT.mk.{1, 1} PNat Nat (CoeTCₓ.coe.{1, 1} PNat Nat (coeBase.{1, 1} PNat Nat coePNatNat))) a) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) PNat Nat (HasLiftT.mk.{1, 1} PNat Nat (CoeTCₓ.coe.{1, 1} PNat Nat (coeBase.{1, 1} PNat Nat coePNatNat))) b))
-but is expected to have type
-  forall (a : PNat) (b : PNat), Eq.{1} (Finset.{0} Nat) (Finset.map.{0, 0} (Subtype.{1} Nat (fun (n : Nat) => LT.lt.{0} Nat instLTNat (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) n)) Nat (Function.Embedding.subtype.{1} Nat (fun (n : Nat) => LT.lt.{0} Nat instLTNat (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) n)) (Finset.Ico.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (DistribLattice.toLattice.{0} PNat (instDistribLattice.{0} PNat instPNatLinearOrder))))) instLocallyFiniteOrderPNatToPreorderToPartialOrderToSemilatticeInfToLatticeInstDistribLatticeInstPNatLinearOrder a b)) (Finset.Ico.{0} Nat (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) instLocallyFiniteOrderNatToPreorderToPartialOrderStrictOrderedSemiring (PNat.val a) (PNat.val b))
-Case conversion may be inaccurate. Consider using '#align pnat.map_subtype_embedding_Ico PNat.map_subtype_embedding_Icoₓ'. -/
 theorem map_subtype_embedding_Ico : (Ico a b).map (Function.Embedding.subtype _) = Ico (a : ℕ) b :=
   map_subtype_embedding_Ico _ _ _ fun c _ x hx _ hc _ => hc.trans_le hx
 #align pnat.map_subtype_embedding_Ico PNat.map_subtype_embedding_Ico
 
-/- warning: pnat.map_subtype_embedding_Ioc -> PNat.map_subtype_embedding_Ioc is a dubious translation:
-lean 3 declaration is
-  forall (a : PNat) (b : PNat), Eq.{1} (Finset.{0} Nat) (Finset.map.{0, 0} PNat Nat (Function.Embedding.subtype.{1} Nat (fun (n : Nat) => LT.lt.{0} Nat Nat.hasLt (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) n)) (Finset.Ioc.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (LinearOrder.toLattice.{0} PNat PNat.linearOrder)))) PNat.locallyFiniteOrder a b)) (Finset.Ioc.{0} Nat (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) Nat.locallyFiniteOrder ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) PNat Nat (HasLiftT.mk.{1, 1} PNat Nat (CoeTCₓ.coe.{1, 1} PNat Nat (coeBase.{1, 1} PNat Nat coePNatNat))) a) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) PNat Nat (HasLiftT.mk.{1, 1} PNat Nat (CoeTCₓ.coe.{1, 1} PNat Nat (coeBase.{1, 1} PNat Nat coePNatNat))) b))
-but is expected to have type
-  forall (a : PNat) (b : PNat), Eq.{1} (Finset.{0} Nat) (Finset.map.{0, 0} (Subtype.{1} Nat (fun (n : Nat) => LT.lt.{0} Nat instLTNat (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) n)) Nat (Function.Embedding.subtype.{1} Nat (fun (n : Nat) => LT.lt.{0} Nat instLTNat (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) n)) (Finset.Ioc.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (DistribLattice.toLattice.{0} PNat (instDistribLattice.{0} PNat instPNatLinearOrder))))) instLocallyFiniteOrderPNatToPreorderToPartialOrderToSemilatticeInfToLatticeInstDistribLatticeInstPNatLinearOrder a b)) (Finset.Ioc.{0} Nat (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) instLocallyFiniteOrderNatToPreorderToPartialOrderStrictOrderedSemiring (PNat.val a) (PNat.val b))
-Case conversion may be inaccurate. Consider using '#align pnat.map_subtype_embedding_Ioc PNat.map_subtype_embedding_Iocₓ'. -/
 theorem map_subtype_embedding_Ioc : (Ioc a b).map (Function.Embedding.subtype _) = Ioc (a : ℕ) b :=
   map_subtype_embedding_Ioc _ _ _ fun c _ x hx _ hc _ => hc.trans_le hx
 #align pnat.map_subtype_embedding_Ioc PNat.map_subtype_embedding_Ioc
 
-/- warning: pnat.map_subtype_embedding_Ioo -> PNat.map_subtype_embedding_Ioo is a dubious translation:
-lean 3 declaration is
-  forall (a : PNat) (b : PNat), Eq.{1} (Finset.{0} Nat) (Finset.map.{0, 0} PNat Nat (Function.Embedding.subtype.{1} Nat (fun (n : Nat) => LT.lt.{0} Nat Nat.hasLt (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) n)) (Finset.Ioo.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (LinearOrder.toLattice.{0} PNat PNat.linearOrder)))) PNat.locallyFiniteOrder a b)) (Finset.Ioo.{0} Nat (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) Nat.locallyFiniteOrder ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) PNat Nat (HasLiftT.mk.{1, 1} PNat Nat (CoeTCₓ.coe.{1, 1} PNat Nat (coeBase.{1, 1} PNat Nat coePNatNat))) a) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) PNat Nat (HasLiftT.mk.{1, 1} PNat Nat (CoeTCₓ.coe.{1, 1} PNat Nat (coeBase.{1, 1} PNat Nat coePNatNat))) b))
-but is expected to have type
-  forall (a : PNat) (b : PNat), Eq.{1} (Finset.{0} Nat) (Finset.map.{0, 0} (Subtype.{1} Nat (fun (n : Nat) => LT.lt.{0} Nat instLTNat (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) n)) Nat (Function.Embedding.subtype.{1} Nat (fun (n : Nat) => LT.lt.{0} Nat instLTNat (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) n)) (Finset.Ioo.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (DistribLattice.toLattice.{0} PNat (instDistribLattice.{0} PNat instPNatLinearOrder))))) instLocallyFiniteOrderPNatToPreorderToPartialOrderToSemilatticeInfToLatticeInstDistribLatticeInstPNatLinearOrder a b)) (Finset.Ioo.{0} Nat (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) instLocallyFiniteOrderNatToPreorderToPartialOrderStrictOrderedSemiring (PNat.val a) (PNat.val b))
-Case conversion may be inaccurate. Consider using '#align pnat.map_subtype_embedding_Ioo PNat.map_subtype_embedding_Iooₓ'. -/
 theorem map_subtype_embedding_Ioo : (Ioo a b).map (Function.Embedding.subtype _) = Ioo (a : ℕ) b :=
   map_subtype_embedding_Ioo _ _ _ fun c _ x hx _ hc _ => hc.trans_le hx
 #align pnat.map_subtype_embedding_Ioo PNat.map_subtype_embedding_Ioo
 
-/- warning: pnat.card_Icc -> PNat.card_Icc is a dubious translation:
-lean 3 declaration is
-  forall (a : PNat) (b : PNat), Eq.{1} Nat (Finset.card.{0} PNat (Finset.Icc.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (LinearOrder.toLattice.{0} PNat PNat.linearOrder)))) PNat.locallyFiniteOrder a b)) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat Nat.hasSub) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) PNat Nat (HasLiftT.mk.{1, 1} PNat Nat (CoeTCₓ.coe.{1, 1} PNat Nat (coeBase.{1, 1} PNat Nat coePNatNat))) b) (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne)))) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) PNat Nat (HasLiftT.mk.{1, 1} PNat Nat (CoeTCₓ.coe.{1, 1} PNat Nat (coeBase.{1, 1} PNat Nat coePNatNat))) a))
-but is expected to have type
-  forall (a : PNat) (b : PNat), Eq.{1} Nat (Finset.card.{0} PNat (Finset.Icc.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (DistribLattice.toLattice.{0} PNat (instDistribLattice.{0} PNat instPNatLinearOrder))))) instLocallyFiniteOrderPNatToPreorderToPartialOrderToSemilatticeInfToLatticeInstDistribLatticeInstPNatLinearOrder a b)) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat instSubNat) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) (PNat.val b) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) (PNat.val a))
-Case conversion may be inaccurate. Consider using '#align pnat.card_Icc PNat.card_Iccₓ'. -/
 @[simp]
 theorem card_Icc : (Icc a b).card = b + 1 - a := by
   rw [← Nat.card_Icc, ← map_subtype_embedding_Icc, card_map]
 #align pnat.card_Icc PNat.card_Icc
 
-/- warning: pnat.card_Ico -> PNat.card_Ico is a dubious translation:
-lean 3 declaration is
-  forall (a : PNat) (b : PNat), Eq.{1} Nat (Finset.card.{0} PNat (Finset.Ico.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (LinearOrder.toLattice.{0} PNat PNat.linearOrder)))) PNat.locallyFiniteOrder a b)) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat Nat.hasSub) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) PNat Nat (HasLiftT.mk.{1, 1} PNat Nat (CoeTCₓ.coe.{1, 1} PNat Nat (coeBase.{1, 1} PNat Nat coePNatNat))) b) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) PNat Nat (HasLiftT.mk.{1, 1} PNat Nat (CoeTCₓ.coe.{1, 1} PNat Nat (coeBase.{1, 1} PNat Nat coePNatNat))) a))
-but is expected to have type
-  forall (a : PNat) (b : PNat), Eq.{1} Nat (Finset.card.{0} PNat (Finset.Ico.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (DistribLattice.toLattice.{0} PNat (instDistribLattice.{0} PNat instPNatLinearOrder))))) instLocallyFiniteOrderPNatToPreorderToPartialOrderToSemilatticeInfToLatticeInstDistribLatticeInstPNatLinearOrder a b)) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat instSubNat) (PNat.val b) (PNat.val a))
-Case conversion may be inaccurate. Consider using '#align pnat.card_Ico PNat.card_Icoₓ'. -/
 @[simp]
 theorem card_Ico : (Ico a b).card = b - a := by
   rw [← Nat.card_Ico, ← map_subtype_embedding_Ico, card_map]
 #align pnat.card_Ico PNat.card_Ico
 
-/- warning: pnat.card_Ioc -> PNat.card_Ioc is a dubious translation:
-lean 3 declaration is
-  forall (a : PNat) (b : PNat), Eq.{1} Nat (Finset.card.{0} PNat (Finset.Ioc.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (LinearOrder.toLattice.{0} PNat PNat.linearOrder)))) PNat.locallyFiniteOrder a b)) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat Nat.hasSub) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) PNat Nat (HasLiftT.mk.{1, 1} PNat Nat (CoeTCₓ.coe.{1, 1} PNat Nat (coeBase.{1, 1} PNat Nat coePNatNat))) b) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) PNat Nat (HasLiftT.mk.{1, 1} PNat Nat (CoeTCₓ.coe.{1, 1} PNat Nat (coeBase.{1, 1} PNat Nat coePNatNat))) a))
-but is expected to have type
-  forall (a : PNat) (b : PNat), Eq.{1} Nat (Finset.card.{0} PNat (Finset.Ioc.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (DistribLattice.toLattice.{0} PNat (instDistribLattice.{0} PNat instPNatLinearOrder))))) instLocallyFiniteOrderPNatToPreorderToPartialOrderToSemilatticeInfToLatticeInstDistribLatticeInstPNatLinearOrder a b)) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat instSubNat) (PNat.val b) (PNat.val a))
-Case conversion may be inaccurate. Consider using '#align pnat.card_Ioc PNat.card_Iocₓ'. -/
 @[simp]
 theorem card_Ioc : (Ioc a b).card = b - a := by
   rw [← Nat.card_Ioc, ← map_subtype_embedding_Ioc, card_map]
 #align pnat.card_Ioc PNat.card_Ioc
 
-/- warning: pnat.card_Ioo -> PNat.card_Ioo is a dubious translation:
-lean 3 declaration is
-  forall (a : PNat) (b : PNat), Eq.{1} Nat (Finset.card.{0} PNat (Finset.Ioo.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (LinearOrder.toLattice.{0} PNat PNat.linearOrder)))) PNat.locallyFiniteOrder a b)) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat Nat.hasSub) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat Nat.hasSub) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) PNat Nat (HasLiftT.mk.{1, 1} PNat Nat (CoeTCₓ.coe.{1, 1} PNat Nat (coeBase.{1, 1} PNat Nat coePNatNat))) b) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) PNat Nat (HasLiftT.mk.{1, 1} PNat Nat (CoeTCₓ.coe.{1, 1} PNat Nat (coeBase.{1, 1} PNat Nat coePNatNat))) a)) (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))
-but is expected to have type
-  forall (a : PNat) (b : PNat), Eq.{1} Nat (Finset.card.{0} PNat (Finset.Ioo.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (DistribLattice.toLattice.{0} PNat (instDistribLattice.{0} PNat instPNatLinearOrder))))) instLocallyFiniteOrderPNatToPreorderToPartialOrderToSemilatticeInfToLatticeInstDistribLatticeInstPNatLinearOrder a b)) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat instSubNat) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat instSubNat) (PNat.val b) (PNat.val a)) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))
-Case conversion may be inaccurate. Consider using '#align pnat.card_Ioo PNat.card_Iooₓ'. -/
 @[simp]
 theorem card_Ioo : (Ioo a b).card = b - a - 1 := by
   rw [← Nat.card_Ioo, ← map_subtype_embedding_Ioo, card_map]
 #align pnat.card_Ioo PNat.card_Ioo
 
-/- warning: pnat.card_fintype_Icc -> PNat.card_fintype_Icc is a dubious translation:
-lean 3 declaration is
-  forall (a : PNat) (b : PNat), Eq.{1} Nat (Fintype.card.{0} (coeSort.{1, 2} (Set.{0} PNat) Type (Set.hasCoeToSort.{0} PNat) (Set.Icc.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (LinearOrder.toLattice.{0} PNat PNat.linearOrder)))) a b)) (Set.fintypeIcc.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (LinearOrder.toLattice.{0} PNat PNat.linearOrder)))) PNat.locallyFiniteOrder a b)) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat Nat.hasSub) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) PNat Nat (HasLiftT.mk.{1, 1} PNat Nat (CoeTCₓ.coe.{1, 1} PNat Nat (coeBase.{1, 1} PNat Nat coePNatNat))) b) (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne)))) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) PNat Nat (HasLiftT.mk.{1, 1} PNat Nat (CoeTCₓ.coe.{1, 1} PNat Nat (coeBase.{1, 1} PNat Nat coePNatNat))) a))
-but is expected to have type
-  forall (a : PNat) (b : PNat), Eq.{1} Nat (Fintype.card.{0} (Set.Elem.{0} PNat (Set.Icc.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (DistribLattice.toLattice.{0} PNat (instDistribLattice.{0} PNat instPNatLinearOrder))))) a b)) (Set.fintypeIcc.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (DistribLattice.toLattice.{0} PNat (instDistribLattice.{0} PNat instPNatLinearOrder))))) instLocallyFiniteOrderPNatToPreorderToPartialOrderToSemilatticeInfToLatticeInstDistribLatticeInstPNatLinearOrder a b)) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat instSubNat) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) (PNat.val b) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) (PNat.val a))
-Case conversion may be inaccurate. Consider using '#align pnat.card_fintype_Icc PNat.card_fintype_Iccₓ'. -/
 @[simp]
 theorem card_fintype_Icc : Fintype.card (Set.Icc a b) = b + 1 - a := by
   rw [← card_Icc, Fintype.card_ofFinset]
 #align pnat.card_fintype_Icc PNat.card_fintype_Icc
 
-/- warning: pnat.card_fintype_Ico -> PNat.card_fintype_Ico is a dubious translation:
-lean 3 declaration is
-  forall (a : PNat) (b : PNat), Eq.{1} Nat (Fintype.card.{0} (coeSort.{1, 2} (Set.{0} PNat) Type (Set.hasCoeToSort.{0} PNat) (Set.Ico.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (LinearOrder.toLattice.{0} PNat PNat.linearOrder)))) a b)) (Set.fintypeIco.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (LinearOrder.toLattice.{0} PNat PNat.linearOrder)))) PNat.locallyFiniteOrder a b)) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat Nat.hasSub) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) PNat Nat (HasLiftT.mk.{1, 1} PNat Nat (CoeTCₓ.coe.{1, 1} PNat Nat (coeBase.{1, 1} PNat Nat coePNatNat))) b) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) PNat Nat (HasLiftT.mk.{1, 1} PNat Nat (CoeTCₓ.coe.{1, 1} PNat Nat (coeBase.{1, 1} PNat Nat coePNatNat))) a))
-but is expected to have type
-  forall (a : PNat) (b : PNat), Eq.{1} Nat (Fintype.card.{0} (Set.Elem.{0} PNat (Set.Ico.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (DistribLattice.toLattice.{0} PNat (instDistribLattice.{0} PNat instPNatLinearOrder))))) a b)) (Set.fintypeIco.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (DistribLattice.toLattice.{0} PNat (instDistribLattice.{0} PNat instPNatLinearOrder))))) instLocallyFiniteOrderPNatToPreorderToPartialOrderToSemilatticeInfToLatticeInstDistribLatticeInstPNatLinearOrder a b)) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat instSubNat) (PNat.val b) (PNat.val a))
-Case conversion may be inaccurate. Consider using '#align pnat.card_fintype_Ico PNat.card_fintype_Icoₓ'. -/
 @[simp]
 theorem card_fintype_Ico : Fintype.card (Set.Ico a b) = b - a := by
   rw [← card_Ico, Fintype.card_ofFinset]
 #align pnat.card_fintype_Ico PNat.card_fintype_Ico
 
-/- warning: pnat.card_fintype_Ioc -> PNat.card_fintype_Ioc is a dubious translation:
-lean 3 declaration is
-  forall (a : PNat) (b : PNat), Eq.{1} Nat (Fintype.card.{0} (coeSort.{1, 2} (Set.{0} PNat) Type (Set.hasCoeToSort.{0} PNat) (Set.Ioc.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (LinearOrder.toLattice.{0} PNat PNat.linearOrder)))) a b)) (Set.fintypeIoc.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (LinearOrder.toLattice.{0} PNat PNat.linearOrder)))) PNat.locallyFiniteOrder a b)) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat Nat.hasSub) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) PNat Nat (HasLiftT.mk.{1, 1} PNat Nat (CoeTCₓ.coe.{1, 1} PNat Nat (coeBase.{1, 1} PNat Nat coePNatNat))) b) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) PNat Nat (HasLiftT.mk.{1, 1} PNat Nat (CoeTCₓ.coe.{1, 1} PNat Nat (coeBase.{1, 1} PNat Nat coePNatNat))) a))
-but is expected to have type
-  forall (a : PNat) (b : PNat), Eq.{1} Nat (Fintype.card.{0} (Set.Elem.{0} PNat (Set.Ioc.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (DistribLattice.toLattice.{0} PNat (instDistribLattice.{0} PNat instPNatLinearOrder))))) a b)) (Set.fintypeIoc.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (DistribLattice.toLattice.{0} PNat (instDistribLattice.{0} PNat instPNatLinearOrder))))) instLocallyFiniteOrderPNatToPreorderToPartialOrderToSemilatticeInfToLatticeInstDistribLatticeInstPNatLinearOrder a b)) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat instSubNat) (PNat.val b) (PNat.val a))
-Case conversion may be inaccurate. Consider using '#align pnat.card_fintype_Ioc PNat.card_fintype_Iocₓ'. -/
 @[simp]
 theorem card_fintype_Ioc : Fintype.card (Set.Ioc a b) = b - a := by
   rw [← card_Ioc, Fintype.card_ofFinset]
 #align pnat.card_fintype_Ioc PNat.card_fintype_Ioc
 
-/- warning: pnat.card_fintype_Ioo -> PNat.card_fintype_Ioo is a dubious translation:
-lean 3 declaration is
-  forall (a : PNat) (b : PNat), Eq.{1} Nat (Fintype.card.{0} (coeSort.{1, 2} (Set.{0} PNat) Type (Set.hasCoeToSort.{0} PNat) (Set.Ioo.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (LinearOrder.toLattice.{0} PNat PNat.linearOrder)))) a b)) (Set.fintypeIoo.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (LinearOrder.toLattice.{0} PNat PNat.linearOrder)))) PNat.locallyFiniteOrder a b)) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat Nat.hasSub) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat Nat.hasSub) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) PNat Nat (HasLiftT.mk.{1, 1} PNat Nat (CoeTCₓ.coe.{1, 1} PNat Nat (coeBase.{1, 1} PNat Nat coePNatNat))) b) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) PNat Nat (HasLiftT.mk.{1, 1} PNat Nat (CoeTCₓ.coe.{1, 1} PNat Nat (coeBase.{1, 1} PNat Nat coePNatNat))) a)) (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))
-but is expected to have type
-  forall (a : PNat) (b : PNat), Eq.{1} Nat (Fintype.card.{0} (Set.Elem.{0} PNat (Set.Ioo.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (DistribLattice.toLattice.{0} PNat (instDistribLattice.{0} PNat instPNatLinearOrder))))) a b)) (Set.fintypeIoo.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (DistribLattice.toLattice.{0} PNat (instDistribLattice.{0} PNat instPNatLinearOrder))))) instLocallyFiniteOrderPNatToPreorderToPartialOrderToSemilatticeInfToLatticeInstDistribLatticeInstPNatLinearOrder a b)) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat instSubNat) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat instSubNat) (PNat.val b) (PNat.val a)) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))
-Case conversion may be inaccurate. Consider using '#align pnat.card_fintype_Ioo PNat.card_fintype_Iooₓ'. -/
 @[simp]
 theorem card_fintype_Ioo : Fintype.card (Set.Ioo a b) = b - a - 1 := by
   rw [← card_Ioo, Fintype.card_ofFinset]
Diff
@@ -144,40 +144,60 @@ theorem card_Ioc : (Ioc a b).card = b - a := by
   rw [← Nat.card_Ioc, ← map_subtype_embedding_Ioc, card_map]
 #align pnat.card_Ioc PNat.card_Ioc
 
-#print PNat.card_Ioo /-
+/- warning: pnat.card_Ioo -> PNat.card_Ioo is a dubious translation:
+lean 3 declaration is
+  forall (a : PNat) (b : PNat), Eq.{1} Nat (Finset.card.{0} PNat (Finset.Ioo.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (LinearOrder.toLattice.{0} PNat PNat.linearOrder)))) PNat.locallyFiniteOrder a b)) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat Nat.hasSub) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat Nat.hasSub) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) PNat Nat (HasLiftT.mk.{1, 1} PNat Nat (CoeTCₓ.coe.{1, 1} PNat Nat (coeBase.{1, 1} PNat Nat coePNatNat))) b) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) PNat Nat (HasLiftT.mk.{1, 1} PNat Nat (CoeTCₓ.coe.{1, 1} PNat Nat (coeBase.{1, 1} PNat Nat coePNatNat))) a)) (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))
+but is expected to have type
+  forall (a : PNat) (b : PNat), Eq.{1} Nat (Finset.card.{0} PNat (Finset.Ioo.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (DistribLattice.toLattice.{0} PNat (instDistribLattice.{0} PNat instPNatLinearOrder))))) instLocallyFiniteOrderPNatToPreorderToPartialOrderToSemilatticeInfToLatticeInstDistribLatticeInstPNatLinearOrder a b)) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat instSubNat) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat instSubNat) (PNat.val b) (PNat.val a)) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))
+Case conversion may be inaccurate. Consider using '#align pnat.card_Ioo PNat.card_Iooₓ'. -/
 @[simp]
 theorem card_Ioo : (Ioo a b).card = b - a - 1 := by
   rw [← Nat.card_Ioo, ← map_subtype_embedding_Ioo, card_map]
 #align pnat.card_Ioo PNat.card_Ioo
--/
 
-#print PNat.card_fintype_Icc /-
+/- warning: pnat.card_fintype_Icc -> PNat.card_fintype_Icc is a dubious translation:
+lean 3 declaration is
+  forall (a : PNat) (b : PNat), Eq.{1} Nat (Fintype.card.{0} (coeSort.{1, 2} (Set.{0} PNat) Type (Set.hasCoeToSort.{0} PNat) (Set.Icc.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (LinearOrder.toLattice.{0} PNat PNat.linearOrder)))) a b)) (Set.fintypeIcc.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (LinearOrder.toLattice.{0} PNat PNat.linearOrder)))) PNat.locallyFiniteOrder a b)) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat Nat.hasSub) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) PNat Nat (HasLiftT.mk.{1, 1} PNat Nat (CoeTCₓ.coe.{1, 1} PNat Nat (coeBase.{1, 1} PNat Nat coePNatNat))) b) (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne)))) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) PNat Nat (HasLiftT.mk.{1, 1} PNat Nat (CoeTCₓ.coe.{1, 1} PNat Nat (coeBase.{1, 1} PNat Nat coePNatNat))) a))
+but is expected to have type
+  forall (a : PNat) (b : PNat), Eq.{1} Nat (Fintype.card.{0} (Set.Elem.{0} PNat (Set.Icc.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (DistribLattice.toLattice.{0} PNat (instDistribLattice.{0} PNat instPNatLinearOrder))))) a b)) (Set.fintypeIcc.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (DistribLattice.toLattice.{0} PNat (instDistribLattice.{0} PNat instPNatLinearOrder))))) instLocallyFiniteOrderPNatToPreorderToPartialOrderToSemilatticeInfToLatticeInstDistribLatticeInstPNatLinearOrder a b)) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat instSubNat) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) (PNat.val b) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) (PNat.val a))
+Case conversion may be inaccurate. Consider using '#align pnat.card_fintype_Icc PNat.card_fintype_Iccₓ'. -/
 @[simp]
 theorem card_fintype_Icc : Fintype.card (Set.Icc a b) = b + 1 - a := by
   rw [← card_Icc, Fintype.card_ofFinset]
 #align pnat.card_fintype_Icc PNat.card_fintype_Icc
--/
 
-#print PNat.card_fintype_Ico /-
+/- warning: pnat.card_fintype_Ico -> PNat.card_fintype_Ico is a dubious translation:
+lean 3 declaration is
+  forall (a : PNat) (b : PNat), Eq.{1} Nat (Fintype.card.{0} (coeSort.{1, 2} (Set.{0} PNat) Type (Set.hasCoeToSort.{0} PNat) (Set.Ico.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (LinearOrder.toLattice.{0} PNat PNat.linearOrder)))) a b)) (Set.fintypeIco.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (LinearOrder.toLattice.{0} PNat PNat.linearOrder)))) PNat.locallyFiniteOrder a b)) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat Nat.hasSub) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) PNat Nat (HasLiftT.mk.{1, 1} PNat Nat (CoeTCₓ.coe.{1, 1} PNat Nat (coeBase.{1, 1} PNat Nat coePNatNat))) b) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) PNat Nat (HasLiftT.mk.{1, 1} PNat Nat (CoeTCₓ.coe.{1, 1} PNat Nat (coeBase.{1, 1} PNat Nat coePNatNat))) a))
+but is expected to have type
+  forall (a : PNat) (b : PNat), Eq.{1} Nat (Fintype.card.{0} (Set.Elem.{0} PNat (Set.Ico.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (DistribLattice.toLattice.{0} PNat (instDistribLattice.{0} PNat instPNatLinearOrder))))) a b)) (Set.fintypeIco.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (DistribLattice.toLattice.{0} PNat (instDistribLattice.{0} PNat instPNatLinearOrder))))) instLocallyFiniteOrderPNatToPreorderToPartialOrderToSemilatticeInfToLatticeInstDistribLatticeInstPNatLinearOrder a b)) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat instSubNat) (PNat.val b) (PNat.val a))
+Case conversion may be inaccurate. Consider using '#align pnat.card_fintype_Ico PNat.card_fintype_Icoₓ'. -/
 @[simp]
 theorem card_fintype_Ico : Fintype.card (Set.Ico a b) = b - a := by
   rw [← card_Ico, Fintype.card_ofFinset]
 #align pnat.card_fintype_Ico PNat.card_fintype_Ico
--/
 
-#print PNat.card_fintype_Ioc /-
+/- warning: pnat.card_fintype_Ioc -> PNat.card_fintype_Ioc is a dubious translation:
+lean 3 declaration is
+  forall (a : PNat) (b : PNat), Eq.{1} Nat (Fintype.card.{0} (coeSort.{1, 2} (Set.{0} PNat) Type (Set.hasCoeToSort.{0} PNat) (Set.Ioc.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (LinearOrder.toLattice.{0} PNat PNat.linearOrder)))) a b)) (Set.fintypeIoc.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (LinearOrder.toLattice.{0} PNat PNat.linearOrder)))) PNat.locallyFiniteOrder a b)) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat Nat.hasSub) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) PNat Nat (HasLiftT.mk.{1, 1} PNat Nat (CoeTCₓ.coe.{1, 1} PNat Nat (coeBase.{1, 1} PNat Nat coePNatNat))) b) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) PNat Nat (HasLiftT.mk.{1, 1} PNat Nat (CoeTCₓ.coe.{1, 1} PNat Nat (coeBase.{1, 1} PNat Nat coePNatNat))) a))
+but is expected to have type
+  forall (a : PNat) (b : PNat), Eq.{1} Nat (Fintype.card.{0} (Set.Elem.{0} PNat (Set.Ioc.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (DistribLattice.toLattice.{0} PNat (instDistribLattice.{0} PNat instPNatLinearOrder))))) a b)) (Set.fintypeIoc.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (DistribLattice.toLattice.{0} PNat (instDistribLattice.{0} PNat instPNatLinearOrder))))) instLocallyFiniteOrderPNatToPreorderToPartialOrderToSemilatticeInfToLatticeInstDistribLatticeInstPNatLinearOrder a b)) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat instSubNat) (PNat.val b) (PNat.val a))
+Case conversion may be inaccurate. Consider using '#align pnat.card_fintype_Ioc PNat.card_fintype_Iocₓ'. -/
 @[simp]
 theorem card_fintype_Ioc : Fintype.card (Set.Ioc a b) = b - a := by
   rw [← card_Ioc, Fintype.card_ofFinset]
 #align pnat.card_fintype_Ioc PNat.card_fintype_Ioc
--/
 
-#print PNat.card_fintype_Ioo /-
+/- warning: pnat.card_fintype_Ioo -> PNat.card_fintype_Ioo is a dubious translation:
+lean 3 declaration is
+  forall (a : PNat) (b : PNat), Eq.{1} Nat (Fintype.card.{0} (coeSort.{1, 2} (Set.{0} PNat) Type (Set.hasCoeToSort.{0} PNat) (Set.Ioo.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (LinearOrder.toLattice.{0} PNat PNat.linearOrder)))) a b)) (Set.fintypeIoo.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (LinearOrder.toLattice.{0} PNat PNat.linearOrder)))) PNat.locallyFiniteOrder a b)) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat Nat.hasSub) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat Nat.hasSub) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) PNat Nat (HasLiftT.mk.{1, 1} PNat Nat (CoeTCₓ.coe.{1, 1} PNat Nat (coeBase.{1, 1} PNat Nat coePNatNat))) b) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) PNat Nat (HasLiftT.mk.{1, 1} PNat Nat (CoeTCₓ.coe.{1, 1} PNat Nat (coeBase.{1, 1} PNat Nat coePNatNat))) a)) (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))
+but is expected to have type
+  forall (a : PNat) (b : PNat), Eq.{1} Nat (Fintype.card.{0} (Set.Elem.{0} PNat (Set.Ioo.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (DistribLattice.toLattice.{0} PNat (instDistribLattice.{0} PNat instPNatLinearOrder))))) a b)) (Set.fintypeIoo.{0} PNat (PartialOrder.toPreorder.{0} PNat (SemilatticeInf.toPartialOrder.{0} PNat (Lattice.toSemilatticeInf.{0} PNat (DistribLattice.toLattice.{0} PNat (instDistribLattice.{0} PNat instPNatLinearOrder))))) instLocallyFiniteOrderPNatToPreorderToPartialOrderToSemilatticeInfToLatticeInstDistribLatticeInstPNatLinearOrder a b)) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat instSubNat) (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat instSubNat) (PNat.val b) (PNat.val a)) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))
+Case conversion may be inaccurate. Consider using '#align pnat.card_fintype_Ioo PNat.card_fintype_Iooₓ'. -/
 @[simp]
 theorem card_fintype_Ioo : Fintype.card (Set.Ioo a b) = b - a - 1 := by
   rw [← card_Ioo, Fintype.card_ofFinset]
 #align pnat.card_fintype_Ioo PNat.card_fintype_Ioo
--/
 
 end PNat
 

Changes in mathlib4

mathlib3
mathlib4
style: homogenise porting notes (#11145)

Homogenises porting notes via capitalisation and addition of whitespace.

It makes the following changes:

  • converts "--porting note" into "-- Porting note";
  • converts "porting note" into "Porting note".
Diff
@@ -66,7 +66,7 @@ theorem map_subtype_embedding_uIcc : (uIcc a b).map (Embedding.subtype _) = uIcc
 @[simp]
 theorem card_Icc : (Icc a b).card = b + 1 - a := by
   rw [← Nat.card_Icc]
-  -- porting note: I had to change this to `erw` *and* provide the proof, yuck.
+  -- Porting note: I had to change this to `erw` *and* provide the proof, yuck.
   -- https://github.com/leanprover-community/mathlib4/issues/5164
   erw [← Finset.map_subtype_embedding_Icc _ a b (fun c x _ hx _ hc _ => hc.trans_le hx)]
   rw [card_map]
@@ -75,7 +75,7 @@ theorem card_Icc : (Icc a b).card = b + 1 - a := by
 @[simp]
 theorem card_Ico : (Ico a b).card = b - a := by
   rw [← Nat.card_Ico]
-  -- porting note: I had to change this to `erw` *and* provide the proof, yuck.
+  -- Porting note: I had to change this to `erw` *and* provide the proof, yuck.
   -- https://github.com/leanprover-community/mathlib4/issues/5164
   erw [← Finset.map_subtype_embedding_Ico _ a b (fun c x _ hx _ hc _ => hc.trans_le hx)]
   rw [card_map]
@@ -84,7 +84,7 @@ theorem card_Ico : (Ico a b).card = b - a := by
 @[simp]
 theorem card_Ioc : (Ioc a b).card = b - a := by
   rw [← Nat.card_Ioc]
-  -- porting note: I had to change this to `erw` *and* provide the proof, yuck.
+  -- Porting note: I had to change this to `erw` *and* provide the proof, yuck.
   -- https://github.com/leanprover-community/mathlib4/issues/5164
   erw [← Finset.map_subtype_embedding_Ioc _ a b (fun c x _ hx _ hc _ => hc.trans_le hx)]
   rw [card_map]
@@ -93,7 +93,7 @@ theorem card_Ioc : (Ioc a b).card = b - a := by
 @[simp]
 theorem card_Ioo : (Ioo a b).card = b - a - 1 := by
   rw [← Nat.card_Ioo]
-  -- porting note: I had to change this to `erw` *and* provide the proof, yuck.
+  -- Porting note: I had to change this to `erw` *and* provide the proof, yuck.
   -- https://github.com/leanprover-community/mathlib4/issues/5164
   erw [← Finset.map_subtype_embedding_Ioo _ a b (fun c x _ hx _ hc _ => hc.trans_le hx)]
   rw [card_map]
@@ -104,27 +104,27 @@ theorem card_uIcc : (uIcc a b).card = (b - a : ℤ).natAbs + 1 := by
   rw [← Nat.card_uIcc, ← map_subtype_embedding_uIcc, card_map]
 #align pnat.card_uIcc PNat.card_uIcc
 
--- porting note: `simpNF` says `simp` can prove this
+-- Porting note: `simpNF` says `simp` can prove this
 theorem card_fintype_Icc : Fintype.card (Set.Icc a b) = b + 1 - a := by
   rw [← card_Icc, Fintype.card_ofFinset]
 #align pnat.card_fintype_Icc PNat.card_fintype_Icc
 
--- porting note: `simpNF` says `simp` can prove this
+-- Porting note: `simpNF` says `simp` can prove this
 theorem card_fintype_Ico : Fintype.card (Set.Ico a b) = b - a := by
   rw [← card_Ico, Fintype.card_ofFinset]
 #align pnat.card_fintype_Ico PNat.card_fintype_Ico
 
--- porting note: `simpNF` says `simp` can prove this
+-- Porting note: `simpNF` says `simp` can prove this
 theorem card_fintype_Ioc : Fintype.card (Set.Ioc a b) = b - a := by
   rw [← card_Ioc, Fintype.card_ofFinset]
 #align pnat.card_fintype_Ioc PNat.card_fintype_Ioc
 
--- porting note: `simpNF` says `simp` can prove this
+-- Porting note: `simpNF` says `simp` can prove this
 theorem card_fintype_Ioo : Fintype.card (Set.Ioo a b) = b - a - 1 := by
   rw [← card_Ioo, Fintype.card_ofFinset]
 #align pnat.card_fintype_Ioo PNat.card_fintype_Ioo
 
--- porting note: `simpNF` says `simp` can prove this
+-- Porting note: `simpNF` says `simp` can prove this
 theorem card_fintype_uIcc : Fintype.card (Set.uIcc a b) = (b - a : ℤ).natAbs + 1 := by
   rw [← card_uIcc, Fintype.card_ofFinset]
 #align pnat.card_fintype_uIcc PNat.card_fintype_uIcc
chore: Rename LocallyFiniteOrder instances (#11076)

The generated names were too long

Diff
@@ -18,13 +18,12 @@ intervals as finsets and fintypes.
 
 open Finset Function PNat
 
-instance : LocallyFiniteOrder ℕ+ :=
-  Subtype.instLocallyFiniteOrder _
-
 namespace PNat
 
 variable (a b : ℕ+)
 
+instance instLocallyFiniteOrder : LocallyFiniteOrder ℕ+ := Subtype.instLocallyFiniteOrder _
+
 theorem Icc_eq_finset_subtype : Icc a b = (Icc (a : ℕ) b).subtype fun n : ℕ => 0 < n :=
   rfl
 #align pnat.Icc_eq_finset_subtype PNat.Icc_eq_finset_subtype
chore: space after (#8178)

Co-authored-by: Moritz Firsching <firsching@google.com>

Diff
@@ -102,7 +102,7 @@ theorem card_Ioo : (Ioo a b).card = b - a - 1 := by
 
 @[simp]
 theorem card_uIcc : (uIcc a b).card = (b - a : ℤ).natAbs + 1 := by
-  rw [←Nat.card_uIcc, ←map_subtype_embedding_uIcc, card_map]
+  rw [← Nat.card_uIcc, ← map_subtype_embedding_uIcc, card_map]
 #align pnat.card_uIcc PNat.card_uIcc
 
 -- porting note: `simpNF` says `simp` can prove this
@@ -127,7 +127,7 @@ theorem card_fintype_Ioo : Fintype.card (Set.Ioo a b) = b - a - 1 := by
 
 -- porting note: `simpNF` says `simp` can prove this
 theorem card_fintype_uIcc : Fintype.card (Set.uIcc a b) = (b - a : ℤ).natAbs + 1 := by
-  rw [←card_uIcc, Fintype.card_ofFinset]
+  rw [← card_uIcc, Fintype.card_ofFinset]
 #align pnat.card_fintype_uIcc PNat.card_fintype_uIcc
 
 end PNat
feat: add instances for intervals (#5957)

Don't mind at all if anyone would like to push refactors or golfs. My main requirement from this PR is that

import Mathlib

example : WellFoundedLT { x : ℕ // x ≤ 37 }ᵒᵈ := inferInstance

works out of the box.

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Matthew Robert Ballard <matt@mrb.email> Co-authored-by: Xavier Roblot <46200072+xroblot@users.noreply.github.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Jz Pan <acme_pjz@hotmail.com> Co-authored-by: Thomas Browning <tb65536@uw.edu> Co-authored-by: Oliver Nash <github@olivernash.org> Co-authored-by: Christopher Hoskin <christopher.hoskin@gmail.com> Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com> Co-authored-by: Anatole Dedecker <anatolededecker@gmail.com> Co-authored-by: Matthew Robert Ballard <k.buzzard@imperial.ac.uk> Co-authored-by: Peter Nelson <71660771+apnelson1@users.noreply.github.com> Co-authored-by: Rémy Degenne <remydegenne@gmail.com> Co-authored-by: MohanadAhmed <m.a.m.elhassan@gmail.com> Co-authored-by: Mario Carneiro <di.gama@gmail.com> Co-authored-by: damiano <adomani@gmail.com> Co-authored-by: Chris Hughes <chrishughes24@gmail.com> Co-authored-by: Rémy Degenne <Remydegenne@gmail.com> Co-authored-by: Jon Eugster <eugster.jon@gmail.com> Co-authored-by: Kevin Buzzard <k.buzzard@imperial.ac.uk>

Diff
@@ -19,7 +19,7 @@ intervals as finsets and fintypes.
 open Finset Function PNat
 
 instance : LocallyFiniteOrder ℕ+ :=
-  instLocallyFiniteOrderSubtypePreorder _
+  Subtype.instLocallyFiniteOrder _
 
 namespace PNat
 
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2021 Yaël Dillies. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
-
-! This file was ported from Lean 3 source module data.pnat.interval
-! leanprover-community/mathlib commit 1d29de43a5ba4662dd33b5cfeecfc2a27a5a8a29
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Data.Nat.Interval
 import Mathlib.Data.PNat.Defs
 
+#align_import data.pnat.interval from "leanprover-community/mathlib"@"1d29de43a5ba4662dd33b5cfeecfc2a27a5a8a29"
+
 /-!
 # Finite intervals of positive naturals
 
chore: cleanup whitespace (#5988)

Grepping for [^ .:{-] [^ :] and reviewing the results. Once I started I couldn't stop. :-)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -82,7 +82,7 @@ theorem card_Ico : (Ico a b).card = b - a := by
   -- porting note: I had to change this to `erw` *and* provide the proof, yuck.
   -- https://github.com/leanprover-community/mathlib4/issues/5164
   erw [← Finset.map_subtype_embedding_Ico _ a b (fun c x _ hx _ hc _ => hc.trans_le hx)]
-  rw  [card_map]
+  rw [card_map]
 #align pnat.card_Ico PNat.card_Ico
 
 @[simp]
@@ -91,7 +91,7 @@ theorem card_Ioc : (Ioc a b).card = b - a := by
   -- porting note: I had to change this to `erw` *and* provide the proof, yuck.
   -- https://github.com/leanprover-community/mathlib4/issues/5164
   erw [← Finset.map_subtype_embedding_Ioc _ a b (fun c x _ hx _ hc _ => hc.trans_le hx)]
-  rw  [card_map]
+  rw [card_map]
 #align pnat.card_Ioc PNat.card_Ioc
 
 @[simp]
@@ -100,7 +100,7 @@ theorem card_Ioo : (Ioo a b).card = b - a - 1 := by
   -- porting note: I had to change this to `erw` *and* provide the proof, yuck.
   -- https://github.com/leanprover-community/mathlib4/issues/5164
   erw [← Finset.map_subtype_embedding_Ioo _ a b (fun c x _ hx _ hc _ => hc.trans_le hx)]
-  rw  [card_map]
+  rw [card_map]
 #align pnat.card_Ioo PNat.card_Ioo
 
 @[simp]
feat: finset.uIcc on concrete structures (#5946)

Match https://github.com/leanprover-community/mathlib/pull/18838

Co-authored-by: Scott Morrison <scott@tqft.net> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
 
 ! This file was ported from Lean 3 source module data.pnat.interval
-! leanprover-community/mathlib commit f7fc89d5d5ff1db2d1242c7bb0e9062ce47ef47c
+! leanprover-community/mathlib commit 1d29de43a5ba4662dd33b5cfeecfc2a27a5a8a29
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -19,7 +19,7 @@ intervals as finsets and fintypes.
 -/
 
 
-open Finset PNat
+open Finset Function PNat
 
 instance : LocallyFiniteOrder ℕ+ :=
   instLocallyFiniteOrderSubtypePreorder _
@@ -44,22 +44,29 @@ theorem Ioo_eq_finset_subtype : Ioo a b = (Ioo (a : ℕ) b).subtype fun n : ℕ
   rfl
 #align pnat.Ioo_eq_finset_subtype PNat.Ioo_eq_finset_subtype
 
-theorem map_subtype_embedding_Icc : (Icc a b).map (Function.Embedding.subtype _) = Icc (a : ℕ) b :=
+theorem uIcc_eq_finset_subtype : uIcc a b = (uIcc (a : ℕ) b).subtype fun n : ℕ => 0 < n := rfl
+#align pnat.uIcc_eq_finset_subtype PNat.uIcc_eq_finset_subtype
+
+theorem map_subtype_embedding_Icc : (Icc a b).map (Embedding.subtype _) = Icc ↑a ↑b :=
   Finset.map_subtype_embedding_Icc _ _ _ fun _c _ _x hx _ hc _ => hc.trans_le hx
 #align pnat.map_subtype_embedding_Icc PNat.map_subtype_embedding_Icc
 
-theorem map_subtype_embedding_Ico : (Ico a b).map (Function.Embedding.subtype _) = Ico (a : ℕ) b :=
+theorem map_subtype_embedding_Ico : (Ico a b).map (Embedding.subtype _) = Ico ↑a ↑b :=
   Finset.map_subtype_embedding_Ico _ _ _ fun _c _ _x hx _ hc _ => hc.trans_le hx
 #align pnat.map_subtype_embedding_Ico PNat.map_subtype_embedding_Ico
 
-theorem map_subtype_embedding_Ioc : (Ioc a b).map (Function.Embedding.subtype _) = Ioc (a : ℕ) b :=
+theorem map_subtype_embedding_Ioc : (Ioc a b).map (Embedding.subtype _) = Ioc ↑a ↑b :=
   Finset.map_subtype_embedding_Ioc _ _ _ fun _c _ _x hx _ hc _ => hc.trans_le hx
 #align pnat.map_subtype_embedding_Ioc PNat.map_subtype_embedding_Ioc
 
-theorem map_subtype_embedding_Ioo : (Ioo a b).map (Function.Embedding.subtype _) = Ioo (a : ℕ) b :=
+theorem map_subtype_embedding_Ioo : (Ioo a b).map (Embedding.subtype _) = Ioo ↑a ↑b :=
   Finset.map_subtype_embedding_Ioo _ _ _ fun _c _ _x hx _ hc _ => hc.trans_le hx
 #align pnat.map_subtype_embedding_Ioo PNat.map_subtype_embedding_Ioo
 
+theorem map_subtype_embedding_uIcc : (uIcc a b).map (Embedding.subtype _) = uIcc ↑a ↑b :=
+  map_subtype_embedding_Icc _ _
+#align pnat.map_subtype_embedding_uIcc PNat.map_subtype_embedding_uIcc
+
 @[simp]
 theorem card_Icc : (Icc a b).card = b + 1 - a := by
   rw [← Nat.card_Icc]
@@ -96,6 +103,11 @@ theorem card_Ioo : (Ioo a b).card = b - a - 1 := by
   rw  [card_map]
 #align pnat.card_Ioo PNat.card_Ioo
 
+@[simp]
+theorem card_uIcc : (uIcc a b).card = (b - a : ℤ).natAbs + 1 := by
+  rw [←Nat.card_uIcc, ←map_subtype_embedding_uIcc, card_map]
+#align pnat.card_uIcc PNat.card_uIcc
+
 -- porting note: `simpNF` says `simp` can prove this
 theorem card_fintype_Icc : Fintype.card (Set.Icc a b) = b + 1 - a := by
   rw [← card_Icc, Fintype.card_ofFinset]
@@ -116,4 +128,9 @@ theorem card_fintype_Ioo : Fintype.card (Set.Ioo a b) = b - a - 1 := by
   rw [← card_Ioo, Fintype.card_ofFinset]
 #align pnat.card_fintype_Ioo PNat.card_fintype_Ioo
 
+-- porting note: `simpNF` says `simp` can prove this
+theorem card_fintype_uIcc : Fintype.card (Set.uIcc a b) = (b - a : ℤ).natAbs + 1 := by
+  rw [←card_uIcc, Fintype.card_ofFinset]
+#align pnat.card_fintype_uIcc PNat.card_fintype_uIcc
+
 end PNat
chore: add links to issue for rw regressions (#5167)

Co-authored-by: Scott Morrison <scott.morrison@anu.edu.au>

Diff
@@ -63,32 +63,36 @@ theorem map_subtype_embedding_Ioo : (Ioo a b).map (Function.Embedding.subtype _)
 @[simp]
 theorem card_Icc : (Icc a b).card = b + 1 - a := by
   rw [← Nat.card_Icc]
-  erw [← Finset.map_subtype_embedding_Icc _ a b (fun c x _ hx _ hc _ => hc.trans_le hx)]
   -- porting note: I had to change this to `erw` *and* provide the proof, yuck.
+  -- https://github.com/leanprover-community/mathlib4/issues/5164
+  erw [← Finset.map_subtype_embedding_Icc _ a b (fun c x _ hx _ hc _ => hc.trans_le hx)]
   rw [card_map]
 #align pnat.card_Icc PNat.card_Icc
 
 @[simp]
 theorem card_Ico : (Ico a b).card = b - a := by
   rw [← Nat.card_Ico]
-  erw [← Finset.map_subtype_embedding_Ico _ a b (fun c x _ hx _ hc _ => hc.trans_le hx)]
   -- porting note: I had to change this to `erw` *and* provide the proof, yuck.
+  -- https://github.com/leanprover-community/mathlib4/issues/5164
+  erw [← Finset.map_subtype_embedding_Ico _ a b (fun c x _ hx _ hc _ => hc.trans_le hx)]
   rw  [card_map]
 #align pnat.card_Ico PNat.card_Ico
 
 @[simp]
 theorem card_Ioc : (Ioc a b).card = b - a := by
   rw [← Nat.card_Ioc]
-  erw [← Finset.map_subtype_embedding_Ioc _ a b (fun c x _ hx _ hc _ => hc.trans_le hx)]
   -- porting note: I had to change this to `erw` *and* provide the proof, yuck.
+  -- https://github.com/leanprover-community/mathlib4/issues/5164
+  erw [← Finset.map_subtype_embedding_Ioc _ a b (fun c x _ hx _ hc _ => hc.trans_le hx)]
   rw  [card_map]
 #align pnat.card_Ioc PNat.card_Ioc
 
 @[simp]
 theorem card_Ioo : (Ioo a b).card = b - a - 1 := by
   rw [← Nat.card_Ioo]
-  erw [← Finset.map_subtype_embedding_Ioo _ a b (fun c x _ hx _ hc _ => hc.trans_le hx)]
   -- porting note: I had to change this to `erw` *and* provide the proof, yuck.
+  -- https://github.com/leanprover-community/mathlib4/issues/5164
+  erw [← Finset.map_subtype_embedding_Ioo _ a b (fun c x _ hx _ hc _ => hc.trans_le hx)]
   rw  [card_map]
 #align pnat.card_Ioo PNat.card_Ioo
 
feat: port Data.PNat.Interval (#1894)

Dependencies 7 + 229

230 files ported (97.0%)
100711 lines ported (97.1%)
Show graph

The unported dependencies are