Theorem: Set.chainHeight_union_le
File: Mathlib/Order/Height.lean

tactic: refine iSup₂_le fun l hl ↦ ?_
state_before: α : Type u_1
β : Type u_2
s t : Set α
inst✝ : Preorder α
⊢ (s ∪ t).chainHeight ≤ s.chainHeight + t.chainHeight
state_after: α : Type u_1
β : Type u_2
s t : Set α
inst✝ : Preorder α
l : List α
hl : l ∈ (s ∪ t).subchain
⊢ ↑l.length ≤ s.chainHeight + t.chainHeight

tactic: have hl₁ : ↑l₁.length ≤ s.chainHeight := by
  apply Set.length_le_chainHeight_of_mem_subchain
  exact ⟨hl.1.sublist (filter_sublist _), fun i h ↦ by simpa using (of_mem_filter h : _)⟩
state_before: α : Type u_1
β : Type u_2
s t : Set α
inst✝ : Preorder α
l : List α
hl : l ∈ (s ∪ t).subchain
l₁ : List α := filter (fun x => decide (x ∈ s)) l
l₂ : List α := filter (fun x => decide (x ∈ t)) l
⊢ ↑l.length ≤ s.chainHeight + t.chainHeight
state_after: α : Type u_1
β : Type u_2
s t : Set α
inst✝ : Preorder α
l : List α
hl : l ∈ (s ∪ t).subchain
l₁ : List α := filter (fun x => decide (x ∈ s)) l
l₂ : List α := filter (fun x => decide (x ∈ t)) l
hl₁ : ↑l₁.length ≤ s.chainHeight
⊢ ↑l.length ≤ s.chainHeight + t.chainHeight

tactic: have hl₂ : ↑l₂.length ≤ t.chainHeight := by
  apply Set.length_le_chainHeight_of_mem_subchain
  exact ⟨hl.1.sublist (filter_sublist _), fun i h ↦ by simpa using (of_mem_filter h : _)⟩
state_before: α : Type u_1
β : Type u_2
s t : Set α
inst✝ : Preorder α
l : List α
hl : l ∈ (s ∪ t).subchain
l₁ : List α := filter (fun x => decide (x ∈ s)) l
l₂ : List α := filter (fun x => decide (x ∈ t)) l
hl₁ : ↑l₁.length ≤ s.chainHeight
⊢ ↑l.length ≤ s.chainHeight + t.chainHeight
state_after: α : Type u_1
β : Type u_2
s t : Set α
inst✝ : Preorder α
l : List α
hl : l ∈ (s ∪ t).subchain
l₁ : List α := filter (fun x => decide (x ∈ s)) l
l₂ : List α := filter (fun x => decide (x ∈ t)) l
hl₁ : ↑l₁.length ≤ s.chainHeight
hl₂ : ↑l₂.length ≤ t.chainHeight
⊢ ↑l.length ≤ s.chainHeight + t.chainHeight

tactic: refine le_trans ?_ (add_le_add hl₁ hl₂)
state_before: α : Type u_1
β : Type u_2
s t : Set α
inst✝ : Preorder α
l : List α
hl : l ∈ (s ∪ t).subchain
l₁ : List α := filter (fun x => decide (x ∈ s)) l
l₂ : List α := filter (fun x => decide (x ∈ t)) l
hl₁ : ↑l₁.length ≤ s.chainHeight
hl₂ : ↑l₂.length ≤ t.chainHeight
⊢ ↑l.length ≤ s.chainHeight + t.chainHeight
state_after: α : Type u_1
β : Type u_2
s t : Set α
inst✝ : Preorder α
l : List α
hl : l ∈ (s ∪ t).subchain
l₁ : List α := filter (fun x => decide (x ∈ s)) l
l₂ : List α := filter (fun x => decide (x ∈ t)) l
hl₁ : ↑l₁.length ≤ s.chainHeight
hl₂ : ↑l₂.length ≤ t.chainHeight
⊢ ↑l.length ≤ ↑l₁.length + ↑l₂.length

tactic: simp_rw [l₁, l₂, ← Nat.cast_add, ← Multiset.coe_card, ← Multiset.card_add,
  ← Multiset.filter_coe]
state_before: α : Type u_1
β : Type u_2
s t : Set α
inst✝ : Preorder α
l : List α
hl : l ∈ (s ∪ t).subchain
l₁ : List α := filter (fun x => decide (x ∈ s)) l
l₂ : List α := filter (fun x => decide (x ∈ t)) l
hl₁ : ↑l₁.length ≤ s.chainHeight
hl₂ : ↑l₂.length ≤ t.chainHeight
⊢ ↑l.length ≤ ↑l₁.length + ↑l₂.length
state_after: α : Type u_1
β : Type u_2
s t : Set α
inst✝ : Preorder α
l : List α
hl : l ∈ (s ∪ t).subchain
l₁ : List α := filter (fun x => decide (x ∈ s)) l
l₂ : List α := filter (fun x => decide (x ∈ t)) l
hl₁ : ↑l₁.length ≤ s.chainHeight
hl₂ : ↑l₂.length ≤ t.chainHeight
⊢ ↑(Multiset.card ↑l) ≤ ↑(Multiset.card (Multiset.filter (fun b => b ∈ s) ↑l + Multiset.filter (fun b => b ∈ t) ↑l))

tactic: rw [Multiset.filter_add_filter, Multiset.filter_eq_self.mpr, Multiset.card_add, Nat.cast_add]
state_before: α : Type u_1
β : Type u_2
s t : Set α
inst✝ : Preorder α
l : List α
hl : l ∈ (s ∪ t).subchain
l₁ : List α := filter (fun x => decide (x ∈ s)) l
l₂ : List α := filter (fun x => decide (x ∈ t)) l
hl₁ : ↑l₁.length ≤ s.chainHeight
hl₂ : ↑l₂.length ≤ t.chainHeight
⊢ ↑(Multiset.card ↑l) ≤ ↑(Multiset.card (Multiset.filter (fun b => b ∈ s) ↑l + Multiset.filter (fun b => b ∈ t) ↑l))
state_after: α : Type u_1
β : Type u_2
s t : Set α
inst✝ : Preorder α
l : List α
hl : l ∈ (s ∪ t).subchain
l₁ : List α := filter (fun x => decide (x ∈ s)) l
l₂ : List α := filter (fun x => decide (x ∈ t)) l
hl₁ : ↑l₁.length ≤ s.chainHeight
hl₂ : ↑l₂.length ≤ t.chainHeight
⊢ ↑(Multiset.card ↑l) ≤ ↑(Multiset.card ↑l) + ↑(Multiset.card (Multiset.filter (fun a => a ∈ s ∧ a ∈ t) ↑l))

α : Type u_1
β : Type u_2
s t : Set α
inst✝ : Preorder α
l : List α
hl : l ∈ (s ∪ t).subchain
l₁ : List α := filter (fun x => decide (x ∈ s)) l
l₂ : List α := filter (fun x => decide (x ∈ t)) l
hl₁ : ↑l₁.length ≤ s.chainHeight
hl₂ : ↑l₂.length ≤ t.chainHeight
⊢ ∀ a ∈ ↑l, a ∈ s ∨ a ∈ t

tactic: exacts [le_add_right rfl.le, hl.2]
state_before: α : Type u_1
β : Type u_2
s t : Set α
inst✝ : Preorder α
l : List α
hl : l ∈ (s ∪ t).subchain
l₁ : List α := filter (fun x => decide (x ∈ s)) l
l₂ : List α := filter (fun x => decide (x ∈ t)) l
hl₁ : ↑l₁.length ≤ s.chainHeight
hl₂ : ↑l₂.length ≤ t.chainHeight
⊢ ↑(Multiset.card ↑l) ≤ ↑(Multiset.card ↑l) + ↑(Multiset.card (Multiset.filter (fun a => a ∈ s ∧ a ∈ t) ↑l))

α : Type u_1
β : Type u_2
s t : Set α
inst✝ : Preorder α
l : List α
hl : l ∈ (s ∪ t).subchain
l₁ : List α := filter (fun x => decide (x ∈ s)) l
l₂ : List α := filter (fun x => decide (x ∈ t)) l
hl₁ : ↑l₁.length ≤ s.chainHeight
hl₂ : ↑l₂.length ≤ t.chainHeight
⊢ ∀ a ∈ ↑l, a ∈ s ∨ a ∈ t
state_after: no goals

tactic: apply Set.length_le_chainHeight_of_mem_subchain
state_before: α : Type u_1
β : Type u_2
s t : Set α
inst✝ : Preorder α
l : List α
hl : l ∈ (s ∪ t).subchain
l₁ : List α := filter (fun x => decide (x ∈ s)) l
l₂ : List α := filter (fun x => decide (x ∈ t)) l
⊢ ↑l₁.length ≤ s.chainHeight
state_after: case hl
α : Type u_1
β : Type u_2
s t : Set α
inst✝ : Preorder α
l : List α
hl : l ∈ (s ∪ t).subchain
l₁ : List α := filter (fun x => decide (x ∈ s)) l
l₂ : List α := filter (fun x => decide (x ∈ t)) l
⊢ l₁ ∈ s.subchain

tactic: exact ⟨hl.1.sublist (filter_sublist _), fun i h ↦ by simpa using (of_mem_filter h : _)⟩
state_before: case hl
α : Type u_1
β : Type u_2
s t : Set α
inst✝ : Preorder α
l : List α
hl : l ∈ (s ∪ t).subchain
l₁ : List α := filter (fun x => decide (x ∈ s)) l
l₂ : List α := filter (fun x => decide (x ∈ t)) l
⊢ l₁ ∈ s.subchain
state_after: no goals

tactic: simpa using (of_mem_filter h : _)
state_before: α : Type u_1
β : Type u_2
s t : Set α
inst✝ : Preorder α
l : List α
hl : l ∈ (s ∪ t).subchain
l₁ : List α := filter (fun x => decide (x ∈ s)) l
l₂ : List α := filter (fun x => decide (x ∈ t)) l
i : α
h : i ∈ l₁
⊢ i ∈ s
state_after: no goals

tactic: apply Set.length_le_chainHeight_of_mem_subchain
state_before: α : Type u_1
β : Type u_2
s t : Set α
inst✝ : Preorder α
l : List α
hl : l ∈ (s ∪ t).subchain
l₁ : List α := filter (fun x => decide (x ∈ s)) l
l₂ : List α := filter (fun x => decide (x ∈ t)) l
hl₁ : ↑l₁.length ≤ s.chainHeight
⊢ ↑l₂.length ≤ t.chainHeight
state_after: case hl
α : Type u_1
β : Type u_2
s t : Set α
inst✝ : Preorder α
l : List α
hl : l ∈ (s ∪ t).subchain
l₁ : List α := filter (fun x => decide (x ∈ s)) l
l₂ : List α := filter (fun x => decide (x ∈ t)) l
hl₁ : ↑l₁.length ≤ s.chainHeight
⊢ l₂ ∈ t.subchain

tactic: exact ⟨hl.1.sublist (filter_sublist _), fun i h ↦ by simpa using (of_mem_filter h : _)⟩
state_before: case hl
α : Type u_1
β : Type u_2
s t : Set α
inst✝ : Preorder α
l : List α
hl : l ∈ (s ∪ t).subchain
l₁ : List α := filter (fun x => decide (x ∈ s)) l
l₂ : List α := filter (fun x => decide (x ∈ t)) l
hl₁ : ↑l₁.length ≤ s.chainHeight
⊢ l₂ ∈ t.subchain
state_after: no goals

tactic: simpa using (of_mem_filter h : _)
state_before: α : Type u_1
β : Type u_2
s t : Set α
inst✝ : Preorder α
l : List α
hl : l ∈ (s ∪ t).subchain
l₁ : List α := filter (fun x => decide (x ∈ s)) l
l₂ : List α := filter (fun x => decide (x ∈ t)) l
hl₁ : ↑l₁.length ≤ s.chainHeight
i : α
h : i ∈ l₂
⊢ i ∈ t
state_after: no goals