l3lab/ntp-mathlib huggingface dataset:
private lemma trans_aux (hst : toColex s ≤ toColex t) (htu : toColex t ≤ toColex u)
    (has : a ∈ s) (hat : a ∉ t) : ∃ b, b ∈ u ∧ b ∉ s ∧ a ≤ b := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : PartialOrder α
inst✝ : PartialOrder β
f : α → β
𝒜 𝒜₁ 𝒜₂ : Finset (Finset α)
s t u : Finset α
a b : α
hst : { ofColex := s } ≤ { ofColex := t }
htu : { ofColex := t } ≤ { ofColex := u }
has : a ∈ s
hat : a ∉ t
⊢ ∃ b ∈ u, b ∉ s ∧ a ≤ b

Next tactic:
classical
  let s' : Finset α := s.filter fun b ↦ b ∉ t ∧ a ≤ b
  have ⟨b, hb, hbmax⟩ := exists_maximal s' ⟨a, by simp [has, hat]⟩
  simp only [mem_filter, and_imp] at hb hbmax
  have ⟨c, hct, hcs, hbc⟩ := hst hb.1 hb.2.1
  by_cases hcu : c ∈ u
  · exact ⟨c, hcu, hcs, hb.2.2.trans hbc⟩
  have ⟨d, hdu, hdt, hcd⟩ := htu hct hcu
  have had : a ≤ d := hb.2.2.trans <| hbc.trans hcd
  refine ⟨d, hdu, fun hds ↦ ?_, had⟩
  exact hbmax d hds hdt had <| hbc.trans_lt <| hcd.lt_of_ne <| ne_of_mem_of_not_mem hct hdt
private lemma trans_aux (hst : toColex s ≤ toColex t) (htu : toColex t ≤ toColex u)
    (has : a ∈ s) (hat : a ∉ t) : ∃ b, b ∈ u ∧ b ∉ s ∧ a ≤ b := by
  classical
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : PartialOrder α
inst✝ : PartialOrder β
f : α → β
𝒜 𝒜₁ 𝒜₂ : Finset (Finset α)
s t u : Finset α
a b : α
hst : { ofColex := s } ≤ { ofColex := t }
htu : { ofColex := t } ≤ { ofColex := u }
has : a ∈ s
hat : a ∉ t
⊢ ∃ b ∈ u, b ∉ s ∧ a ≤ b

Next tactic:
let s' : Finset α := s.filter fun b ↦ b ∉ t ∧ a ≤ b
private lemma trans_aux (hst : toColex s ≤ toColex t) (htu : toColex t ≤ toColex u)
    (has : a ∈ s) (hat : a ∉ t) : ∃ b, b ∈ u ∧ b ∉ s ∧ a ≤ b := by
  classical
  let s' : Finset α := s.filter fun b ↦ b ∉ t ∧ a ≤ b
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : PartialOrder α
inst✝ : PartialOrder β
f : α → β
𝒜 𝒜₁ 𝒜₂ : Finset (Finset α)
s t u : Finset α
a b : α
hst : { ofColex := s } ≤ { ofColex := t }
htu : { ofColex := t } ≤ { ofColex := u }
has : a ∈ s
hat : a ∉ t
s' : Finset α := filter (fun b => b ∉ t ∧ a ≤ b) s
⊢ ∃ b ∈ u, b ∉ s ∧ a ≤ b

Next tactic:
have ⟨b, hb, hbmax⟩ := exists_maximal s' ⟨a, by simp [has, hat]⟩
private lemma trans_aux (hst : toColex s ≤ toColex t) (htu : toColex t ≤ toColex u)
    (has : a ∈ s) (hat : a ∉ t) : ∃ b, b ∈ u ∧ b ∉ s ∧ a ≤ b := by
  classical
  let s' : Finset α := s.filter fun b ↦ b ∉ t ∧ a ≤ b
  have ⟨b, hb, hbmax⟩ := exists_maximal s' ⟨a, by 

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : PartialOrder α
inst✝ : PartialOrder β
f : α → β
𝒜 𝒜₁ 𝒜₂ : Finset (Finset α)
s t u : Finset α
a b : α
hst : { ofColex := s } ≤ { ofColex := t }
htu : { ofColex := t } ≤ { ofColex := u }
has : a ∈ s
hat : a ∉ t
s' : Finset α := filter (fun b => b ∉ t ∧ a ≤ b) s
⊢ a ∈ s'

Next tactic:
simp [has, hat]
private lemma trans_aux (hst : toColex s ≤ toColex t) (htu : toColex t ≤ toColex u)
    (has : a ∈ s) (hat : a ∉ t) : ∃ b, b ∈ u ∧ b ∉ s ∧ a ≤ b := by
  classical
  let s' : Finset α := s.filter fun b ↦ b ∉ t ∧ a ≤ b
  have ⟨b, hb, hbmax⟩ := exists_maximal s' ⟨a, by simp [has, hat]⟩
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : PartialOrder α
inst✝ : PartialOrder β
f : α → β
𝒜 𝒜₁ 𝒜₂ : Finset (Finset α)
s t u : Finset α
a b✝ : α
hst : { ofColex := s } ≤ { ofColex := t }
htu : { ofColex := t } ≤ { ofColex := u }
has : a ∈ s
hat : a ∉ t
s' : Finset α := filter (fun b => b ∉ t ∧ a ≤ b) s
b : α
hb : b ∈ s'
hbmax : ∀ x ∈ s', ¬b < x
⊢ ∃ b ∈ u, b ∉ s ∧ a ≤ b

Next tactic:
simp only [mem_filter, and_imp] at hb hbmax
private lemma trans_aux (hst : toColex s ≤ toColex t) (htu : toColex t ≤ toColex u)
    (has : a ∈ s) (hat : a ∉ t) : ∃ b, b ∈ u ∧ b ∉ s ∧ a ≤ b := by
  classical
  let s' : Finset α := s.filter fun b ↦ b ∉ t ∧ a ≤ b
  have ⟨b, hb, hbmax⟩ := exists_maximal s' ⟨a, by simp [has, hat]⟩
  simp only [mem_filter, and_imp] at hb hbmax
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : PartialOrder α
inst✝ : PartialOrder β
f : α → β
𝒜 𝒜₁ 𝒜₂ : Finset (Finset α)
s t u : Finset α
a b✝ : α
hst : { ofColex := s } ≤ { ofColex := t }
htu : { ofColex := t } ≤ { ofColex := u }
has : a ∈ s
hat : a ∉ t
s' : Finset α := filter (fun b => b ∉ t ∧ a ≤ b) s
b : α
hb : b ∈ s ∧ b ∉ t ∧ a ≤ b
hbmax : ∀ x ∈ s, x ∉ t → a ≤ x → ¬b < x
⊢ ∃ b ∈ u, b ∉ s ∧ a ≤ b

Next tactic:
have ⟨c, hct, hcs, hbc⟩ := hst hb.1 hb.2.1
private lemma trans_aux (hst : toColex s ≤ toColex t) (htu : toColex t ≤ toColex u)
    (has : a ∈ s) (hat : a ∉ t) : ∃ b, b ∈ u ∧ b ∉ s ∧ a ≤ b := by
  classical
  let s' : Finset α := s.filter fun b ↦ b ∉ t ∧ a ≤ b
  have ⟨b, hb, hbmax⟩ := exists_maximal s' ⟨a, by simp [has, hat]⟩
  simp only [mem_filter, and_imp] at hb hbmax
  have ⟨c, hct, hcs, hbc⟩ := hst hb.1 hb.2.1
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : PartialOrder α
inst✝ : PartialOrder β
f : α → β
𝒜 𝒜₁ 𝒜₂ : Finset (Finset α)
s t u : Finset α
a b✝ : α
hst : { ofColex := s } ≤ { ofColex := t }
htu : { ofColex := t } ≤ { ofColex := u }
has : a ∈ s
hat : a ∉ t
s' : Finset α := filter (fun b => b ∉ t ∧ a ≤ b) s
b : α
hb : b ∈ s ∧ b ∉ t ∧ a ≤ b
hbmax : ∀ x ∈ s, x ∉ t → a ≤ x → ¬b < x
c : α
hct : c ∈ { ofColex := t }.ofColex
hcs : c ∉ { ofColex := s }.ofColex
hbc : b ≤ c
⊢ ∃ b ∈ u, b ∉ s ∧ a ≤ b

Next tactic:
by_cases hcu : c ∈ u
private lemma trans_aux (hst : toColex s ≤ toColex t) (htu : toColex t ≤ toColex u)
    (has : a ∈ s) (hat : a ∉ t) : ∃ b, b ∈ u ∧ b ∉ s ∧ a ≤ b := by
  classical
  let s' : Finset α := s.filter fun b ↦ b ∉ t ∧ a ≤ b
  have ⟨b, hb, hbmax⟩ := exists_maximal s' ⟨a, by simp [has, hat]⟩
  simp only [mem_filter, and_imp] at hb hbmax
  have ⟨c, hct, hcs, hbc⟩ := hst hb.1 hb.2.1
  by_cases hcu : c ∈ u
  · 

Proof state:
case pos
α : Type u_1
β : Type u_2
inst✝¹ : PartialOrder α
inst✝ : PartialOrder β
f : α → β
𝒜 𝒜₁ 𝒜₂ : Finset (Finset α)
s t u : Finset α
a b✝ : α
hst : { ofColex := s } ≤ { ofColex := t }
htu : { ofColex := t } ≤ { ofColex := u }
has : a ∈ s
hat : a ∉ t
s' : Finset α := filter (fun b => b ∉ t ∧ a ≤ b) s
b : α
hb : b ∈ s ∧ b ∉ t ∧ a ≤ b
hbmax : ∀ x ∈ s, x ∉ t → a ≤ x → ¬b < x
c : α
hct : c ∈ { ofColex := t }.ofColex
hcs : c ∉ { ofColex := s }.ofColex
hbc : b ≤ c
hcu : c ∈ u
⊢ ∃ b ∈ u, b ∉ s ∧ a ≤ b

Next tactic:
exact ⟨c, hcu, hcs, hb.2.2.trans hbc⟩
private lemma trans_aux (hst : toColex s ≤ toColex t) (htu : toColex t ≤ toColex u)
    (has : a ∈ s) (hat : a ∉ t) : ∃ b, b ∈ u ∧ b ∉ s ∧ a ≤ b := by
  classical
  let s' : Finset α := s.filter fun b ↦ b ∉ t ∧ a ≤ b
  have ⟨b, hb, hbmax⟩ := exists_maximal s' ⟨a, by simp [has, hat]⟩
  simp only [mem_filter, and_imp] at hb hbmax
  have ⟨c, hct, hcs, hbc⟩ := hst hb.1 hb.2.1
  by_cases hcu : c ∈ u
  · exact ⟨c, hcu, hcs, hb.2.2.trans hbc⟩
  

Proof state:
case neg
α : Type u_1
β : Type u_2
inst✝¹ : PartialOrder α
inst✝ : PartialOrder β
f : α → β
𝒜 𝒜₁ 𝒜₂ : Finset (Finset α)
s t u : Finset α
a b✝ : α
hst : { ofColex := s } ≤ { ofColex := t }
htu : { ofColex := t } ≤ { ofColex := u }
has : a ∈ s
hat : a ∉ t
s' : Finset α := filter (fun b => b ∉ t ∧ a ≤ b) s
b : α
hb : b ∈ s ∧ b ∉ t ∧ a ≤ b
hbmax : ∀ x ∈ s, x ∉ t → a ≤ x → ¬b < x
c : α
hct : c ∈ { ofColex := t }.ofColex
hcs : c ∉ { ofColex := s }.ofColex
hbc : b ≤ c
hcu : c ∉ u
⊢ ∃ b ∈ u, b ∉ s ∧ a ≤ b

Next tactic:
have ⟨d, hdu, hdt, hcd⟩ := htu hct hcu
private lemma trans_aux (hst : toColex s ≤ toColex t) (htu : toColex t ≤ toColex u)
    (has : a ∈ s) (hat : a ∉ t) : ∃ b, b ∈ u ∧ b ∉ s ∧ a ≤ b := by
  classical
  let s' : Finset α := s.filter fun b ↦ b ∉ t ∧ a ≤ b
  have ⟨b, hb, hbmax⟩ := exists_maximal s' ⟨a, by simp [has, hat]⟩
  simp only [mem_filter, and_imp] at hb hbmax
  have ⟨c, hct, hcs, hbc⟩ := hst hb.1 hb.2.1
  by_cases hcu : c ∈ u
  · exact ⟨c, hcu, hcs, hb.2.2.trans hbc⟩
  have ⟨d, hdu, hdt, hcd⟩ := htu hct hcu
  

Proof state:
case neg
α : Type u_1
β : Type u_2
inst✝¹ : PartialOrder α
inst✝ : PartialOrder β
f : α → β
𝒜 𝒜₁ 𝒜₂ : Finset (Finset α)
s t u : Finset α
a b✝ : α
hst : { ofColex := s } ≤ { ofColex := t }
htu : { ofColex := t } ≤ { ofColex := u }
has : a ∈ s
hat : a ∉ t
s' : Finset α := filter (fun b => b ∉ t ∧ a ≤ b) s
b : α
hb : b ∈ s ∧ b ∉ t ∧ a ≤ b
hbmax : ∀ x ∈ s, x ∉ t → a ≤ x → ¬b < x
c : α
hct : c ∈ { ofColex := t }.ofColex
hcs : c ∉ { ofColex := s }.ofColex
hbc : b ≤ c
hcu : c ∉ u
d : α
hdu : d ∈ { ofColex := u }.ofColex
hdt : d ∉ { ofColex := t }.ofColex
hcd : c ≤ d
⊢ ∃ b ∈ u, b ∉ s ∧ a ≤ b

Next tactic:
have had : a ≤ d := hb.2.2.trans <| hbc.trans hcd
private lemma trans_aux (hst : toColex s ≤ toColex t) (htu : toColex t ≤ toColex u)
    (has : a ∈ s) (hat : a ∉ t) : ∃ b, b ∈ u ∧ b ∉ s ∧ a ≤ b := by
  classical
  let s' : Finset α := s.filter fun b ↦ b ∉ t ∧ a ≤ b
  have ⟨b, hb, hbmax⟩ := exists_maximal s' ⟨a, by simp [has, hat]⟩
  simp only [mem_filter, and_imp] at hb hbmax
  have ⟨c, hct, hcs, hbc⟩ := hst hb.1 hb.2.1
  by_cases hcu : c ∈ u
  · exact ⟨c, hcu, hcs, hb.2.2.trans hbc⟩
  have ⟨d, hdu, hdt, hcd⟩ := htu hct hcu
  have had : a ≤ d := hb.2.2.trans <| hbc.trans hcd
  

Proof state:
case neg
α : Type u_1
β : Type u_2
inst✝¹ : PartialOrder α
inst✝ : PartialOrder β
f : α → β
𝒜 𝒜₁ 𝒜₂ : Finset (Finset α)
s t u : Finset α
a b✝ : α
hst : { ofColex := s } ≤ { ofColex := t }
htu : { ofColex := t } ≤ { ofColex := u }
has : a ∈ s
hat : a ∉ t
s' : Finset α := filter (fun b => b ∉ t ∧ a ≤ b) s
b : α
hb : b ∈ s ∧ b ∉ t ∧ a ≤ b
hbmax : ∀ x ∈ s, x ∉ t → a ≤ x → ¬b < x
c : α
hct : c ∈ { ofColex := t }.ofColex
hcs : c ∉ { ofColex := s }.ofColex
hbc : b ≤ c
hcu : c ∉ u
d : α
hdu : d ∈ { ofColex := u }.ofColex
hdt : d ∉ { ofColex := t }.ofColex
hcd : c ≤ d
had : a ≤ d
⊢ ∃ b ∈ u, b ∉ s ∧ a ≤ b

Next tactic:
refine ⟨d, hdu, fun hds ↦ ?_, had⟩
private lemma trans_aux (hst : toColex s ≤ toColex t) (htu : toColex t ≤ toColex u)
    (has : a ∈ s) (hat : a ∉ t) : ∃ b, b ∈ u ∧ b ∉ s ∧ a ≤ b := by
  classical
  let s' : Finset α := s.filter fun b ↦ b ∉ t ∧ a ≤ b
  have ⟨b, hb, hbmax⟩ := exists_maximal s' ⟨a, by simp [has, hat]⟩
  simp only [mem_filter, and_imp] at hb hbmax
  have ⟨c, hct, hcs, hbc⟩ := hst hb.1 hb.2.1
  by_cases hcu : c ∈ u
  · exact ⟨c, hcu, hcs, hb.2.2.trans hbc⟩
  have ⟨d, hdu, hdt, hcd⟩ := htu hct hcu
  have had : a ≤ d := hb.2.2.trans <| hbc.trans hcd
  refine ⟨d, hdu, fun hds ↦ ?_, had⟩
  

Proof state:
case neg
α : Type u_1
β : Type u_2
inst✝¹ : PartialOrder α
inst✝ : PartialOrder β
f : α → β
𝒜 𝒜₁ 𝒜₂ : Finset (Finset α)
s t u : Finset α
a b✝ : α
hst : { ofColex := s } ≤ { ofColex := t }
htu : { ofColex := t } ≤ { ofColex := u }
has : a ∈ s
hat : a ∉ t
s' : Finset α := filter (fun b => b ∉ t ∧ a ≤ b) s
b : α
hb : b ∈ s ∧ b ∉ t ∧ a ≤ b
hbmax : ∀ x ∈ s, x ∉ t → a ≤ x → ¬b < x
c : α
hct : c ∈ { ofColex := t }.ofColex
hcs : c ∉ { ofColex := s }.ofColex
hbc : b ≤ c
hcu : c ∉ u
d : α
hdu : d ∈ { ofColex := u }.ofColex
hdt : d ∉ { ofColex := t }.ofColex
hcd : c ≤ d
had : a ≤ d
hds : d ∈ s
⊢ False

Next tactic:
exact hbmax d hds hdt had <| hbc.trans_lt <| hcd.lt_of_ne <| ne_of_mem_of_not_mem hct hdt
private lemma antisymm_aux (hst : toColex s ≤ toColex t) (hts : toColex t ≤ toColex s) : s ⊆ t := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : PartialOrder α
inst✝ : PartialOrder β
f : α → β
𝒜 𝒜₁ 𝒜₂ : Finset (Finset α)
s t u : Finset α
a b : α
hst : { ofColex := s } ≤ { ofColex := t }
hts : { ofColex := t } ≤ { ofColex := s }
⊢ s ⊆ t

Next tactic:
intro a has
private lemma antisymm_aux (hst : toColex s ≤ toColex t) (hts : toColex t ≤ toColex s) : s ⊆ t := by
  intro a has
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : PartialOrder α
inst✝ : PartialOrder β
f : α → β
𝒜 𝒜₁ 𝒜₂ : Finset (Finset α)
s t u : Finset α
a✝ b : α
hst : { ofColex := s } ≤ { ofColex := t }
hts : { ofColex := t } ≤ { ofColex := s }
a : α
has : a ∈ s
⊢ a ∈ t

Next tactic:
by_contra! hat
private lemma antisymm_aux (hst : toColex s ≤ toColex t) (hts : toColex t ≤ toColex s) : s ⊆ t := by
  intro a has
  by_contra! hat
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : PartialOrder α
inst✝ : PartialOrder β
f : α → β
𝒜 𝒜₁ 𝒜₂ : Finset (Finset α)
s t u : Finset α
a✝ b : α
hst : { ofColex := s } ≤ { ofColex := t }
hts : { ofColex := t } ≤ { ofColex := s }
a : α
has : a ∈ s
hat : a ∉ t
⊢ False

Next tactic:
have ⟨_b, hb₁, hb₂, _⟩ := trans_aux hst hts has hat
private lemma antisymm_aux (hst : toColex s ≤ toColex t) (hts : toColex t ≤ toColex s) : s ⊆ t := by
  intro a has
  by_contra! hat
  have ⟨_b, hb₁, hb₂, _⟩ := trans_aux hst hts has hat
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : PartialOrder α
inst✝ : PartialOrder β
f : α → β
𝒜 𝒜₁ 𝒜₂ : Finset (Finset α)
s t u : Finset α
a✝ b : α
hst : { ofColex := s } ≤ { ofColex := t }
hts : { ofColex := t } ≤ { ofColex := s }
a : α
has : a ∈ s
hat : a ∉ t
_b : α
hb₁ : _b ∈ s
hb₂ : _b ∉ s
right✝ : a ≤ _b
⊢ False

Next tactic:
exact hb₂ hb₁
instance instPartialOrder : PartialOrder (Colex α) where
  le_refl s a ha ha' := (ha' ha).elim
  le_antisymm s t hst hts := Colex.ext _ _ <| (antisymm_aux hst hts).antisymm (antisymm_aux hts hst)
  le_trans s t u hst htu a has hau := by
    

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : PartialOrder α
inst✝ : PartialOrder β
f : α → β
𝒜 𝒜₁ 𝒜₂ : Finset (Finset α)
s✝ t✝ u✝ : Finset α
a✝ b : α
s t u : Colex α
hst : s ≤ t
htu : t ≤ u
a : α
has : a ∈ s.ofColex
hau : a ∉ u.ofColex
⊢ ∃ b ∈ u.ofColex, b ∉ s.ofColex ∧ a ≤ b

Next tactic:
by_cases hat : a ∈ ofColex t
instance instPartialOrder : PartialOrder (Colex α) where
  le_refl s a ha ha' := (ha' ha).elim
  le_antisymm s t hst hts := Colex.ext _ _ <| (antisymm_aux hst hts).antisymm (antisymm_aux hts hst)
  le_trans s t u hst htu a has hau := by
    by_cases hat : a ∈ ofColex t
    · 

Proof state:
case pos
α : Type u_1
β : Type u_2
inst✝¹ : PartialOrder α
inst✝ : PartialOrder β
f : α → β
𝒜 𝒜₁ 𝒜₂ : Finset (Finset α)
s✝ t✝ u✝ : Finset α
a✝ b : α
s t u : Colex α
hst : s ≤ t
htu : t ≤ u
a : α
has : a ∈ s.ofColex
hau : a ∉ u.ofColex
hat : a ∈ t.ofColex
⊢ ∃ b ∈ u.ofColex, b ∉ s.ofColex ∧ a ≤ b

Next tactic:
have ⟨b, hbu, hbt, hab⟩ := htu hat hau
instance instPartialOrder : PartialOrder (Colex α) where
  le_refl s a ha ha' := (ha' ha).elim
  le_antisymm s t hst hts := Colex.ext _ _ <| (antisymm_aux hst hts).antisymm (antisymm_aux hts hst)
  le_trans s t u hst htu a has hau := by
    by_cases hat : a ∈ ofColex t
    · have ⟨b, hbu, hbt, hab⟩ := htu hat hau
      

Proof state:
case pos
α : Type u_1
β : Type u_2
inst✝¹ : PartialOrder α
inst✝ : PartialOrder β
f : α → β
𝒜 𝒜₁ 𝒜₂ : Finset (Finset α)
s✝ t✝ u✝ : Finset α
a✝ b✝ : α
s t u : Colex α
hst : s ≤ t
htu : t ≤ u
a : α
has : a ∈ s.ofColex
hau : a ∉ u.ofColex
hat : a ∈ t.ofColex
b : α
hbu : b ∈ u.ofColex
hbt : b ∉ t.ofColex
hab : a ≤ b
⊢ ∃ b ∈ u.ofColex, b ∉ s.ofColex ∧ a ≤ b

Next tactic:
by_cases hbs : b ∈ ofColex s
instance instPartialOrder : PartialOrder (Colex α) where
  le_refl s a ha ha' := (ha' ha).elim
  le_antisymm s t hst hts := Colex.ext _ _ <| (antisymm_aux hst hts).antisymm (antisymm_aux hts hst)
  le_trans s t u hst htu a has hau := by
    by_cases hat : a ∈ ofColex t
    · have ⟨b, hbu, hbt, hab⟩ := htu hat hau
      by_cases hbs : b ∈ ofColex s
      · 

Proof state:
case pos
α : Type u_1
β : Type u_2
inst✝¹ : PartialOrder α
inst✝ : PartialOrder β
f : α → β
𝒜 𝒜₁ 𝒜₂ : Finset (Finset α)
s✝ t✝ u✝ : Finset α
a✝ b✝ : α
s t u : Colex α
hst : s ≤ t
htu : t ≤ u
a : α
has : a ∈ s.ofColex
hau : a ∉ u.ofColex
hat : a ∈ t.ofColex
b : α
hbu : b ∈ u.ofColex
hbt : b ∉ t.ofColex
hab : a ≤ b
hbs : b ∈ s.ofColex
⊢ ∃ b ∈ u.ofColex, b ∉ s.ofColex ∧ a ≤ b

Next tactic:
have ⟨c, hcu, hcs, hbc⟩ := trans_aux hst htu hbs hbt
instance instPartialOrder : PartialOrder (Colex α) where
  le_refl s a ha ha' := (ha' ha).elim
  le_antisymm s t hst hts := Colex.ext _ _ <| (antisymm_aux hst hts).antisymm (antisymm_aux hts hst)
  le_trans s t u hst htu a has hau := by
    by_cases hat : a ∈ ofColex t
    · have ⟨b, hbu, hbt, hab⟩ := htu hat hau
      by_cases hbs : b ∈ ofColex s
      · have ⟨c, hcu, hcs, hbc⟩ := trans_aux hst htu hbs hbt
        

Proof state:
case pos
α : Type u_1
β : Type u_2
inst✝¹ : PartialOrder α
inst✝ : PartialOrder β
f : α → β
𝒜 𝒜₁ 𝒜₂ : Finset (Finset α)
s✝ t✝ u✝ : Finset α
a✝ b✝ : α
s t u : Colex α
hst : s ≤ t
htu : t ≤ u
a : α
has : a ∈ s.ofColex
hau : a ∉ u.ofColex
hat : a ∈ t.ofColex
b : α
hbu : b ∈ u.ofColex
hbt : b ∉ t.ofColex
hab : a ≤ b
hbs : b ∈ s.ofColex
c : α
hcu : c ∈ u.ofColex
hcs : c ∉ s.ofColex
hbc : b ≤ c
⊢ ∃ b ∈ u.ofColex, b ∉ s.ofColex ∧ a ≤ b

Next tactic:
exact ⟨c, hcu, hcs, hab.trans hbc⟩
instance instPartialOrder : PartialOrder (Colex α) where
  le_refl s a ha ha' := (ha' ha).elim
  le_antisymm s t hst hts := Colex.ext _ _ <| (antisymm_aux hst hts).antisymm (antisymm_aux hts hst)
  le_trans s t u hst htu a has hau := by
    by_cases hat : a ∈ ofColex t
    · have ⟨b, hbu, hbt, hab⟩ := htu hat hau
      by_cases hbs : b ∈ ofColex s
      · have ⟨c, hcu, hcs, hbc⟩ := trans_aux hst htu hbs hbt
        exact ⟨c, hcu, hcs, hab.trans hbc⟩
      · 

Proof state:
case neg
α : Type u_1
β : Type u_2
inst✝¹ : PartialOrder α
inst✝ : PartialOrder β
f : α → β
𝒜 𝒜₁ 𝒜₂ : Finset (Finset α)
s✝ t✝ u✝ : Finset α
a✝ b✝ : α
s t u : Colex α
hst : s ≤ t
htu : t ≤ u
a : α
has : a ∈ s.ofColex
hau : a ∉ u.ofColex
hat : a ∈ t.ofColex
b : α
hbu : b ∈ u.ofColex
hbt : b ∉ t.ofColex
hab : a ≤ b
hbs : b ∉ s.ofColex
⊢ ∃ b ∈ u.ofColex, b ∉ s.ofColex ∧ a ≤ b

Next tactic:
exact ⟨b, hbu, hbs, hab⟩
instance instPartialOrder : PartialOrder (Colex α) where
  le_refl s a ha ha' := (ha' ha).elim
  le_antisymm s t hst hts := Colex.ext _ _ <| (antisymm_aux hst hts).antisymm (antisymm_aux hts hst)
  le_trans s t u hst htu a has hau := by
    by_cases hat : a ∈ ofColex t
    · have ⟨b, hbu, hbt, hab⟩ := htu hat hau
      by_cases hbs : b ∈ ofColex s
      · have ⟨c, hcu, hcs, hbc⟩ := trans_aux hst htu hbs hbt
        exact ⟨c, hcu, hcs, hab.trans hbc⟩
      · exact ⟨b, hbu, hbs, hab⟩
    · 

Proof state:
case neg
α : Type u_1
β : Type u_2
inst✝¹ : PartialOrder α
inst✝ : PartialOrder β
f : α → β
𝒜 𝒜₁ 𝒜₂ : Finset (Finset α)
s✝ t✝ u✝ : Finset α
a✝ b : α
s t u : Colex α
hst : s ≤ t
htu : t ≤ u
a : α
has : a ∈ s.ofColex
hau : a ∉ u.ofColex
hat : a ∉ t.ofColex
⊢ ∃ b ∈ u.ofColex, b ∉ s.ofColex ∧ a ≤ b

Next tactic:
exact trans_aux hst htu has hat
lemma toColex_lt_toColex :
    toColex s < toColex t ↔ s ≠ t ∧ ∀ ⦃a⦄, a ∈ s → a ∉ t → ∃ b, b ∈ t ∧ b ∉ s ∧ a ≤ b := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : PartialOrder α
inst✝ : PartialOrder β
f : α → β
𝒜 𝒜₁ 𝒜₂ : Finset (Finset α)
s t u : Finset α
a b : α
⊢ { ofColex := s } < { ofColex := t } ↔ s ≠ t ∧ ∀ ⦃a : α⦄, a ∈ s → a ∉ t → ∃ b ∈ t, b ∉ s ∧ a ≤ b

Next tactic:
simp [lt_iff_le_and_ne, toColex_le_toColex, and_comm]
instance instOrderBot : OrderBot (Colex α) where
  bot := toColex ∅
  bot_le s a ha := by 

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : PartialOrder α
inst✝ : PartialOrder β
f : α → β
𝒜 𝒜₁ 𝒜₂ : Finset (Finset α)
s✝ t u : Finset α
a✝ b : α
s : Colex α
a : α
ha : a ∈ ⊥.ofColex
⊢ a ∉ s.ofColex → ∃ b ∈ s.ofColex, b ∉ ⊥.ofColex ∧ a ≤ b

Next tactic:
cases ha
/-- If `s ≤ t` in colex, and all elements in `t` are small, then all elements in `s` are small. -/
lemma forall_le_mono (hst : toColex s ≤ toColex t) (ht : ∀ b ∈ t, b ≤ a) : ∀ b ∈ s, b ≤ a := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : PartialOrder α
inst✝ : PartialOrder β
f : α → β
𝒜 𝒜₁ 𝒜₂ : Finset (Finset α)
s t u : Finset α
a b : α
hst : { ofColex := s } ≤ { ofColex := t }
ht : ∀ b ∈ t, b ≤ a
⊢ ∀ b ∈ s, b ≤ a

Next tactic:
rintro b hb
/-- If `s ≤ t` in colex, and all elements in `t` are small, then all elements in `s` are small. -/
lemma forall_le_mono (hst : toColex s ≤ toColex t) (ht : ∀ b ∈ t, b ≤ a) : ∀ b ∈ s, b ≤ a := by
  rintro b hb
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : PartialOrder α
inst✝ : PartialOrder β
f : α → β
𝒜 𝒜₁ 𝒜₂ : Finset (Finset α)
s t u : Finset α
a b✝ : α
hst : { ofColex := s } ≤ { ofColex := t }
ht : ∀ b ∈ t, b ≤ a
b : α
hb : b ∈ s
⊢ b ≤ a

Next tactic:
by_cases b ∈ t
/-- If `s ≤ t` in colex, and all elements in `t` are small, then all elements in `s` are small. -/
lemma forall_le_mono (hst : toColex s ≤ toColex t) (ht : ∀ b ∈ t, b ≤ a) : ∀ b ∈ s, b ≤ a := by
  rintro b hb
  by_cases b ∈ t
  · 

Proof state:
case pos
α : Type u_1
β : Type u_2
inst✝¹ : PartialOrder α
inst✝ : PartialOrder β
f : α → β
𝒜 𝒜₁ 𝒜₂ : Finset (Finset α)
s t u : Finset α
a b✝ : α
hst : { ofColex := s } ≤ { ofColex := t }
ht : ∀ b ∈ t, b ≤ a
b : α
hb : b ∈ s
h✝ : b ∈ t
⊢ b ≤ a

Next tactic:
exact ht _ ‹_›
/-- If `s ≤ t` in colex, and all elements in `t` are small, then all elements in `s` are small. -/
lemma forall_le_mono (hst : toColex s ≤ toColex t) (ht : ∀ b ∈ t, b ≤ a) : ∀ b ∈ s, b ≤ a := by
  rintro b hb
  by_cases b ∈ t
  · exact ht _ ‹_›
  · 

Proof state:
case neg
α : Type u_1
β : Type u_2
inst✝¹ : PartialOrder α
inst✝ : PartialOrder β
f : α → β
𝒜 𝒜₁ 𝒜₂ : Finset (Finset α)
s t u : Finset α
a b✝ : α
hst : { ofColex := s } ≤ { ofColex := t }
ht : ∀ b ∈ t, b ≤ a
b : α
hb : b ∈ s
h✝ : b ∉ t
⊢ b ≤ a

Next tactic:
obtain ⟨c, hct, -, hbc⟩ := hst hb ‹_›
/-- If `s ≤ t` in colex, and all elements in `t` are small, then all elements in `s` are small. -/
lemma forall_le_mono (hst : toColex s ≤ toColex t) (ht : ∀ b ∈ t, b ≤ a) : ∀ b ∈ s, b ≤ a := by
  rintro b hb
  by_cases b ∈ t
  · exact ht _ ‹_›
  · obtain ⟨c, hct, -, hbc⟩ := hst hb ‹_›
    

Proof state:
case neg.intro.intro.intro
α : Type u_1
β : Type u_2
inst✝¹ : PartialOrder α
inst✝ : PartialOrder β
f : α → β
𝒜 𝒜₁ 𝒜₂ : Finset (Finset α)
s t u : Finset α
a b✝ : α
hst : { ofColex := s } ≤ { ofColex := t }
ht : ∀ b ∈ t, b ≤ a
b : α
hb : b ∈ s
h✝ : b ∉ t
c : α
hct : c ∈ { ofColex := t }.ofColex
hbc : b ≤ c
⊢ b ≤ a

Next tactic:
exact hbc.trans <| ht _ hct
/-- If `s ≤ t` in colex, and all elements in `t` are small, then all elements in `s` are small. -/
lemma forall_lt_mono (hst : toColex s ≤ toColex t) (ht : ∀ b ∈ t, b < a) : ∀ b ∈ s, b < a := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : PartialOrder α
inst✝ : PartialOrder β
f : α → β
𝒜 𝒜₁ 𝒜₂ : Finset (Finset α)
s t u : Finset α
a b : α
hst : { ofColex := s } ≤ { ofColex := t }
ht : ∀ b ∈ t, b < a
⊢ ∀ b ∈ s, b < a

Next tactic:
rintro b hb
/-- If `s ≤ t` in colex, and all elements in `t` are small, then all elements in `s` are small. -/
lemma forall_lt_mono (hst : toColex s ≤ toColex t) (ht : ∀ b ∈ t, b < a) : ∀ b ∈ s, b < a := by
  rintro b hb
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : PartialOrder α
inst✝ : PartialOrder β
f : α → β
𝒜 𝒜₁ 𝒜₂ : Finset (Finset α)
s t u : Finset α
a b✝ : α
hst : { ofColex := s } ≤ { ofColex := t }
ht : ∀ b ∈ t, b < a
b : α
hb : b ∈ s
⊢ b < a

Next tactic:
by_cases b ∈ t
/-- If `s ≤ t` in colex, and all elements in `t` are small, then all elements in `s` are small. -/
lemma forall_lt_mono (hst : toColex s ≤ toColex t) (ht : ∀ b ∈ t, b < a) : ∀ b ∈ s, b < a := by
  rintro b hb
  by_cases b ∈ t
  · 

Proof state:
case pos
α : Type u_1
β : Type u_2
inst✝¹ : PartialOrder α
inst✝ : PartialOrder β
f : α → β
𝒜 𝒜₁ 𝒜₂ : Finset (Finset α)
s t u : Finset α
a b✝ : α
hst : { ofColex := s } ≤ { ofColex := t }
ht : ∀ b ∈ t, b < a
b : α
hb : b ∈ s
h✝ : b ∈ t
⊢ b < a

Next tactic:
exact ht _ ‹_›
/-- If `s ≤ t` in colex, and all elements in `t` are small, then all elements in `s` are small. -/
lemma forall_lt_mono (hst : toColex s ≤ toColex t) (ht : ∀ b ∈ t, b < a) : ∀ b ∈ s, b < a := by
  rintro b hb
  by_cases b ∈ t
  · exact ht _ ‹_›
  · 

Proof state:
case neg
α : Type u_1
β : Type u_2
inst✝¹ : PartialOrder α
inst✝ : PartialOrder β
f : α → β
𝒜 𝒜₁ 𝒜₂ : Finset (Finset α)
s t u : Finset α
a b✝ : α
hst : { ofColex := s } ≤ { ofColex := t }
ht : ∀ b ∈ t, b < a
b : α
hb : b ∈ s
h✝ : b ∉ t
⊢ b < a

Next tactic:
obtain ⟨c, hct, -, hbc⟩ := hst hb ‹_›
/-- If `s ≤ t` in colex, and all elements in `t` are small, then all elements in `s` are small. -/
lemma forall_lt_mono (hst : toColex s ≤ toColex t) (ht : ∀ b ∈ t, b < a) : ∀ b ∈ s, b < a := by
  rintro b hb
  by_cases b ∈ t
  · exact ht _ ‹_›
  · obtain ⟨c, hct, -, hbc⟩ := hst hb ‹_›
    

Proof state:
case neg.intro.intro.intro
α : Type u_1
β : Type u_2
inst✝¹ : PartialOrder α
inst✝ : PartialOrder β
f : α → β
𝒜 𝒜₁ 𝒜₂ : Finset (Finset α)
s t u : Finset α
a b✝ : α
hst : { ofColex := s } ≤ { ofColex := t }
ht : ∀ b ∈ t, b < a
b : α
hb : b ∈ s
h✝ : b ∉ t
c : α
hct : c ∈ { ofColex := t }.ofColex
hbc : b ≤ c
⊢ b < a

Next tactic:
exact hbc.trans_lt <| ht _ hct