/-- For any `c : List ℕ` whose sum is at most `Fintype.card α`,
  we can find `o : List (List α)` whose members have no duplicate,
  whose lengths given by `c`, and which are pairwise disjoint -/
theorem List.exists_pw_disjoint_with_card {α : Type*} [Fintype α]
    {c : List ℕ} (hc : c.sum ≤ Fintype.card α) :
    ∃ o : List (List α),
      o.map length = c ∧ (∀ s ∈ o, s.Nodup) ∧ Pairwise List.Disjoint o := by
  let klift (n : ℕ) (hn : n < Fintype.card α) : Fin (Fintype.card α) :=
    (⟨n, hn⟩ : Fin (Fintype.card α))
  let klift' (l : List ℕ) (hl : ∀ a ∈ l, a < Fintype.card α) :
    List (Fin (Fintype.card α)) := List.pmap klift l hl
  have hc'_lt : ∀ l ∈ c.ranges, ∀ n ∈ l, n < Fintype.card α := by
    intro l hl n hn
    apply lt_of_lt_of_le _ hc
    rw [← mem_mem_ranges_iff_lt_sum]
    exact ⟨l, hl, hn⟩
  let l := (ranges c).pmap klift' hc'_lt
  have hl : ∀ (a : List ℕ) (ha : a ∈ c.ranges),
    (klift' a (hc'_lt a ha)).map Fin.valEmbedding = a := by
    intro a ha
    conv_rhs => rw [← List.map_id a]
    rw [List.map_pmap]
    simp only [Fin.valEmbedding_apply, Fin.val_mk, List.pmap_eq_map, List.map_id', List.map_id]
  use l.map (List.map (Fintype.equivFin α).symm)
  constructor
  · -- length
    rw [← ranges_length c]
    simp only [map_map, map_pmap, Function.comp_apply, length_map, length_pmap, pmap_eq_map]
  constructor
  · -- nodup
    intro s
    rw [mem_map]
    rintro ⟨t, ht, rfl⟩
    apply Nodup.map (Equiv.injective _)
    obtain ⟨u, hu, rfl⟩ := mem_pmap.mp ht
    apply Nodup.of_map
    

Proof state:
case h.right.left.intro.intro.intro.intro.a
α✝ : Type u_1
β : Type u_2
γ : Type u_3
α : Type u_4
inst✝ : Fintype α
c : List ℕ
hc : sum c ≤ Fintype.card α
klift : (n : ℕ) → n < Fintype.card α → Fin (Fintype.card α) := fun n hn => { val := n, isLt := hn }
klift' : (l : List ℕ) → (∀ a ∈ l, a < Fintype.card α) → List (Fin (Fintype.card α)) := fun l hl => pmap klift l hl
hc'_lt : ∀ l ∈ ranges c, ∀ n ∈ l, n < Fintype.card α
l : List (List (Fin (Fintype.card α))) := pmap klift' (ranges c) hc'_lt
hl : ∀ (a : List ℕ) (ha : a ∈ ranges c), map (⇑Fin.valEmbedding) (klift' a (_ : ∀ n ∈ a, n < Fintype.card α)) = a
u : List ℕ
hu : u ∈ ranges c
ht : klift' u (_ : ∀ n ∈ u, n < Fintype.card α) ∈ l
⊢ Nodup (map ?h.right.left.intro.intro.intro.intro.f (klift' u (_ : ∀ n ∈ u, n < Fintype.card α)))
case h.right.left.intro.intro.intro.intro.β
α✝ : Type u_1
β : Type u_2
γ : Type u_3
α : Type u_4
inst✝ : Fintype α
c : List ℕ
hc : sum c ≤ Fintype.card α
klift : (n : ℕ) → n < Fintype.card α → Fin (Fintype.card α) := fun n hn => { val := n, isLt := hn }
klift' : (l : List ℕ) → (∀ a ∈ l, a < Fintype.card α) → List (Fin (Fintype.card α)) := fun l hl => pmap klift l hl
hc'_lt : ∀ l ∈ ranges c, ∀ n ∈ l, n < Fintype.card α
l : List (List (Fin (Fintype.card α))) := pmap klift' (ranges c) hc'_lt
hl : ∀ (a : List ℕ) (ha : a ∈ ranges c), map (⇑Fin.valEmbedding) (klift' a (_ : ∀ n ∈ a, n < Fintype.card α)) = a
u : List ℕ
hu : u ∈ ranges c
ht : klift' u (_ : ∀ n ∈ u, n < Fintype.card α) ∈ l
⊢ Type ?u.104291
case h.right.left.intro.intro.intro.intro.f
α✝ : Type u_1
β : Type u_2
γ : Type u_3
α : Type u_4
inst✝ : Fintype α
c : List ℕ
hc : sum c ≤ Fintype.card α
klift : (n : ℕ) → n < Fintype.card α → Fin (Fintype.card α) := fun n hn => { val := n, isLt := hn }
klift' : (l : List ℕ) → (∀ a ∈ l, a < Fintype.card α) → List (Fin (Fintype.card α)) := fun l hl => pmap klift l hl
hc'_lt : ∀ l ∈ ranges c, ∀ n ∈ l, n < Fintype.card α
l : List (List (Fin (Fintype.card α))) := pmap klift' (ranges c) hc'_lt
hl : ∀ (a : List ℕ) (ha : a ∈ ranges c), map (⇑Fin.valEmbedding) (klift' a (_ : ∀ n ∈ a, n < Fintype.card α)) = a
u : List ℕ
hu : u ∈ ranges c
ht : klift' u (_ : ∀ n ∈ u, n < Fintype.card α) ∈ l
⊢ Fin (Fintype.card α) → ?h.right.left.intro.intro.intro.intro.β

Next tactic:
rw [hl u hu]