Theorem: Matroid.finite_setOf_matroid
File: Mathlib/Data/Matroid/Basic.lean

tactic: set f : Matroid α → Set α × (Set (Set α)) := fun M ↦ ⟨M.E, {B | M.Base B}⟩
state_before: α : Type u_1
M : Matroid α
E : Set α
hE : E.Finite
⊢ {M | M.E ⊆ E}.Finite
state_after: α : Type u_1
M : Matroid α
E : Set α
hE : E.Finite
f : Matroid α → Set α × Set (Set α) := fun M => (M.E, {B | M.Base B})
⊢ {M | M.E ⊆ E}.Finite

tactic: have hf : f.Injective := by
  refine fun M M' hMM' ↦ ?_
  rw [Prod.mk.injEq, and_comm, Set.ext_iff, and_comm] at hMM'
  exact eq_of_base_iff_base_forall hMM'.1 (fun B _ ↦ hMM'.2 B)
state_before: α : Type u_1
M : Matroid α
E : Set α
hE : E.Finite
f : Matroid α → Set α × Set (Set α) := fun M => (M.E, {B | M.Base B})
⊢ {M | M.E ⊆ E}.Finite
state_after: α : Type u_1
M : Matroid α
E : Set α
hE : E.Finite
f : Matroid α → Set α × Set (Set α) := fun M => (M.E, {B | M.Base B})
hf : Function.Injective f
⊢ {M | M.E ⊆ E}.Finite

tactic: rw [← Set.finite_image_iff hf.injOn]
state_before: α : Type u_1
M : Matroid α
E : Set α
hE : E.Finite
f : Matroid α → Set α × Set (Set α) := fun M => (M.E, {B | M.Base B})
hf : Function.Injective f
⊢ {M | M.E ⊆ E}.Finite
state_after: α : Type u_1
M : Matroid α
E : Set α
hE : E.Finite
f : Matroid α → Set α × Set (Set α) := fun M => (M.E, {B | M.Base B})
hf : Function.Injective f
⊢ (f '' {M | M.E ⊆ E}).Finite

tactic: refine (hE.finite_subsets.prod hE.finite_subsets.finite_subsets).subset ?_
state_before: α : Type u_1
M : Matroid α
E : Set α
hE : E.Finite
f : Matroid α → Set α × Set (Set α) := fun M => (M.E, {B | M.Base B})
hf : Function.Injective f
⊢ (f '' {M | M.E ⊆ E}).Finite
state_after: α : Type u_1
M : Matroid α
E : Set α
hE : E.Finite
f : Matroid α → Set α × Set (Set α) := fun M => (M.E, {B | M.Base B})
hf : Function.Injective f
⊢ f '' {M | M.E ⊆ E} ⊆ {b | b ⊆ E} ×ˢ {b | b ⊆ {b | b ⊆ E}}

tactic: rintro _ ⟨M, hE : M.E ⊆ E, rfl⟩
state_before: α : Type u_1
M : Matroid α
E : Set α
hE : E.Finite
f : Matroid α → Set α × Set (Set α) := fun M => (M.E, {B | M.Base B})
hf : Function.Injective f
⊢ f '' {M | M.E ⊆ E} ⊆ {b | b ⊆ E} ×ˢ {b | b ⊆ {b | b ⊆ E}}
state_after: case intro.intro
α : Type u_1
M✝ : Matroid α
E : Set α
hE✝ : E.Finite
f : Matroid α → Set α × Set (Set α) := fun M => (M.E, {B | M.Base B})
hf : Function.Injective f
M : Matroid α
hE : M.E ⊆ E
⊢ f M ∈ {b | b ⊆ E} ×ˢ {b | b ⊆ {b | b ⊆ E}}

tactic: simp only [Set.mem_prod, Set.mem_setOf_eq, Set.setOf_subset_setOf]
state_before: case intro.intro
α : Type u_1
M✝ : Matroid α
E : Set α
hE✝ : E.Finite
f : Matroid α → Set α × Set (Set α) := fun M => (M.E, {B | M.Base B})
hf : Function.Injective f
M : Matroid α
hE : M.E ⊆ E
⊢ f M ∈ {b | b ⊆ E} ×ˢ {b | b ⊆ {b | b ⊆ E}}
state_after: case intro.intro
α : Type u_1
M✝ : Matroid α
E : Set α
hE✝ : E.Finite
f : Matroid α → Set α × Set (Set α) := fun M => (M.E, {B | M.Base B})
hf : Function.Injective f
M : Matroid α
hE : M.E ⊆ E
⊢ M.E ⊆ E ∧ ∀ (a : Set α), M.Base a → a ⊆ E

tactic: exact ⟨hE, fun B hB ↦ hB.subset_ground.trans hE⟩
state_before: case intro.intro
α : Type u_1
M✝ : Matroid α
E : Set α
hE✝ : E.Finite
f : Matroid α → Set α × Set (Set α) := fun M => (M.E, {B | M.Base B})
hf : Function.Injective f
M : Matroid α
hE : M.E ⊆ E
⊢ M.E ⊆ E ∧ ∀ (a : Set α), M.Base a → a ⊆ E
state_after: no goals

tactic: refine fun M M' hMM' ↦ ?_
state_before: α : Type u_1
M : Matroid α
E : Set α
hE : E.Finite
f : Matroid α → Set α × Set (Set α) := fun M => (M.E, {B | M.Base B})
⊢ Function.Injective f
state_after: α : Type u_1
M✝ : Matroid α
E : Set α
hE : E.Finite
f : Matroid α → Set α × Set (Set α) := fun M => (M.E, {B | M.Base B})
M M' : Matroid α
hMM' : f M = f M'
⊢ M = M'

tactic: rw [Prod.mk.injEq, and_comm, Set.ext_iff, and_comm] at hMM'
state_before: α : Type u_1
M✝ : Matroid α
E : Set α
hE : E.Finite
f : Matroid α → Set α × Set (Set α) := fun M => (M.E, {B | M.Base B})
M M' : Matroid α
hMM' : f M = f M'
⊢ M = M'
state_after: α : Type u_1
M✝ : Matroid α
E : Set α
hE : E.Finite
f : Matroid α → Set α × Set (Set α) := fun M => (M.E, {B | M.Base B})
M M' : Matroid α
hMM' : M.E = M'.E ∧ ∀ (x : Set α), x ∈ {B | M.Base B} ↔ x ∈ {B | M'.Base B}
⊢ M = M'

tactic: exact eq_of_base_iff_base_forall hMM'.1 (fun B _ ↦ hMM'.2 B)
state_before: α : Type u_1
M✝ : Matroid α
E : Set α
hE : E.Finite
f : Matroid α → Set α × Set (Set α) := fun M => (M.E, {B | M.Base B})
M M' : Matroid α
hMM' : M.E = M'.E ∧ ∀ (x : Set α), x ∈ {B | M.Base B} ↔ x ∈ {B | M'.Base B}
⊢ M = M'
state_after: no goals