internlm/Lean-Github huggingface dataset:
Theorem: Finset.Colex.insert_lt_insert
Proof state before:
α : Type u_1
β : Type u_2
inst✝² : PartialOrder α
inst✝¹ : PartialOrder β
f : α → β
𝒜 𝒜₁ 𝒜₂ : Finset (Finset α)
s t u : Finset α
a b : α
inst✝ : DecidableEq α
ha : a ∉ s
hb : b ∉ s
⊢ { ofColex := insert a s } < { ofColex := insert b s } ↔ a < b
Tactic:
rw [← cons_eq_insert _ _ ha, ← cons_eq_insert _ _ hb, cons_lt_cons]
Proof state after:
no goals
Theorem: Finset.Colex.erase_le_erase
Proof state before:
α : Type u_1
β : Type u_2
inst✝² : PartialOrder α
inst✝¹ : PartialOrder β
f : α → β
𝒜 𝒜₁ 𝒜₂ : Finset (Finset α)
s t u : Finset α
a b : α
inst✝ : DecidableEq α
ha : a ∈ s
hb : b ∈ s
⊢ { ofColex := s.erase a } ≤ { ofColex := s.erase b } ↔ b ≤ a
Tactic:
obtain rfl | hab := eq_or_ne a b
Proof state after:
case inl
α : Type u_1
β : Type u_2
inst✝² : PartialOrder α
inst✝¹ : PartialOrder β
f : α → β
𝒜 𝒜₁ 𝒜₂ : Finset (Finset α)
s t u : Finset α
a : α
inst✝ : DecidableEq α
ha hb : a ∈ s
⊢ { ofColex := s.erase a } ≤ { ofColex := s.erase a } ↔ a ≤ a

case inr
α : Type u_1
β : Type u_2
inst✝² : PartialOrder α
inst✝¹ : PartialOrder β
f : α → β
𝒜 𝒜₁ 𝒜₂ : Finset (Finset α)
s t u : Finset α
a b : α
inst✝ : DecidableEq α
ha : a ∈ s
hb : b ∈ s
hab : a ≠ b
⊢ { ofColex := s.erase a } ≤ { ofColex := s.erase b } ↔ b ≤ a
Theorem: Finset.Colex.erase_le_erase
Proof state before:
case inr
α : Type u_1
β : Type u_2
inst✝² : PartialOrder α
inst✝¹ : PartialOrder β
f : α → β
𝒜 𝒜₁ 𝒜₂ : Finset (Finset α)
s t u : Finset α
a b : α
inst✝ : DecidableEq α
ha : a ∈ s
hb : b ∈ s
hab : a ≠ b
⊢ { ofColex := s.erase a } ≤ { ofColex := s.erase b } ↔ b ≤ a
Tactic:
classical
rw [← toColex_sdiff_le_toColex_sdiff', erase_sdiff_erase hab hb, erase_sdiff_erase hab.symm ha,
 singleton_le_singleton]
Proof state after:
no goals
Theorem: Finset.Colex.erase_le_erase
Proof state before:
case inl
α : Type u_1
β : Type u_2
inst✝² : PartialOrder α
inst✝¹ : PartialOrder β
f : α → β
𝒜 𝒜₁ 𝒜₂ : Finset (Finset α)
s t u : Finset α
a : α
inst✝ : DecidableEq α
ha hb : a ∈ s
⊢ { ofColex := s.erase a } ≤ { ofColex := s.erase a } ↔ a ≤ a
Tactic:
simp
Proof state after:
no goals
Theorem: Finset.Colex.erase_le_erase
Proof state before:
case inr
α : Type u_1
β : Type u_2
inst✝² : PartialOrder α
inst✝¹ : PartialOrder β
f : α → β
𝒜 𝒜₁ 𝒜₂ : Finset (Finset α)
s t u : Finset α
a b : α
inst✝ : DecidableEq α
ha : a ∈ s
hb : b ∈ s
hab : a ≠ b
⊢ { ofColex := s.erase a } ≤ { ofColex := s.erase b } ↔ b ≤ a
Tactic:
rw [← toColex_sdiff_le_toColex_sdiff', erase_sdiff_erase hab hb, erase_sdiff_erase hab.symm ha,
 singleton_le_singleton]
Proof state after:
no goals
Theorem: Finset.Colex.lt_iff_exists_forall_lt_mem_iff_mem
Proof state before:
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a : α
⊢ { ofColex := s } < { ofColex := t } ↔ ∃ w ∈ t, w ∉ s ∧ ∀ ⦃a : α⦄, w < a → (a ∈ s ↔ a ∈ t)
Tactic:
simp only [lt_iff_exists_forall_lt]
Proof state after:
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a : α
⊢ (∃ a ∈ t, a ∉ s ∧ ∀ b ∈ s, b ∉ t → b < a) ↔ ∃ w ∈ t, w ∉ s ∧ ∀ ⦃a : α⦄, w < a → (a ∈ s ↔ a ∈ t)
Theorem: Finset.Colex.lt_iff_exists_forall_lt_mem_iff_mem
Proof state before:
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a : α
⊢ (∃ a ∈ t, a ∉ s ∧ ∀ b ∈ s, b ∉ t → b < a) ↔ ∃ w ∈ t, w ∉ s ∧ ∀ ⦃a : α⦄, w < a → (a ∈ s ↔ a ∈ t)
Tactic:
refine ⟨fun h ↦ ?_, ?_⟩
Proof state after:
case refine_1
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a : α
h : ∃ a ∈ t, a ∉ s ∧ ∀ b ∈ s, b ∉ t → b < a
⊢ ∃ w ∈ t, w ∉ s ∧ ∀ ⦃a : α⦄, w < a → (a ∈ s ↔ a ∈ t)

case refine_2
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a : α
⊢ (∃ w ∈ t, w ∉ s ∧ ∀ ⦃a : α⦄, w < a → (a ∈ s ↔ a ∈ t)) → ∃ a ∈ t, a ∉ s ∧ ∀ b ∈ s, b ∉ t → b < a
Theorem: Finset.Colex.lt_iff_exists_forall_lt_mem_iff_mem
Proof state before:
case refine_1
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a : α
h : ∃ a ∈ t, a ∉ s ∧ ∀ b ∈ s, b ∉ t → b < a
⊢ ∃ w ∈ t, w ∉ s ∧ ∀ ⦃a : α⦄, w < a → (a ∈ s ↔ a ∈ t)
Tactic:
let u := (t \ s).filter fun w ↦ ∀ a ∈ s, a ∉ t → a < w
Proof state after:
case refine_1
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a : α
h : ∃ a ∈ t, a ∉ s ∧ ∀ b ∈ s, b ∉ t → b < a
u : Finset α := filter (fun w => ∀ a ∈ s, a ∉ t → a < w) (t \ s)
⊢ ∃ w ∈ t, w ∉ s ∧ ∀ ⦃a : α⦄, w < a → (a ∈ s ↔ a ∈ t)
Theorem: Finset.Colex.lt_iff_exists_forall_lt_mem_iff_mem
Proof state before:
case refine_1
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a : α
h : ∃ a ∈ t, a ∉ s ∧ ∀ b ∈ s, b ∉ t → b < a
u : Finset α := filter (fun w => ∀ a ∈ s, a ∉ t → a < w) (t \ s)
⊢ ∃ w ∈ t, w ∉ s ∧ ∀ ⦃a : α⦄, w < a → (a ∈ s ↔ a ∈ t)
Tactic:
have mem_u {w : α} : w ∈ u ↔ w ∈ t ∧ w ∉ s ∧ ∀ a ∈ s, a ∉ t → a < w := by simp [u, and_assoc]
Proof state after:
case refine_1
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a : α
h : ∃ a ∈ t, a ∉ s ∧ ∀ b ∈ s, b ∉ t → b < a
u : Finset α := filter (fun w => ∀ a ∈ s, a ∉ t → a < w) (t \ s)
mem_u : ∀ {w : α}, w ∈ u ↔ w ∈ t ∧ w ∉ s ∧ ∀ a ∈ s, a ∉ t → a < w
⊢ ∃ w ∈ t, w ∉ s ∧ ∀ ⦃a : α⦄, w < a → (a ∈ s ↔ a ∈ t)
Theorem: Finset.Colex.lt_iff_exists_forall_lt_mem_iff_mem
Proof state before:
case refine_1
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a : α
h : ∃ a ∈ t, a ∉ s ∧ ∀ b ∈ s, b ∉ t → b < a
u : Finset α := filter (fun w => ∀ a ∈ s, a ∉ t → a < w) (t \ s)
mem_u : ∀ {w : α}, w ∈ u ↔ w ∈ t ∧ w ∉ s ∧ ∀ a ∈ s, a ∉ t → a < w
⊢ ∃ w ∈ t, w ∉ s ∧ ∀ ⦃a : α⦄, w < a → (a ∈ s ↔ a ∈ t)
Tactic:
have hu : u.Nonempty := h.imp fun _ ↦ mem_u.2
Proof state after:
case refine_1
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a : α
h : ∃ a ∈ t, a ∉ s ∧ ∀ b ∈ s, b ∉ t → b < a
u : Finset α := filter (fun w => ∀ a ∈ s, a ∉ t → a < w) (t \ s)
mem_u : ∀ {w : α}, w ∈ u ↔ w ∈ t ∧ w ∉ s ∧ ∀ a ∈ s, a ∉ t → a < w
hu : u.Nonempty
⊢ ∃ w ∈ t, w ∉ s ∧ ∀ ⦃a : α⦄, w < a → (a ∈ s ↔ a ∈ t)
Theorem: Finset.Colex.lt_iff_exists_forall_lt_mem_iff_mem
Proof state before:
case refine_1
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a : α
h : ∃ a ∈ t, a ∉ s ∧ ∀ b ∈ s, b ∉ t → b < a
u : Finset α := filter (fun w => ∀ a ∈ s, a ∉ t → a < w) (t \ s)
mem_u : ∀ {w : α}, w ∈ u ↔ w ∈ t ∧ w ∉ s ∧ ∀ a ∈ s, a ∉ t → a < w
hu : u.Nonempty
⊢ ∃ w ∈ t, w ∉ s ∧ ∀ ⦃a : α⦄, w < a → (a ∈ s ↔ a ∈ t)
Tactic:
let m := max' _ hu
Proof state after:
case refine_1
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a : α
h : ∃ a ∈ t, a ∉ s ∧ ∀ b ∈ s, b ∉ t → b < a
u : Finset α := filter (fun w => ∀ a ∈ s, a ∉ t → a < w) (t \ s)
mem_u : ∀ {w : α}, w ∈ u ↔ w ∈ t ∧ w ∉ s ∧ ∀ a ∈ s, a ∉ t → a < w
hu : u.Nonempty
m : α := u.max' hu
⊢ ∃ w ∈ t, w ∉ s ∧ ∀ ⦃a : α⦄, w < a → (a ∈ s ↔ a ∈ t)
Theorem: Finset.Colex.lt_iff_exists_forall_lt_mem_iff_mem
Proof state before:
case refine_1
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a : α
h : ∃ a ∈ t, a ∉ s ∧ ∀ b ∈ s, b ∉ t → b < a
u : Finset α := filter (fun w => ∀ a ∈ s, a ∉ t → a < w) (t \ s)
mem_u : ∀ {w : α}, w ∈ u ↔ w ∈ t ∧ w ∉ s ∧ ∀ a ∈ s, a ∉ t → a < w
hu : u.Nonempty
m : α := u.max' hu
⊢ ∃ w ∈ t, w ∉ s ∧ ∀ ⦃a : α⦄, w < a → (a ∈ s ↔ a ∈ t)
Tactic:
have ⟨hmt, hms, hm⟩ : m ∈ t ∧ m ∉ s ∧ ∀ a ∈ s, a ∉ t → a < m := mem_u.1 $ max'_mem _ _
Proof state after:
case refine_1
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a : α
h : ∃ a ∈ t, a ∉ s ∧ ∀ b ∈ s, b ∉ t → b < a
u : Finset α := filter (fun w => ∀ a ∈ s, a ∉ t → a < w) (t \ s)
mem_u : ∀ {w : α}, w ∈ u ↔ w ∈ t ∧ w ∉ s ∧ ∀ a ∈ s, a ∉ t → a < w
hu : u.Nonempty
m : α := u.max' hu
hmt : m ∈ t
hms : m ∉ s
hm : ∀ a ∈ s, a ∉ t → a < m
⊢ ∃ w ∈ t, w ∉ s ∧ ∀ ⦃a : α⦄, w < a → (a ∈ s ↔ a ∈ t)
Theorem: Finset.Colex.lt_iff_exists_forall_lt_mem_iff_mem
Proof state before:
case refine_1
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a : α
h : ∃ a ∈ t, a ∉ s ∧ ∀ b ∈ s, b ∉ t → b < a
u : Finset α := filter (fun w => ∀ a ∈ s, a ∉ t → a < w) (t \ s)
mem_u : ∀ {w : α}, w ∈ u ↔ w ∈ t ∧ w ∉ s ∧ ∀ a ∈ s, a ∉ t → a < w
hu : u.Nonempty
m : α := u.max' hu
hmt : m ∈ t
hms : m ∉ s
hm : ∀ a ∈ s, a ∉ t → a < m
⊢ ∃ w ∈ t, w ∉ s ∧ ∀ ⦃a : α⦄, w < a → (a ∈ s ↔ a ∈ t)
Tactic:
refine ⟨m, hmt, hms, fun a hma ↦ ⟨fun has ↦ not_imp_comm.1 (hm _ has) hma.asymm, fun hat ↦ ?_⟩⟩
Proof state after:
case refine_1
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a✝ : α
h : ∃ a ∈ t, a ∉ s ∧ ∀ b ∈ s, b ∉ t → b < a
u : Finset α := filter (fun w => ∀ a ∈ s, a ∉ t → a < w) (t \ s)
mem_u : ∀ {w : α}, w ∈ u ↔ w ∈ t ∧ w ∉ s ∧ ∀ a ∈ s, a ∉ t → a < w
hu : u.Nonempty
m : α := u.max' hu
hmt : m ∈ t
hms : m ∉ s
hm : ∀ a ∈ s, a ∉ t → a < m
a : α
hma : m < a
hat : a ∈ t
⊢ a ∈ s
Theorem: Finset.Colex.lt_iff_exists_forall_lt_mem_iff_mem
Proof state before:
case refine_1
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a✝ : α
h : ∃ a ∈ t, a ∉ s ∧ ∀ b ∈ s, b ∉ t → b < a
u : Finset α := filter (fun w => ∀ a ∈ s, a ∉ t → a < w) (t \ s)
mem_u : ∀ {w : α}, w ∈ u ↔ w ∈ t ∧ w ∉ s ∧ ∀ a ∈ s, a ∉ t → a < w
hu : u.Nonempty
m : α := u.max' hu
hmt : m ∈ t
hms : m ∉ s
hm : ∀ a ∈ s, a ∉ t → a < m
a : α
hma : m < a
hat : a ∈ t
⊢ a ∈ s
Tactic:
by_contra has
Proof state after:
case refine_1
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a✝ : α
h : ∃ a ∈ t, a ∉ s ∧ ∀ b ∈ s, b ∉ t → b < a
u : Finset α := filter (fun w => ∀ a ∈ s, a ∉ t → a < w) (t \ s)
mem_u : ∀ {w : α}, w ∈ u ↔ w ∈ t ∧ w ∉ s ∧ ∀ a ∈ s, a ∉ t → a < w
hu : u.Nonempty
m : α := u.max' hu
hmt : m ∈ t
hms : m ∉ s
hm : ∀ a ∈ s, a ∉ t → a < m
a : α
hma : m < a
hat : a ∈ t
has : a ∉ s
⊢ False
Theorem: Finset.Colex.lt_iff_exists_forall_lt_mem_iff_mem
Proof state before:
case refine_1
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a✝ : α
h : ∃ a ∈ t, a ∉ s ∧ ∀ b ∈ s, b ∉ t → b < a
u : Finset α := filter (fun w => ∀ a ∈ s, a ∉ t → a < w) (t \ s)
mem_u : ∀ {w : α}, w ∈ u ↔ w ∈ t ∧ w ∉ s ∧ ∀ a ∈ s, a ∉ t → a < w
hu : u.Nonempty
m : α := u.max' hu
hmt : m ∈ t
hms : m ∉ s
hm : ∀ a ∈ s, a ∉ t → a < m
a : α
hma : m < a
hat : a ∈ t
has : a ∉ s
⊢ False
Tactic:
have hau : a ∈ u := mem_u.2 ⟨hat, has, fun b hbs hbt ↦ (hm _ hbs hbt).trans hma⟩
Proof state after:
case refine_1
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a✝ : α
h : ∃ a ∈ t, a ∉ s ∧ ∀ b ∈ s, b ∉ t → b < a
u : Finset α := filter (fun w => ∀ a ∈ s, a ∉ t → a < w) (t \ s)
mem_u : ∀ {w : α}, w ∈ u ↔ w ∈ t ∧ w ∉ s ∧ ∀ a ∈ s, a ∉ t → a < w
hu : u.Nonempty
m : α := u.max' hu
hmt : m ∈ t
hms : m ∉ s
hm : ∀ a ∈ s, a ∉ t → a < m
a : α
hma : m < a
hat : a ∈ t
has : a ∉ s
hau : a ∈ u
⊢ False
Theorem: Finset.Colex.lt_iff_exists_forall_lt_mem_iff_mem
Proof state before:
case refine_1
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a✝ : α
h : ∃ a ∈ t, a ∉ s ∧ ∀ b ∈ s, b ∉ t → b < a
u : Finset α := filter (fun w => ∀ a ∈ s, a ∉ t → a < w) (t \ s)
mem_u : ∀ {w : α}, w ∈ u ↔ w ∈ t ∧ w ∉ s ∧ ∀ a ∈ s, a ∉ t → a < w
hu : u.Nonempty
m : α := u.max' hu
hmt : m ∈ t
hms : m ∉ s
hm : ∀ a ∈ s, a ∉ t → a < m
a : α
hma : m < a
hat : a ∈ t
has : a ∉ s
hau : a ∈ u
⊢ False
Tactic:
exact hma.not_le $ le_max' _ _ hau
Proof state after:
no goals
Theorem: Finset.Colex.lt_iff_exists_forall_lt_mem_iff_mem
Proof state before:
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a : α
h : ∃ a ∈ t, a ∉ s ∧ ∀ b ∈ s, b ∉ t → b < a
u : Finset α := filter (fun w => ∀ a ∈ s, a ∉ t → a < w) (t \ s)
w : α
⊢ w ∈ u ↔ w ∈ t ∧ w ∉ s ∧ ∀ a ∈ s, a ∉ t → a < w
Tactic:
simp [u, and_assoc]
Proof state after:
no goals
Theorem: Finset.Colex.lt_iff_exists_forall_lt_mem_iff_mem
Proof state before:
case refine_2
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a : α
⊢ (∃ w ∈ t, w ∉ s ∧ ∀ ⦃a : α⦄, w < a → (a ∈ s ↔ a ∈ t)) → ∃ a ∈ t, a ∉ s ∧ ∀ b ∈ s, b ∉ t → b < a
Tactic:
rintro ⟨w, hwt, hws, hw⟩
Proof state after:
case refine_2.intro.intro.intro
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a w : α
hwt : w ∈ t
hws : w ∉ s
hw : ∀ ⦃a : α⦄, w < a → (a ∈ s ↔ a ∈ t)
⊢ ∃ a ∈ t, a ∉ s ∧ ∀ b ∈ s, b ∉ t → b < a
Theorem: Finset.Colex.lt_iff_exists_forall_lt_mem_iff_mem
Proof state before:
case refine_2.intro.intro.intro
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a w : α
hwt : w ∈ t
hws : w ∉ s
hw : ∀ ⦃a : α⦄, w < a → (a ∈ s ↔ a ∈ t)
⊢ ∃ a ∈ t, a ∉ s ∧ ∀ b ∈ s, b ∉ t → b < a
Tactic:
refine ⟨w, hwt, hws, fun a has hat ↦ ?_⟩
Proof state after:
case refine_2.intro.intro.intro
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a✝ w : α
hwt : w ∈ t
hws : w ∉ s
hw : ∀ ⦃a : α⦄, w < a → (a ∈ s ↔ a ∈ t)
a : α
has : a ∈ s
hat : a ∉ t
⊢ a < w
Theorem: Finset.Colex.lt_iff_exists_forall_lt_mem_iff_mem
Proof state before:
case refine_2.intro.intro.intro
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a✝ w : α
hwt : w ∈ t
hws : w ∉ s
hw : ∀ ⦃a : α⦄, w < a → (a ∈ s ↔ a ∈ t)
a : α
has : a ∈ s
hat : a ∉ t
⊢ a < w
Tactic:
by_contra! hwa
Proof state after:
case refine_2.intro.intro.intro
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a✝ w : α
hwt : w ∈ t
hws : w ∉ s
hw : ∀ ⦃a : α⦄, w < a → (a ∈ s ↔ a ∈ t)
a : α
has : a ∈ s
hat : a ∉ t
hwa : w ≤ a
⊢ False
Theorem: Finset.Colex.lt_iff_exists_forall_lt_mem_iff_mem
Proof state before:
case refine_2.intro.intro.intro
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a✝ w : α
hwt : w ∈ t
hws : w ∉ s
hw : ∀ ⦃a : α⦄, w < a → (a ∈ s ↔ a ∈ t)
a : α
has : a ∈ s
hat : a ∉ t
hwa : w ≤ a
⊢ False
Tactic:
exact hat $ (hw $ hwa.lt_of_ne $ ne_of_mem_of_not_mem hwt hat).1 has
Proof state after:
no goals
Theorem: Finset.Colex.erase_le_erase_min'
Proof state before:
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a : α
hst : { ofColex := s } ≤ { ofColex := t }
hcard : s.card ≤ t.card
ha : a ∈ s
⊢ { ofColex := s.erase a } ≤ { ofColex := t.erase (t.min' ⋯) }
Tactic:
generalize_proofs ht
Proof state after:
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a : α
hst : { ofColex := s } ≤ { ofColex := t }
hcard : s.card ≤ t.card
ha : a ∈ s
ht : t.Nonempty
⊢ { ofColex := s.erase a } ≤ { ofColex := t.erase (t.min' ht) }
Theorem: Finset.Colex.erase_le_erase_min'
Proof state before:
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a : α
hst : { ofColex := s } ≤ { ofColex := t }
hcard : s.card ≤ t.card
ha : a ∈ s
ht : t.Nonempty
⊢ { ofColex := s.erase a } ≤ { ofColex := t.erase (t.min' ht) }
Tactic:
set m := min' t ht
Proof state after:
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a : α
hst : { ofColex := s } ≤ { ofColex := t }
hcard : s.card ≤ t.card
ha : a ∈ s
ht : t.Nonempty
m : α := t.min' ht
⊢ { ofColex := s.erase a } ≤ { ofColex := t.erase m }
Theorem: Finset.Colex.erase_le_erase_min'
Proof state before:
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a : α
hst : { ofColex := s } ≤ { ofColex := t }
hcard : s.card ≤ t.card
ha : a ∈ s
ht : t.Nonempty
m : α := t.min' ht
⊢ { ofColex := s.erase a } ≤ { ofColex := t.erase m }
Tactic:
obtain rfl | h' := eq_or_ne s t
Proof state after:
case inl
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s : Finset α
a : α
ha : a ∈ s
hst : { ofColex := s } ≤ { ofColex := s }
hcard : s.card ≤ s.card
ht : s.Nonempty
m : α := s.min' ht
⊢ { ofColex := s.erase a } ≤ { ofColex := s.erase m }

case inr
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a : α
hst : { ofColex := s } ≤ { ofColex := t }
hcard : s.card ≤ t.card
ha : a ∈ s
ht : t.Nonempty
m : α := t.min' ht
h' : s ≠ t
⊢ { ofColex := s.erase a } ≤ { ofColex := t.erase m }
Theorem: Finset.Colex.erase_le_erase_min'
Proof state before:
case inr
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a : α
hst : { ofColex := s } ≤ { ofColex := t }
hcard : s.card ≤ t.card
ha : a ∈ s
ht : t.Nonempty
m : α := t.min' ht
h' : s ≠ t
⊢ { ofColex := s.erase a } ≤ { ofColex := t.erase m }
Tactic:
replace hst := hst.lt_of_ne $ toColex_inj.not.2 h'
Proof state after:
case inr
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a : α
hcard : s.card ≤ t.card
ha : a ∈ s
ht : t.Nonempty
m : α := t.min' ht
h' : s ≠ t
hst : { ofColex := s } < { ofColex := t }
⊢ { ofColex := s.erase a } ≤ { ofColex := t.erase m }
Theorem: Finset.Colex.erase_le_erase_min'
Proof state before:
case inr
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a : α
hcard : s.card ≤ t.card
ha : a ∈ s
ht : t.Nonempty
m : α := t.min' ht
h' : s ≠ t
hst : { ofColex := s } < { ofColex := t }
⊢ { ofColex := s.erase a } ≤ { ofColex := t.erase m }
Tactic:
simp only [lt_iff_exists_forall_lt_mem_iff_mem] at hst
Proof state after:
case inr
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a : α
hcard : s.card ≤ t.card
ha : a ∈ s
ht : t.Nonempty
m : α := t.min' ht
h' : s ≠ t
hst : ∃ w ∈ t, w ∉ s ∧ ∀ ⦃a : α⦄, w < a → (a ∈ s ↔ a ∈ t)
⊢ { ofColex := s.erase a } ≤ { ofColex := t.erase m }
Theorem: Finset.Colex.erase_le_erase_min'
Proof state before:
case inr
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a : α
hcard : s.card ≤ t.card
ha : a ∈ s
ht : t.Nonempty
m : α := t.min' ht
h' : s ≠ t
hst : ∃ w ∈ t, w ∉ s ∧ ∀ ⦃a : α⦄, w < a → (a ∈ s ↔ a ∈ t)
⊢ { ofColex := s.erase a } ≤ { ofColex := t.erase m }
Tactic:
obtain ⟨w, hwt, hws, hw⟩ := hst
Proof state after:
case inr.intro.intro.intro
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a : α
hcard : s.card ≤ t.card
ha : a ∈ s
ht : t.Nonempty
m : α := t.min' ht
h' : s ≠ t
w : α
hwt : w ∈ t
hws : w ∉ s
hw : ∀ ⦃a : α⦄, w < a → (a ∈ s ↔ a ∈ t)
⊢ { ofColex := s.erase a } ≤ { ofColex := t.erase m }
Theorem: Finset.Colex.erase_le_erase_min'
Proof state before:
case inr.intro.intro.intro
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a : α
hcard : s.card ≤ t.card
ha : a ∈ s
ht : t.Nonempty
m : α := t.min' ht
h' : s ≠ t
w : α
hwt : w ∈ t
hws : w ∉ s
hw : ∀ ⦃a : α⦄, w < a → (a ∈ s ↔ a ∈ t)
⊢ { ofColex := s.erase a } ≤ { ofColex := t.erase m }
Tactic:
obtain hwa | haw := (ne_of_mem_of_not_mem ha hws).symm.lt_or_lt
Proof state after:
case inr.intro.intro.intro.inl
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a : α
hcard : s.card ≤ t.card
ha : a ∈ s
ht : t.Nonempty
m : α := t.min' ht
h' : s ≠ t
w : α
hwt : w ∈ t
hws : w ∉ s
hw : ∀ ⦃a : α⦄, w < a → (a ∈ s ↔ a ∈ t)
hwa : w < a
⊢ { ofColex := s.erase a } ≤ { ofColex := t.erase m }

case inr.intro.intro.intro.inr
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a : α
hcard : s.card ≤ t.card
ha : a ∈ s
ht : t.Nonempty
m : α := t.min' ht
h' : s ≠ t
w : α
hwt : w ∈ t
hws : w ∉ s
hw : ∀ ⦃a : α⦄, w < a → (a ∈ s ↔ a ∈ t)
haw : a < w
⊢ { ofColex := s.erase a } ≤ { ofColex := t.erase m }
Theorem: Finset.Colex.erase_le_erase_min'
Proof state before:
case inr.intro.intro.intro.inr
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a : α
hcard : s.card ≤ t.card
ha : a ∈ s
ht : t.Nonempty
m : α := t.min' ht
h' : s ≠ t
w : α
hwt : w ∈ t
hws : w ∉ s
hw : ∀ ⦃a : α⦄, w < a → (a ∈ s ↔ a ∈ t)
haw : a < w
⊢ { ofColex := s.erase a } ≤ { ofColex := t.erase m }
Tactic:
obtain rfl | hmw : m = w ∨ m < w := (min'_le _ _ hwt).eq_or_lt
Proof state after:
case inr.intro.intro.intro.inr.inl
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a : α
hcard : s.card ≤ t.card
ha : a ∈ s
ht : t.Nonempty
m : α := t.min' ht
h' : s ≠ t
hwt : m ∈ t
hws : m ∉ s
hw : ∀ ⦃a : α⦄, m < a → (a ∈ s ↔ a ∈ t)
haw : a < m
⊢ { ofColex := s.erase a } ≤ { ofColex := t.erase m }

case inr.intro.intro.intro.inr.inr
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a : α
hcard : s.card ≤ t.card
ha : a ∈ s
ht : t.Nonempty
m : α := t.min' ht
h' : s ≠ t
w : α
hwt : w ∈ t
hws : w ∉ s
hw : ∀ ⦃a : α⦄, w < a → (a ∈ s ↔ a ∈ t)
haw : a < w
hmw : m < w
⊢ { ofColex := s.erase a } ≤ { ofColex := t.erase m }
Theorem: Finset.Colex.erase_le_erase_min'
Proof state before:
case inl
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s : Finset α
a : α
ha : a ∈ s
hst : { ofColex := s } ≤ { ofColex := s }
hcard : s.card ≤ s.card
ht : s.Nonempty
m : α := s.min' ht
⊢ { ofColex := s.erase a } ≤ { ofColex := s.erase m }
Tactic:
exact (erase_le_erase ha $ min'_mem _ _).2 $ min'_le _ _ $ ha
Proof state after:
no goals
Theorem: Finset.Colex.erase_le_erase_min'
Proof state before:
case inr.intro.intro.intro.inl
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a : α
hcard : s.card ≤ t.card
ha : a ∈ s
ht : t.Nonempty
m : α := t.min' ht
h' : s ≠ t
w : α
hwt : w ∈ t
hws : w ∉ s
hw : ∀ ⦃a : α⦄, w < a → (a ∈ s ↔ a ∈ t)
hwa : w < a
⊢ { ofColex := s.erase a } ≤ { ofColex := t.erase m }
Tactic:
have hma : m < a := (min'_le _ _ hwt).trans_lt hwa
Proof state after:
case inr.intro.intro.intro.inl
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a : α
hcard : s.card ≤ t.card
ha : a ∈ s
ht : t.Nonempty
m : α := t.min' ht
h' : s ≠ t
w : α
hwt : w ∈ t
hws : w ∉ s
hw : ∀ ⦃a : α⦄, w < a → (a ∈ s ↔ a ∈ t)
hwa : w < a
hma : m < a
⊢ { ofColex := s.erase a } ≤ { ofColex := t.erase m }
Theorem: Finset.Colex.erase_le_erase_min'
Proof state before:
case inr.intro.intro.intro.inl
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a : α
hcard : s.card ≤ t.card
ha : a ∈ s
ht : t.Nonempty
m : α := t.min' ht
h' : s ≠ t
w : α
hwt : w ∈ t
hws : w ∉ s
hw : ∀ ⦃a : α⦄, w < a → (a ∈ s ↔ a ∈ t)
hwa : w < a
hma : m < a
⊢ { ofColex := s.erase a } ≤ { ofColex := t.erase m }
Tactic:
refine (lt_iff_exists_forall_lt.2 ⟨a, mem_erase.2 ⟨hma.ne', (hw hwa).1 ha⟩,
  not_mem_erase _ _, fun b hbs hbt ↦ ?_⟩).le
Proof state after:
case inr.intro.intro.intro.inl
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a : α
hcard : s.card ≤ t.card
ha : a ∈ s
ht : t.Nonempty
m : α := t.min' ht
h' : s ≠ t
w : α
hwt : w ∈ t
hws : w ∉ s
hw : ∀ ⦃a : α⦄, w < a → (a ∈ s ↔ a ∈ t)
hwa : w < a
hma : m < a
b : α
hbs : b ∈ { ofColex := { val := s.val.erase a, nodup := ⋯ } }.ofColex
hbt : b ∉ { ofColex := { val := t.val.erase m, nodup := ⋯ } }.ofColex
⊢ b < a
Theorem: Finset.Colex.erase_le_erase_min'
Proof state before:
case inr.intro.intro.intro.inl
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a : α
hcard : s.card ≤ t.card
ha : a ∈ s
ht : t.Nonempty
m : α := t.min' ht
h' : s ≠ t
w : α
hwt : w ∈ t
hws : w ∉ s
hw : ∀ ⦃a : α⦄, w < a → (a ∈ s ↔ a ∈ t)
hwa : w < a
hma : m < a
b : α
hbs : b ∈ { ofColex := { val := s.val.erase a, nodup := ⋯ } }.ofColex
hbt : b ∉ { ofColex := { val := t.val.erase m, nodup := ⋯ } }.ofColex
⊢ b < a
Tactic:
change b ∉ t.erase m at hbt
Proof state after:
case inr.intro.intro.intro.inl
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a : α
hcard : s.card ≤ t.card
ha : a ∈ s
ht : t.Nonempty
m : α := t.min' ht
h' : s ≠ t
w : α
hwt : w ∈ t
hws : w ∉ s
hw : ∀ ⦃a : α⦄, w < a → (a ∈ s ↔ a ∈ t)
hwa : w < a
hma : m < a
b : α
hbs : b ∈ { ofColex := { val := s.val.erase a, nodup := ⋯ } }.ofColex
hbt : b ∉ t.erase m
⊢ b < a
Theorem: Finset.Colex.erase_le_erase_min'
Proof state before:
case inr.intro.intro.intro.inl
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a : α
hcard : s.card ≤ t.card
ha : a ∈ s
ht : t.Nonempty
m : α := t.min' ht
h' : s ≠ t
w : α
hwt : w ∈ t
hws : w ∉ s
hw : ∀ ⦃a : α⦄, w < a → (a ∈ s ↔ a ∈ t)
hwa : w < a
hma : m < a
b : α
hbs : b ∈ { ofColex := { val := s.val.erase a, nodup := ⋯ } }.ofColex
hbt : b ∉ t.erase m
⊢ b < a
Tactic:
rw [mem_erase, not_and_or, not_ne_iff] at hbt
Proof state after:
case inr.intro.intro.intro.inl
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
s t : Finset α
a : α
hcard : s.card ≤ t.card
ha : a ∈ s
ht : t.Nonempty
m : α := t.min' ht
h' : s ≠ t
w : α
hwt : w ∈ t
hws : w ∉ s
hw : ∀ ⦃a : α⦄, w < a → (a ∈ s ↔ a ∈ t)
hwa : w < a
hma : m < a
b : α
hbs : b ∈ { ofColex := { val := s.val.erase a, nodup := ⋯ } }.ofColex
hbt : b = m ∨ b ∉ t
⊢ b < a