no goals
α : Type u_2
β : Type u_1
s t✝ : Finset α
f✝ : α → β
n : ℕ
t : Finset β
f : (a : α) → a ∈ s → β
hf : ∀ (a : α) (ha : a ∈ s), f a ha ∈ t
hinj : ∀ (a₁ a₂ : α) (ha₁ : a₁ ∈ s) (ha₂ : a₂ ∈ s), f a₁ ha₁ = f a₂ ha₂ → a₁ = a₂
hst : card t ≤ card s
⊢ ∀ (b : β), b ∈ t → ∃ a ha, b = f a ha
classical
  intro b hb
  have h : (s.attach.image fun a : { a // a ∈ s } => f a a.prop).card = s.card :=
    @card_attach _ s ▸
      card_image_of_injective _ fun ⟨a₁, ha₁⟩ ⟨a₂, ha₂⟩ h => Subtype.eq <| hinj _ _ _ _ h
  have h' : image (fun a : { a // a ∈ s } => f a a.prop) s.attach = t :=
    eq_of_subset_of_card_le
      (fun b h =>
        let ⟨a, _, ha₂⟩ := mem_image.1 h
        ha₂ ▸ hf _ _)
      (by simp [hst, h])
  rw [← h'] at hb
  obtain ⟨a, _, ha₂⟩ := mem_image.1 hb
  exact ⟨a, a.2, ha₂.symm⟩
α : Type u_2
β : Type u_1
s t✝ : Finset α
f✝ : α → β
n : ℕ
t : Finset β
f : (a : α) → a ∈ s → β
hf : ∀ (a : α) (ha : a ∈ s), f a ha ∈ t
hinj : ∀ (a₁ a₂ : α) (ha₁ : a₁ ∈ s) (ha₂ : a₂ ∈ s), f a₁ ha₁ = f a₂ ha₂ → a₁ = a₂
hst : card t ≤ card s
b : β
hb : b ∈ t
⊢ ∃ a ha, b = f a ha
α : Type u_2
β : Type u_1
s t✝ : Finset α
f✝ : α → β
n : ℕ
t : Finset β
f : (a : α) → a ∈ s → β
hf : ∀ (a : α) (ha : a ∈ s), f a ha ∈ t
hinj : ∀ (a₁ a₂ : α) (ha₁ : a₁ ∈ s) (ha₂ : a₂ ∈ s), f a₁ ha₁ = f a₂ ha₂ → a₁ = a₂
hst : card t ≤ card s
⊢ ∀ (b : β), b ∈ t → ∃ a ha, b = f a ha
intro b hb
α : Type u_2
β : Type u_1
s t✝ : Finset α
f✝ : α → β
n : ℕ
t : Finset β
f : (a : α) → a ∈ s → β
hf : ∀ (a : α) (ha : a ∈ s), f a ha ∈ t
hinj : ∀ (a₁ a₂ : α) (ha₁ : a₁ ∈ s) (ha₂ : a₂ ∈ s), f a₁ ha₁ = f a₂ ha₂ → a₁ = a₂
hst : card t ≤ card s
b : β
hb : b ∈ t
h : card (image (fun a => f ↑a (_ : ↑a ∈ s)) (attach s)) = card s
⊢ ∃ a ha, b = f a ha
α : Type u_2
β : Type u_1
s t✝ : Finset α
f✝ : α → β
n : ℕ
t : Finset β
f : (a : α) → a ∈ s → β
hf : ∀ (a : α) (ha : a ∈ s), f a ha ∈ t
hinj : ∀ (a₁ a₂ : α) (ha₁ : a₁ ∈ s) (ha₂ : a₂ ∈ s), f a₁ ha₁ = f a₂ ha₂ → a₁ = a₂
hst : card t ≤ card s
b : β
hb : b ∈ t
⊢ ∃ a ha, b = f a ha
have h : (s.attach.image fun a : { a // a ∈ s } => f a a.prop).card = s.card :=
  @card_attach _ s ▸
    card_image_of_injective _ fun ⟨a₁, ha₁⟩ ⟨a₂, ha₂⟩ h => Subtype.eq <| hinj _ _ _ _ h
α : Type u_2
β : Type u_1
s t✝ : Finset α
f✝ : α → β
n : ℕ
t : Finset β
f : (a : α) → a ∈ s → β
hf : ∀ (a : α) (ha : a ∈ s), f a ha ∈ t
hinj : ∀ (a₁ a₂ : α) (ha₁ : a₁ ∈ s) (ha₂ : a₂ ∈ s), f a₁ ha₁ = f a₂ ha₂ → a₁ = a₂
hst : card t ≤ card s
b : β
hb : b ∈ t
h : card (image (fun a => f ↑a (_ : ↑a ∈ s)) (attach s)) = card s
h' : image (fun a => f ↑a (_ : ↑a ∈ s)) (attach s) = t
⊢ ∃ a ha, b = f a ha
α : Type u_2
β : Type u_1
s t✝ : Finset α
f✝ : α → β
n : ℕ
t : Finset β
f : (a : α) → a ∈ s → β
hf : ∀ (a : α) (ha : a ∈ s), f a ha ∈ t
hinj : ∀ (a₁ a₂ : α) (ha₁ : a₁ ∈ s) (ha₂ : a₂ ∈ s), f a₁ ha₁ = f a₂ ha₂ → a₁ = a₂
hst : card t ≤ card s
b : β
hb : b ∈ t
h : card (image (fun a => f ↑a (_ : ↑a ∈ s)) (attach s)) = card s
⊢ ∃ a ha, b = f a ha
have h' : image (fun a : { a // a ∈ s } => f a a.prop) s.attach = t :=
  eq_of_subset_of_card_le
    (fun b h =>
      let ⟨a, _, ha₂⟩ := mem_image.1 h
      ha₂ ▸ hf _ _)
    (by simp [hst, h])
α : Type u_2
β : Type u_1
s t✝ : Finset α
f✝ : α → β
n : ℕ
t : Finset β
f : (a : α) → a ∈ s → β
hf : ∀ (a : α) (ha : a ∈ s), f a ha ∈ t
hinj : ∀ (a₁ a₂ : α) (ha₁ : a₁ ∈ s) (ha₂ : a₂ ∈ s), f a₁ ha₁ = f a₂ ha₂ → a₁ = a₂
hst : card t ≤ card s
b : β
hb : b ∈ image (fun a => f ↑a (_ : ↑a ∈ s)) (attach s)
h : card (image (fun a => f ↑a (_ : ↑a ∈ s)) (attach s)) = card s
h' : image (fun a => f ↑a (_ : ↑a ∈ s)) (attach s) = t
⊢ ∃ a ha, b = f a ha
α : Type u_2
β : Type u_1
s t✝ : Finset α
f✝ : α → β
n : ℕ
t : Finset β
f : (a : α) → a ∈ s → β
hf : ∀ (a : α) (ha : a ∈ s), f a ha ∈ t
hinj : ∀ (a₁ a₂ : α) (ha₁ : a₁ ∈ s) (ha₂ : a₂ ∈ s), f a₁ ha₁ = f a₂ ha₂ → a₁ = a₂
hst : card t ≤ card s
b : β
hb : b ∈ t
h : card (image (fun a => f ↑a (_ : ↑a ∈ s)) (attach s)) = card s
h' : image (fun a => f ↑a (_ : ↑a ∈ s)) (attach s) = t
⊢ ∃ a ha, b = f a ha
rw [← h'] at hb
case intro.intro
α : Type u_2
β : Type u_1
s t✝ : Finset α
f✝ : α → β
n : ℕ
t : Finset β
f : (a : α) → a ∈ s → β
hf : ∀ (a : α) (ha : a ∈ s), f a ha ∈ t
hinj : ∀ (a₁ a₂ : α) (ha₁ : a₁ ∈ s) (ha₂ : a₂ ∈ s), f a₁ ha₁ = f a₂ ha₂ → a₁ = a₂
hst : card t ≤ card s
b : β
hb : b ∈ image (fun a => f ↑a (_ : ↑a ∈ s)) (attach s)
h : card (image (fun a => f ↑a (_ : ↑a ∈ s)) (attach s)) = card s
h' : image (fun a => f ↑a (_ : ↑a ∈ s)) (attach s) = t
a : { a // a ∈ s }
left✝ : a ∈ attach s
ha₂ : f ↑a (_ : ↑a ∈ s) = b
⊢ ∃ a ha, b = f a ha
α : Type u_2
β : Type u_1
s t✝ : Finset α
f✝ : α → β
n : ℕ
t : Finset β
f : (a : α) → a ∈ s → β
hf : ∀ (a : α) (ha : a ∈ s), f a ha ∈ t
hinj : ∀ (a₁ a₂ : α) (ha₁ : a₁ ∈ s) (ha₂ : a₂ ∈ s), f a₁ ha₁ = f a₂ ha₂ → a₁ = a₂
hst : card t ≤ card s
b : β
hb : b ∈ image (fun a => f ↑a (_ : ↑a ∈ s)) (attach s)
h : card (image (fun a => f ↑a (_ : ↑a ∈ s)) (attach s)) = card s
h' : image (fun a => f ↑a (_ : ↑a ∈ s)) (attach s) = t
⊢ ∃ a ha, b = f a ha
obtain ⟨a, _, ha₂⟩ := mem_image.1 hb
no goals
case intro.intro
α : Type u_2
β : Type u_1
s t✝ : Finset α
f✝ : α → β
n : ℕ
t : Finset β
f : (a : α) → a ∈ s → β
hf : ∀ (a : α) (ha : a ∈ s), f a ha ∈ t
hinj : ∀ (a₁ a₂ : α) (ha₁ : a₁ ∈ s) (ha₂ : a₂ ∈ s), f a₁ ha₁ = f a₂ ha₂ → a₁ = a₂
hst : card t ≤ card s
b : β
hb : b ∈ image (fun a => f ↑a (_ : ↑a ∈ s)) (attach s)
h : card (image (fun a => f ↑a (_ : ↑a ∈ s)) (attach s)) = card s
h' : image (fun a => f ↑a (_ : ↑a ∈ s)) (attach s) = t
a : { a // a ∈ s }
left✝ : a ∈ attach s
ha₂ : f ↑a (_ : ↑a ∈ s) = b
⊢ ∃ a ha, b = f a ha
exact ⟨a, a.2, ha₂.symm⟩
no goals
α : Type u_2
β : Type u_1
s t✝ : Finset α
f✝ : α → β
n : ℕ
t : Finset β
f : (a : α) → a ∈ s → β
hf : ∀ (a : α) (ha : a ∈ s), f a ha ∈ t
hinj : ∀ (a₁ a₂ : α) (ha₁ : a₁ ∈ s) (ha₂ : a₂ ∈ s), f a₁ ha₁ = f a₂ ha₂ → a₁ = a₂
hst : card t ≤ card s
b : β
hb : b ∈ t
h : card (image (fun a => f ↑a (_ : ↑a ∈ s)) (attach s)) = card s
⊢ card t ≤ card (image (fun a => f ↑a (_ : ↑a ∈ s)) (attach s))
simp [hst, h]