Theorem: Matroid.rFin.skewFamily_iff_sum_er_eq_er_iUnion (Matroid/Modular.lean)

State before:
ι : Type u_1
α : Type u_2
M : Matroid α
B I J X X' Y Y' F : Set α
Xs Ys Js Is : ι → Set α
i j : ι
e f : α
inst✝ : Fintype ι
hXs : ∀ (i : ι), M.rFin (Xs i)
hXE : ∀ (i : ι), Xs i ⊆ M.E
⊢ M.SkewFamily Xs ↔ ∑ i : ι, M.er (Xs i) = M.er (⋃ i, Xs i)
Tactic:
refine ⟨SkewFamily.sum_er_eq_er_iUnion, fun hsum ↦ ?_⟩
State after:
ι : Type u_1
α : Type u_2
M : Matroid α
B I J X X' Y Y' F : Set α
Xs Ys Js Is : ι → Set α
i j : ι
e f : α
inst✝ : Fintype ι
hXs : ∀ (i : ι), M.rFin (Xs i)
hXE : ∀ (i : ι), Xs i ⊆ M.E
hsum : ∑ i : ι, M.er (Xs i) = M.er (⋃ i, Xs i)
⊢ M.SkewFamily Xs

State before:
ι : Type u_1
α : Type u_2
M : Matroid α
B I J X X' Y Y' F : Set α
Xs Ys Js Is : ι → Set α
i j : ι
e f : α
inst✝ : Fintype ι
hXs : ∀ (i : ι), M.rFin (Xs i)
hXE : ∀ (i : ι), Xs i ⊆ M.E
hsum : ∑ i : ι, M.er (Xs i) = M.er (⋃ i, Xs i)
⊢ M.SkewFamily Xs
Tactic:
choose Is hIs using fun i ↦ M.exists_basis (Xs i) (hXE i)
State after:
ι : Type u_1
α : Type u_2
M : Matroid α
B I J X X' Y Y' F : Set α
Xs Ys Js Is✝ : ι → Set α
i j : ι
e f : α
inst✝ : Fintype ι
hXs : ∀ (i : ι), M.rFin (Xs i)
hXE : ∀ (i : ι), Xs i ⊆ M.E
hsum : ∑ i : ι, M.er (Xs i) = M.er (⋃ i, Xs i)
Is : ι → Set α
hIs : ∀ (i : ι), M.Basis (Is i) (Xs i)
⊢ M.SkewFamily Xs

State before:
ι : Type u_1
α : Type u_2
M : Matroid α
B I J X X' Y Y' F : Set α
Xs Ys Js Is✝ : ι → Set α
i j : ι
e f : α
inst✝ : Fintype ι
hXs : ∀ (i : ι), M.rFin (Xs i)
hXE : ∀ (i : ι), Xs i ⊆ M.E
hsum : ∑ i : ι, M.er (Xs i) = M.er (⋃ i, Xs i)
Is : ι → Set α
hIs : ∀ (i : ι), M.Basis (Is i) (Xs i)
⊢ M.SkewFamily Xs
Tactic:
rw [← er_cl_eq , ← M.cl_iUnion_cl_eq_cl_iUnion] at hsum
State after:
ι : Type u_1
α : Type u_2
M : Matroid α
B I J X X' Y Y' F : Set α
Xs Ys Js Is✝ : ι → Set α
i j : ι
e f : α
inst✝ : Fintype ι
hXs : ∀ (i : ι), M.rFin (Xs i)
hXE : ∀ (i : ι), Xs i ⊆ M.E
hsum : ∑ i : ι, M.er (Xs i) = M.er (M.cl (⋃ i, M.cl (Xs i)))
Is : ι → Set α
hIs : ∀ (i : ι), M.Basis (Is i) (Xs i)
⊢ M.SkewFamily Xs

State before:
ι : Type u_1
α : Type u_2
M : Matroid α
B I J X X' Y Y' F : Set α
Xs Ys Js Is✝ : ι → Set α
i j : ι
e f : α
inst✝ : Fintype ι
hXs : ∀ (i : ι), M.rFin (Xs i)
hXE : ∀ (i : ι), Xs i ⊆ M.E
hsum : ∑ i : ι, M.er (Xs i) = M.er (M.cl (⋃ i, M.cl (Xs i)))
Is : ι → Set α
hIs : ∀ (i : ι), M.Basis (Is i) (Xs i)
⊢ M.SkewFamily Xs
Tactic:
simp_rw [← (fun i ↦ M.er_cl_eq (Xs i)), ← (fun i ↦ (hIs i).cl_eq_cl), M.cl_iUnion_cl_eq_cl_iUnion,
  er_cl_eq, (fun i ↦ (hIs i).indep.er)] at hsum
State after:
ι : Type u_1
α : Type u_2
M : Matroid α
B I J X X' Y Y' F : Set α
Xs Ys Js Is✝ : ι → Set α
i j : ι
e f : α
inst✝ : Fintype ι
hXs : ∀ (i : ι), M.rFin (Xs i)
hXE : ∀ (i : ι), Xs i ⊆ M.E
Is : ι → Set α
hIs : ∀ (i : ι), M.Basis (Is i) (Xs i)
hsum : ∑ x : ι, (Is x).encard = M.er (⋃ i, Is i)
⊢ M.SkewFamily Xs

State before:
ι : Type u_1
α : Type u_2
M : Matroid α
B I J X X' Y Y' F : Set α
Xs Ys Js Is✝ : ι → Set α
i j : ι
e f : α
inst✝ : Fintype ι
hXs : ∀ (i : ι), M.rFin (Xs i)
hXE : ∀ (i : ι), Xs i ⊆ M.E
Is : ι → Set α
hIs : ∀ (i : ι), M.Basis (Is i) (Xs i)
hsum : ∑ x : ι, (Is x).encard = M.er (⋃ i, Is i)
⊢ M.SkewFamily Xs
Tactic:
apply Indep.skewFamily_of_disjoint_bases ?_ ?_ hIs
State after:
ι : Type u_1
α : Type u_2
M : Matroid α
B I J X X' Y Y' F : Set α
Xs Ys Js Is✝ : ι → Set α
i j : ι
e f : α
inst✝ : Fintype ι
hXs : ∀ (i : ι), M.rFin (Xs i)
hXE : ∀ (i : ι), Xs i ⊆ M.E
Is : ι → Set α
hIs : ∀ (i : ι), M.Basis (Is i) (Xs i)
hsum : ∑ x : ι, (Is x).encard = M.er (⋃ i, Is i)
⊢ M.Indep (⋃ i, Is i)

ι : Type u_1
α : Type u_2
M : Matroid α
B I J X X' Y Y' F : Set α
Xs Ys Js Is✝ : ι → Set α
i j : ι
e f : α
inst✝ : Fintype ι
hXs : ∀ (i : ι), M.rFin (Xs i)
hXE : ∀ (i : ι), Xs i ⊆ M.E
Is : ι → Set α
hIs : ∀ (i : ι), M.Basis (Is i) (Xs i)
hsum : ∑ x : ι, (Is x).encard = M.er (⋃ i, Is i)
⊢ Pairwise (Disjoint on fun i => Is i)

State before:
ι : Type u_1
α : Type u_2
M : Matroid α
B I J X X' Y Y' F : Set α
Xs Ys Js Is✝ : ι → Set α
i j : ι
e f : α
inst✝ : Fintype ι
hXs : ∀ (i : ι), M.rFin (Xs i)
hXE : ∀ (i : ι), Xs i ⊆ M.E
Is : ι → Set α
hIs : ∀ (i : ι), M.Basis (Is i) (Xs i)
hsum : ∑ x : ι, (Is x).encard = M.er (⋃ i, Is i)
⊢ Pairwise (Disjoint on fun i => Is i)
Tactic:
rw [← pairwise_univ]
State after:
ι : Type u_1
α : Type u_2
M : Matroid α
B I J X X' Y Y' F : Set α
Xs Ys Js Is✝ : ι → Set α
i j : ι
e f : α
inst✝ : Fintype ι
hXs : ∀ (i : ι), M.rFin (Xs i)
hXE : ∀ (i : ι), Xs i ⊆ M.E
Is : ι → Set α
hIs : ∀ (i : ι), M.Basis (Is i) (Xs i)
hsum : ∑ x : ι, (Is x).encard = M.er (⋃ i, Is i)
⊢ univ.Pairwise (Disjoint on fun i => Is i)

State before:
ι : Type u_1
α : Type u_2
M : Matroid α
B I J X X' Y Y' F : Set α
Xs Ys Js Is✝ : ι → Set α
i j : ι
e f : α
inst✝ : Fintype ι
hXs : ∀ (i : ι), M.rFin (Xs i)
hXE : ∀ (i : ι), Xs i ⊆ M.E
Is : ι → Set α
hIs : ∀ (i : ι), M.Basis (Is i) (Xs i)
hsum : ∑ x : ι, (Is x).encard = M.er (⋃ i, Is i)
⊢ univ.Pairwise (Disjoint on fun i => Is i)
Tactic:
exact pairwiseDisjoint_of_encard_sum_le_encard_iUnion
  (fun i ↦ (hXs i).finite_of_basis (hIs i)) (hsum.le.trans <| M.er_le_encard _)
State after:
no goals

State before:
ι : Type u_1
α : Type u_2
M : Matroid α
B I J X X' Y Y' F : Set α
Xs Ys Js Is✝ : ι → Set α
i j : ι
e f : α
inst✝ : Fintype ι
hXs : ∀ (i : ι), M.rFin (Xs i)
hXE : ∀ (i : ι), Xs i ⊆ M.E
Is : ι → Set α
hIs : ∀ (i : ι), M.Basis (Is i) (Xs i)
hsum : ∑ x : ι, (Is x).encard = M.er (⋃ i, Is i)
⊢ M.Indep (⋃ i, Is i)
Tactic:
exact rFin.indep_of_encard_le_er
  ((rFin.iUnion hXs).subset (iUnion_mono (fun i ↦ (hIs i).subset)))
  ((encard_iUnion_le _).trans hsum.le)
State after:
no goals