l3lab/ntp-mathlib huggingface dataset:
theorem liftRel_destruct_iff {R : α → β → Prop} {s : WSeq α} {t : WSeq β} :
    LiftRel R s t ↔ Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t) :=
  ⟨liftRel_destruct, fun h =>
    ⟨fun s t =>
      LiftRel R s t ∨ Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t),
      Or.inr h, fun {s t} h => by
      have h : Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t) := by
        cases' h with h h
        exact liftRel_destruct h
        assumption
      apply Computation.LiftRel.imp _ _ _ h
      

Proof state:
α : Type u
β : Type v
γ : Type w
R : α → β → Prop
s✝ : WSeq α
t✝ : WSeq β
h✝¹ : Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s✝) (destruct t✝)
s : WSeq α
t : WSeq β
h✝ : (fun s t => LiftRel R s t ∨ Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t)) s t
h : Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t)
⊢ ∀ {a : Option (α × WSeq α)} {b : Option (β × WSeq β)},
    LiftRelO R (LiftRel R) a b →
      LiftRelO R (fun s t => LiftRel R s t ∨ Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t)) a b

Next tactic:
intro a b
theorem liftRel_destruct_iff {R : α → β → Prop} {s : WSeq α} {t : WSeq β} :
    LiftRel R s t ↔ Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t) :=
  ⟨liftRel_destruct, fun h =>
    ⟨fun s t =>
      LiftRel R s t ∨ Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t),
      Or.inr h, fun {s t} h => by
      have h : Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t) := by
        cases' h with h h
        exact liftRel_destruct h
        assumption
      apply Computation.LiftRel.imp _ _ _ h
      intro a b
      

Proof state:
α : Type u
β : Type v
γ : Type w
R : α → β → Prop
s✝ : WSeq α
t✝ : WSeq β
h✝¹ : Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s✝) (destruct t✝)
s : WSeq α
t : WSeq β
h✝ : (fun s t => LiftRel R s t ∨ Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t)) s t
h : Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t)
a : Option (α × WSeq α)
b : Option (β × WSeq β)
⊢ LiftRelO R (LiftRel R) a b →
    LiftRelO R (fun s t => LiftRel R s t ∨ Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t)) a b

Next tactic:
apply LiftRelO.imp_right
theorem liftRel_destruct_iff {R : α → β → Prop} {s : WSeq α} {t : WSeq β} :
    LiftRel R s t ↔ Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t) :=
  ⟨liftRel_destruct, fun h =>
    ⟨fun s t =>
      LiftRel R s t ∨ Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t),
      Or.inr h, fun {s t} h => by
      have h : Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t) := by
        cases' h with h h
        exact liftRel_destruct h
        assumption
      apply Computation.LiftRel.imp _ _ _ h
      intro a b
      apply LiftRelO.imp_right
      

Proof state:
case H
α : Type u
β : Type v
γ : Type w
R : α → β → Prop
s✝ : WSeq α
t✝ : WSeq β
h✝¹ : Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s✝) (destruct t✝)
s : WSeq α
t : WSeq β
h✝ : (fun s t => LiftRel R s t ∨ Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t)) s t
h : Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t)
a : Option (α × WSeq α)
b : Option (β × WSeq β)
⊢ ∀ (s : WSeq α) (t : WSeq β),
    LiftRel R s t → LiftRel R s t ∨ Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t)

Next tactic:
intro s t
theorem liftRel_destruct_iff {R : α → β → Prop} {s : WSeq α} {t : WSeq β} :
    LiftRel R s t ↔ Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t) :=
  ⟨liftRel_destruct, fun h =>
    ⟨fun s t =>
      LiftRel R s t ∨ Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t),
      Or.inr h, fun {s t} h => by
      have h : Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t) := by
        cases' h with h h
        exact liftRel_destruct h
        assumption
      apply Computation.LiftRel.imp _ _ _ h
      intro a b
      apply LiftRelO.imp_right
      intro s t
      

Proof state:
case H
α : Type u
β : Type v
γ : Type w
R : α → β → Prop
s✝¹ : WSeq α
t✝¹ : WSeq β
h✝¹ : Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s✝¹) (destruct t✝¹)
s✝ : WSeq α
t✝ : WSeq β
h✝ : (fun s t => LiftRel R s t ∨ Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t)) s✝ t✝
h : Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s✝) (destruct t✝)
a : Option (α × WSeq α)
b : Option (β × WSeq β)
s : WSeq α
t : WSeq β
⊢ LiftRel R s t → LiftRel R s t ∨ Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t)

Next tactic:
apply Or.inl
theorem LiftRel.refl (R : α → α → Prop) (H : Reflexive R) : Reflexive (LiftRel R) := fun s => by
  

Proof state:
α : Type u
β : Type v
γ : Type w
R : α → α → Prop
H : Reflexive R
s : WSeq α
⊢ LiftRel R s s

Next tactic:
refine' ⟨(· = ·), rfl, fun {s t} (h : s = t) => _⟩
theorem LiftRel.refl (R : α → α → Prop) (H : Reflexive R) : Reflexive (LiftRel R) := fun s => by
  refine' ⟨(· = ·), rfl, fun {s t} (h : s = t) => _⟩
  

Proof state:
α : Type u
β : Type v
γ : Type w
R : α → α → Prop
H : Reflexive R
s✝ s t : WSeq α
h : s = t
⊢ Computation.LiftRel (LiftRelO R fun x x_1 => x = x_1) (destruct s) (destruct t)

Next tactic:
rw [← h]
theorem LiftRel.refl (R : α → α → Prop) (H : Reflexive R) : Reflexive (LiftRel R) := fun s => by
  refine' ⟨(· = ·), rfl, fun {s t} (h : s = t) => _⟩
  rw [← h]
  

Proof state:
α : Type u
β : Type v
γ : Type w
R : α → α → Prop
H : Reflexive R
s✝ s t : WSeq α
h : s = t
⊢ Computation.LiftRel (LiftRelO R fun x x_1 => x = x_1) (destruct s) (destruct s)

Next tactic:
apply Computation.LiftRel.refl
theorem LiftRel.refl (R : α → α → Prop) (H : Reflexive R) : Reflexive (LiftRel R) := fun s => by
  refine' ⟨(· = ·), rfl, fun {s t} (h : s = t) => _⟩
  rw [← h]
  apply Computation.LiftRel.refl
  

Proof state:
case H
α : Type u
β : Type v
γ : Type w
R : α → α → Prop
H : Reflexive R
s✝ s t : WSeq α
h : s = t
⊢ Reflexive (LiftRelO R fun x x_1 => x = x_1)

Next tactic:
intro a
theorem LiftRel.refl (R : α → α → Prop) (H : Reflexive R) : Reflexive (LiftRel R) := fun s => by
  refine' ⟨(· = ·), rfl, fun {s t} (h : s = t) => _⟩
  rw [← h]
  apply Computation.LiftRel.refl
  intro a
  

Proof state:
case H
α : Type u
β : Type v
γ : Type w
R : α → α → Prop
H : Reflexive R
s✝ s t : WSeq α
h : s = t
a : Option (α × WSeq α)
⊢ LiftRelO R (fun x x_1 => x = x_1) a a

Next tactic:
cases' a with a
theorem LiftRel.refl (R : α → α → Prop) (H : Reflexive R) : Reflexive (LiftRel R) := fun s => by
  refine' ⟨(· = ·), rfl, fun {s t} (h : s = t) => _⟩
  rw [← h]
  apply Computation.LiftRel.refl
  intro a
  cases' a with a
  · 

Proof state:
case H.none
α : Type u
β : Type v
γ : Type w
R : α → α → Prop
H : Reflexive R
s✝ s t : WSeq α
h : s = t
⊢ LiftRelO R (fun x x_1 => x = x_1) none none

Next tactic:
simp
theorem LiftRel.refl (R : α → α → Prop) (H : Reflexive R) : Reflexive (LiftRel R) := fun s => by
  refine' ⟨(· = ·), rfl, fun {s t} (h : s = t) => _⟩
  rw [← h]
  apply Computation.LiftRel.refl
  intro a
  cases' a with a
  · simp
  · 

Proof state:
case H.some
α : Type u
β : Type v
γ : Type w
R : α → α → Prop
H : Reflexive R
s✝ s t : WSeq α
h : s = t
a : α × WSeq α
⊢ LiftRelO R (fun x x_1 => x = x_1) (some a) (some a)

Next tactic:
cases a
theorem LiftRel.refl (R : α → α → Prop) (H : Reflexive R) : Reflexive (LiftRel R) := fun s => by
  refine' ⟨(· = ·), rfl, fun {s t} (h : s = t) => _⟩
  rw [← h]
  apply Computation.LiftRel.refl
  intro a
  cases' a with a
  · simp
  · cases a
    

Proof state:
case H.some.mk
α : Type u
β : Type v
γ : Type w
R : α → α → Prop
H : Reflexive R
s✝ s t : WSeq α
h : s = t
fst✝ : α
snd✝ : WSeq α
⊢ LiftRelO R (fun x x_1 => x = x_1) (some (fst✝, snd✝)) (some (fst✝, snd✝))

Next tactic:
simp only [LiftRelO, and_true]
theorem LiftRel.refl (R : α → α → Prop) (H : Reflexive R) : Reflexive (LiftRel R) := fun s => by
  refine' ⟨(· = ·), rfl, fun {s t} (h : s = t) => _⟩
  rw [← h]
  apply Computation.LiftRel.refl
  intro a
  cases' a with a
  · simp
  · cases a
    simp only [LiftRelO, and_true]
    

Proof state:
case H.some.mk
α : Type u
β : Type v
γ : Type w
R : α → α → Prop
H : Reflexive R
s✝ s t : WSeq α
h : s = t
fst✝ : α
snd✝ : WSeq α
⊢ R fst✝ fst✝

Next tactic:
apply H
theorem LiftRelO.swap (R : α → β → Prop) (C) :
    swap (LiftRelO R C) = LiftRelO (swap R) (swap C) := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
R : α → β → Prop
C : WSeq α → WSeq β → Prop
⊢ Function.swap (LiftRelO R C) = LiftRelO (Function.swap R) (Function.swap C)

Next tactic:
funext x y
theorem LiftRelO.swap (R : α → β → Prop) (C) :
    swap (LiftRelO R C) = LiftRelO (swap R) (swap C) := by
  funext x y
  

Proof state:
case h.h
α : Type u
β : Type v
γ : Type w
R : α → β → Prop
C : WSeq α → WSeq β → Prop
x : Option (β × WSeq β)
y : Option (α × WSeq α)
⊢ Function.swap (LiftRelO R C) x y = LiftRelO (Function.swap R) (Function.swap C) x y

Next tactic:
cases' x with x <;> [skip; cases x]
theorem LiftRelO.swap (R : α → β → Prop) (C) :
    swap (LiftRelO R C) = LiftRelO (swap R) (swap C) := by
  funext x y
  

Proof state:
case h.h
α : Type u
β : Type v
γ : Type w
R : α → β → Prop
C : WSeq α → WSeq β → Prop
x : Option (β × WSeq β)
y : Option (α × WSeq α)
⊢ Function.swap (LiftRelO R C) x y = LiftRelO (Function.swap R) (Function.swap C) x y

Next tactic:
cases' x with x
theorem LiftRelO.swap (R : α → β → Prop) (C) :
    swap (LiftRelO R C) = LiftRelO (swap R) (swap C) := by
  funext x y
  cases' x with x <;> [

Proof state:
case h.h.none
α : Type u
β : Type v
γ : Type w
R : α → β → Prop
C : WSeq α → WSeq β → Prop
y : Option (α × WSeq α)
⊢ Function.swap (LiftRelO R C) none y = LiftRelO (Function.swap R) (Function.swap C) none y

Next tactic:
skip
theorem LiftRelO.swap (R : α → β → Prop) (C) :
    swap (LiftRelO R C) = LiftRelO (swap R) (swap C) := by
  funext x y
  cases' x with x <;> [skip; 

Proof state:
case h.h.some
α : Type u
β : Type v
γ : Type w
R : α → β → Prop
C : WSeq α → WSeq β → Prop
y : Option (α × WSeq α)
x : β × WSeq β
⊢ Function.swap (LiftRelO R C) (some x) y = LiftRelO (Function.swap R) (Function.swap C) (some x) y

Next tactic:
cases x
theorem LiftRelO.swap (R : α → β → Prop) (C) :
    swap (LiftRelO R C) = LiftRelO (swap R) (swap C) := by
  funext x y
  cases' x with x <;> [skip; cases x] <;>
    (

Proof state:
case h.h.none
α : Type u
β : Type v
γ : Type w
R : α → β → Prop
C : WSeq α → WSeq β → Prop
y : Option (α × WSeq α)
⊢ Function.swap (LiftRelO R C) none y = LiftRelO (Function.swap R) (Function.swap C) none y

Next tactic:
cases' y with y <;> [skip; cases y]
theorem LiftRelO.swap (R : α → β → Prop) (C) :
    swap (LiftRelO R C) = LiftRelO (swap R) (swap C) := by
  funext x y
  cases' x with x <;> [skip; cases x] <;>
    (

Proof state:
case h.h.none
α : Type u
β : Type v
γ : Type w
R : α → β → Prop
C : WSeq α → WSeq β → Prop
y : Option (α × WSeq α)
⊢ Function.swap (LiftRelO R C) none y = LiftRelO (Function.swap R) (Function.swap C) none y

Next tactic:
cases' y with y
theorem LiftRelO.swap (R : α → β → Prop) (C) :
    swap (LiftRelO R C) = LiftRelO (swap R) (swap C) := by
  funext x y
  cases' x with x <;> [skip; cases x] <;>
    (cases' y with y <;> [

Proof state:
case h.h.none.none
α : Type u
β : Type v
γ : Type w
R : α → β → Prop
C : WSeq α → WSeq β → Prop
⊢ Function.swap (LiftRelO R C) none none = LiftRelO (Function.swap R) (Function.swap C) none none

Next tactic:
skip
theorem LiftRelO.swap (R : α → β → Prop) (C) :
    swap (LiftRelO R C) = LiftRelO (swap R) (swap C) := by
  funext x y
  cases' x with x <;> [skip; cases x] <;>
    (cases' y with y <;> [skip; 

Proof state:
case h.h.none.some
α : Type u
β : Type v
γ : Type w
R : α → β → Prop
C : WSeq α → WSeq β → Prop
y : α × WSeq α
⊢ Function.swap (LiftRelO R C) none (some y) = LiftRelO (Function.swap R) (Function.swap C) none (some y)

Next tactic:
cases y
theorem LiftRelO.swap (R : α → β → Prop) (C) :
    swap (LiftRelO R C) = LiftRelO (swap R) (swap C) := by
  funext x y
  cases' x with x <;> [skip; cases x] <;>
    (cases' y with y <;> [skip; cases y] <;> 

Proof state:
case h.h.none.none
α : Type u
β : Type v
γ : Type w
R : α → β → Prop
C : WSeq α → WSeq β → Prop
⊢ Function.swap (LiftRelO R C) none none = LiftRelO (Function.swap R) (Function.swap C) none none

Next tactic:
rfl
theorem LiftRelO.swap (R : α → β → Prop) (C) :
    swap (LiftRelO R C) = LiftRelO (swap R) (swap C) := by
  funext x y
  cases' x with x <;> [skip; cases x] <;>
    (cases' y with y <;> [skip; cases y] <;> 

Proof state:
case h.h.none.some.mk
α : Type u
β : Type v
γ : Type w
R : α → β → Prop
C : WSeq α → WSeq β → Prop
fst✝ : α
snd✝ : WSeq α
⊢ Function.swap (LiftRelO R C) none (some (fst✝, snd✝)) =
    LiftRelO (Function.swap R) (Function.swap C) none (some (fst✝, snd✝))

Next tactic:
rfl
theorem LiftRelO.swap (R : α → β → Prop) (C) :
    swap (LiftRelO R C) = LiftRelO (swap R) (swap C) := by
  funext x y
  cases' x with x <;> [skip; cases x] <;>
    (

Proof state:
case h.h.some.mk
α : Type u
β : Type v
γ : Type w
R : α → β → Prop
C : WSeq α → WSeq β → Prop
y : Option (α × WSeq α)
fst✝ : β
snd✝ : WSeq β
⊢ Function.swap (LiftRelO R C) (some (fst✝, snd✝)) y =
    LiftRelO (Function.swap R) (Function.swap C) (some (fst✝, snd✝)) y

Next tactic:
cases' y with y <;> [skip; cases y]
theorem LiftRelO.swap (R : α → β → Prop) (C) :
    swap (LiftRelO R C) = LiftRelO (swap R) (swap C) := by
  funext x y
  cases' x with x <;> [skip; cases x] <;>
    (

Proof state:
case h.h.some.mk
α : Type u
β : Type v
γ : Type w
R : α → β → Prop
C : WSeq α → WSeq β → Prop
y : Option (α × WSeq α)
fst✝ : β
snd✝ : WSeq β
⊢ Function.swap (LiftRelO R C) (some (fst✝, snd✝)) y =
    LiftRelO (Function.swap R) (Function.swap C) (some (fst✝, snd✝)) y

Next tactic:
cases' y with y
theorem LiftRelO.swap (R : α → β → Prop) (C) :
    swap (LiftRelO R C) = LiftRelO (swap R) (swap C) := by
  funext x y
  cases' x with x <;> [skip; cases x] <;>
    (cases' y with y <;> [

Proof state:
case h.h.some.mk.none
α : Type u
β : Type v
γ : Type w
R : α → β → Prop
C : WSeq α → WSeq β → Prop
fst✝ : β
snd✝ : WSeq β
⊢ Function.swap (LiftRelO R C) (some (fst✝, snd✝)) none =
    LiftRelO (Function.swap R) (Function.swap C) (some (fst✝, snd✝)) none

Next tactic:
skip
theorem LiftRelO.swap (R : α → β → Prop) (C) :
    swap (LiftRelO R C) = LiftRelO (swap R) (swap C) := by
  funext x y
  cases' x with x <;> [skip; cases x] <;>
    (cases' y with y <;> [skip; 

Proof state:
case h.h.some.mk.some
α : Type u
β : Type v
γ : Type w
R : α → β → Prop
C : WSeq α → WSeq β → Prop
fst✝ : β
snd✝ : WSeq β
y : α × WSeq α
⊢ Function.swap (LiftRelO R C) (some (fst✝, snd✝)) (some y) =
    LiftRelO (Function.swap R) (Function.swap C) (some (fst✝, snd✝)) (some y)

Next tactic:
cases y
theorem LiftRelO.swap (R : α → β → Prop) (C) :
    swap (LiftRelO R C) = LiftRelO (swap R) (swap C) := by
  funext x y
  cases' x with x <;> [skip; cases x] <;>
    (cases' y with y <;> [skip; cases y] <;> 

Proof state:
case h.h.some.mk.none
α : Type u
β : Type v
γ : Type w
R : α → β → Prop
C : WSeq α → WSeq β → Prop
fst✝ : β
snd✝ : WSeq β
⊢ Function.swap (LiftRelO R C) (some (fst✝, snd✝)) none =
    LiftRelO (Function.swap R) (Function.swap C) (some (fst✝, snd✝)) none

Next tactic:
rfl
theorem LiftRelO.swap (R : α → β → Prop) (C) :
    swap (LiftRelO R C) = LiftRelO (swap R) (swap C) := by
  funext x y
  cases' x with x <;> [skip; cases x] <;>
    (cases' y with y <;> [skip; cases y] <;> 

Proof state:
case h.h.some.mk.some.mk
α : Type u
β : Type v
γ : Type w
R : α → β → Prop
C : WSeq α → WSeq β → Prop
fst✝¹ : β
snd✝¹ : WSeq β
fst✝ : α
snd✝ : WSeq α
⊢ Function.swap (LiftRelO R C) (some (fst✝¹, snd✝¹)) (some (fst✝, snd✝)) =
    LiftRelO (Function.swap R) (Function.swap C) (some (fst✝¹, snd✝¹)) (some (fst✝, snd✝))

Next tactic:
rfl
theorem LiftRel.swap_lem {R : α → β → Prop} {s1 s2} (h : LiftRel R s1 s2) :
    LiftRel (swap R) s2 s1 := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
R : α → β → Prop
s1 : WSeq α
s2 : WSeq β
h : LiftRel R s1 s2
⊢ LiftRel (swap R) s2 s1

Next tactic:
refine' ⟨swap (LiftRel R), h, fun {s t} (h : LiftRel R t s) => _⟩
theorem LiftRel.swap_lem {R : α → β → Prop} {s1 s2} (h : LiftRel R s1 s2) :
    LiftRel (swap R) s2 s1 := by
  refine' ⟨swap (LiftRel R), h, fun {s t} (h : LiftRel R t s) => _⟩
  

Proof state:
α : Type u
β : Type v
γ : Type w
R : α → β → Prop
s1 : WSeq α
s2 : WSeq β
h✝ : LiftRel R s1 s2
s : WSeq β
t : WSeq α
h : LiftRel R t s
⊢ Computation.LiftRel (LiftRelO (swap R) (swap (LiftRel R))) (destruct s) (destruct t)

Next tactic:
rw [← LiftRelO.swap, Computation.LiftRel.swap]
theorem LiftRel.swap_lem {R : α → β → Prop} {s1 s2} (h : LiftRel R s1 s2) :
    LiftRel (swap R) s2 s1 := by
  refine' ⟨swap (LiftRel R), h, fun {s t} (h : LiftRel R t s) => _⟩
  rw [← LiftRelO.swap, Computation.LiftRel.swap]
  

Proof state:
α : Type u
β : Type v
γ : Type w
R : α → β → Prop
s1 : WSeq α
s2 : WSeq β
h✝ : LiftRel R s1 s2
s : WSeq β
t : WSeq α
h : LiftRel R t s
⊢ Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct t) (destruct s)

Next tactic:
apply liftRel_destruct h
theorem LiftRel.symm (R : α → α → Prop) (H : Symmetric R) : Symmetric (LiftRel R) :=
  fun s1 s2 (h : Function.swap (LiftRel R) s2 s1) => by 

Proof state:
α : Type u
β : Type v
γ : Type w
R : α → α → Prop
H : Symmetric R
s1 s2 : WSeq α
h : Function.swap (LiftRel R) s2 s1
⊢ LiftRel R s2 s1

Next tactic:
rwa [LiftRel.swap, H.swap_eq] at h
theorem LiftRel.trans (R : α → α → Prop) (H : Transitive R) : Transitive (LiftRel R) :=
  fun s t u h1 h2 => by
  

Proof state:
α : Type u
β : Type v
γ : Type w
R : α → α → Prop
H : Transitive R
s t u : WSeq α
h1 : LiftRel R s t
h2 : LiftRel R t u
⊢ LiftRel R s u

Next tactic:
refine' ⟨fun s u => ∃ t, LiftRel R s t ∧ LiftRel R t u, ⟨t, h1, h2⟩, fun {s u} h => _⟩
theorem LiftRel.trans (R : α → α → Prop) (H : Transitive R) : Transitive (LiftRel R) :=
  fun s t u h1 h2 => by
  refine' ⟨fun s u => ∃ t, LiftRel R s t ∧ LiftRel R t u, ⟨t, h1, h2⟩, fun {s u} h => _⟩
  

Proof state:
α : Type u
β : Type v
γ : Type w
R : α → α → Prop
H : Transitive R
s✝ t u✝ : WSeq α
h1 : LiftRel R s✝ t
h2 : LiftRel R t u✝
s u : WSeq α
h : (fun s u => ∃ t, LiftRel R s t ∧ LiftRel R t u) s u
⊢ Computation.LiftRel (LiftRelO R fun s u => ∃ t, LiftRel R s t ∧ LiftRel R t u) (destruct s) (destruct u)

Next tactic:
rcases h with ⟨t, h1, h2⟩
theorem LiftRel.trans (R : α → α → Prop) (H : Transitive R) : Transitive (LiftRel R) :=
  fun s t u h1 h2 => by
  refine' ⟨fun s u => ∃ t, LiftRel R s t ∧ LiftRel R t u, ⟨t, h1, h2⟩, fun {s u} h => _⟩
  rcases h with ⟨t, h1, h2⟩
  

Proof state:
case intro.intro
α : Type u
β : Type v
γ : Type w
R : α → α → Prop
H : Transitive R
s✝ t✝ u✝ : WSeq α
h1✝ : LiftRel R s✝ t✝
h2✝ : LiftRel R t✝ u✝
s u t : WSeq α
h1 : LiftRel R s t
h2 : LiftRel R t u
⊢ Computation.LiftRel (LiftRelO R fun s u => ∃ t, LiftRel R s t ∧ LiftRel R t u) (destruct s) (destruct u)

Next tactic:
have h1 := liftRel_destruct h1
theorem LiftRel.trans (R : α → α → Prop) (H : Transitive R) : Transitive (LiftRel R) :=
  fun s t u h1 h2 => by
  refine' ⟨fun s u => ∃ t, LiftRel R s t ∧ LiftRel R t u, ⟨t, h1, h2⟩, fun {s u} h => _⟩
  rcases h with ⟨t, h1, h2⟩
  have h1 := liftRel_destruct h1
  

Proof state:
case intro.intro
α : Type u
β : Type v
γ : Type w
R : α → α → Prop
H : Transitive R
s✝ t✝ u✝ : WSeq α
h1✝¹ : LiftRel R s✝ t✝
h2✝ : LiftRel R t✝ u✝
s u t : WSeq α
h1✝ : LiftRel R s t
h2 : LiftRel R t u
h1 : Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t)
⊢ Computation.LiftRel (LiftRelO R fun s u => ∃ t, LiftRel R s t ∧ LiftRel R t u) (destruct s) (destruct u)

Next tactic:
have h2 := liftRel_destruct h2
theorem LiftRel.trans (R : α → α → Prop) (H : Transitive R) : Transitive (LiftRel R) :=
  fun s t u h1 h2 => by
  refine' ⟨fun s u => ∃ t, LiftRel R s t ∧ LiftRel R t u, ⟨t, h1, h2⟩, fun {s u} h => _⟩
  rcases h with ⟨t, h1, h2⟩
  have h1 := liftRel_destruct h1
  have h2 := liftRel_destruct h2
  

Proof state:
case intro.intro
α : Type u
β : Type v
γ : Type w
R : α → α → Prop
H : Transitive R
s✝ t✝ u✝ : WSeq α
h1✝¹ : LiftRel R s✝ t✝
h2✝¹ : LiftRel R t✝ u✝
s u t : WSeq α
h1✝ : LiftRel R s t
h2✝ : LiftRel R t u
h1 : Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t)
h2 : Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct t) (destruct u)
⊢ Computation.LiftRel (LiftRelO R fun s u => ∃ t, LiftRel R s t ∧ LiftRel R t u) (destruct s) (destruct u)

Next tactic:
refine'
    Computation.liftRel_def.2
      ⟨(Computation.terminates_of_liftRel h1).trans (Computation.terminates_of_liftRel h2),
        fun {a c} ha hc => _⟩
theorem LiftRel.trans (R : α → α → Prop) (H : Transitive R) : Transitive (LiftRel R) :=
  fun s t u h1 h2 => by
  refine' ⟨fun s u => ∃ t, LiftRel R s t ∧ LiftRel R t u, ⟨t, h1, h2⟩, fun {s u} h => _⟩
  rcases h with ⟨t, h1, h2⟩
  have h1 := liftRel_destruct h1
  have h2 := liftRel_destruct h2
  refine'
    Computation.liftRel_def.2
      ⟨(Computation.terminates_of_liftRel h1).trans (Computation.terminates_of_liftRel h2),
        fun {a c} ha hc => _⟩
  

Proof state:
case intro.intro
α : Type u
β : Type v
γ : Type w
R : α → α → Prop
H : Transitive R
s✝ t✝ u✝ : WSeq α
h1✝¹ : LiftRel R s✝ t✝
h2✝¹ : LiftRel R t✝ u✝
s u t : WSeq α
h1✝ : LiftRel R s t
h2✝ : LiftRel R t u
h1 : Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t)
h2 : Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct t) (destruct u)
a c : Option (α × WSeq α)
ha : a ∈ destruct s
hc : c ∈ destruct u
⊢ LiftRelO R (fun s u => ∃ t, LiftRel R s t ∧ LiftRel R t u) a c

Next tactic:
rcases h1.left ha with ⟨b, hb, t1⟩
theorem LiftRel.trans (R : α → α → Prop) (H : Transitive R) : Transitive (LiftRel R) :=
  fun s t u h1 h2 => by
  refine' ⟨fun s u => ∃ t, LiftRel R s t ∧ LiftRel R t u, ⟨t, h1, h2⟩, fun {s u} h => _⟩
  rcases h with ⟨t, h1, h2⟩
  have h1 := liftRel_destruct h1
  have h2 := liftRel_destruct h2
  refine'
    Computation.liftRel_def.2
      ⟨(Computation.terminates_of_liftRel h1).trans (Computation.terminates_of_liftRel h2),
        fun {a c} ha hc => _⟩
  rcases h1.left ha with ⟨b, hb, t1⟩
  

Proof state:
case intro.intro.intro.intro
α : Type u
β : Type v
γ : Type w
R : α → α → Prop
H : Transitive R
s✝ t✝ u✝ : WSeq α
h1✝¹ : LiftRel R s✝ t✝
h2✝¹ : LiftRel R t✝ u✝
s u t : WSeq α
h1✝ : LiftRel R s t
h2✝ : LiftRel R t u
h1 : Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t)
h2 : Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct t) (destruct u)
a c : Option (α × WSeq α)
ha : a ∈ destruct s
hc : c ∈ destruct u
b : Option (α × WSeq α)
hb : b ∈ destruct t
t1 : LiftRelO R (LiftRel R) a b
⊢ LiftRelO R (fun s u => ∃ t, LiftRel R s t ∧ LiftRel R t u) a c

Next tactic:
have t2 := Computation.rel_of_liftRel h2 hb hc
theorem LiftRel.trans (R : α → α → Prop) (H : Transitive R) : Transitive (LiftRel R) :=
  fun s t u h1 h2 => by
  refine' ⟨fun s u => ∃ t, LiftRel R s t ∧ LiftRel R t u, ⟨t, h1, h2⟩, fun {s u} h => _⟩
  rcases h with ⟨t, h1, h2⟩
  have h1 := liftRel_destruct h1
  have h2 := liftRel_destruct h2
  refine'
    Computation.liftRel_def.2
      ⟨(Computation.terminates_of_liftRel h1).trans (Computation.terminates_of_liftRel h2),
        fun {a c} ha hc => _⟩
  rcases h1.left ha with ⟨b, hb, t1⟩
  have t2 := Computation.rel_of_liftRel h2 hb hc
  

Proof state:
case intro.intro.intro.intro
α : Type u
β : Type v
γ : Type w
R : α → α → Prop
H : Transitive R
s✝ t✝ u✝ : WSeq α
h1✝¹ : LiftRel R s✝ t✝
h2✝¹ : LiftRel R t✝ u✝
s u t : WSeq α
h1✝ : LiftRel R s t
h2✝ : LiftRel R t u
h1 : Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct s) (destruct t)
h2 : Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct t) (destruct u)
a c : Option (α × WSeq α)
ha : a ∈ destruct s
hc : c ∈ destruct u
b : Option (α × WSeq α)
hb : b ∈ destruct t
t1 : LiftRelO R (LiftRel R) a b
t2 : LiftRelO R (LiftRel R) b c
⊢ LiftRelO R (fun s u => ∃ t, LiftRel R s t ∧ LiftRel R t u) a c

Next tactic:
cases' a with a