l3lab/ntp-mathlib huggingface dataset:
theorem liftr_iff {α : Type u} (r : α → α → Prop) (x y : F α) :
    Liftr r x y ↔ ∃ a f₀ f₁, x = abs ⟨a, f₀⟩ ∧ y = abs ⟨a, f₁⟩ ∧ ∀ i, r (f₀ i) (f₁ i) := by
  constructor
  · rintro ⟨u, xeq, yeq⟩
    cases' h : repr u with a f
    use a, fun i => (f i).val.fst, fun i => (f i).val.snd
    constructor
    · rw [← xeq, ← abs_repr u, h, ← abs_map]
      

Proof state:
case h.left
F : Type u → Type u
inst✝ : Functor F
q : QPF F
α : Type u
r : α → α → Prop
x y : F α
u : F { p // r p.1 p.2 }
xeq : (fun t => (↑t).1) <$> u = x
yeq : (fun t => (↑t).2) <$> u = y
a : (P F).A
f : PFunctor.B (P F) a → { p // r p.1 p.2 }
h : repr u = { fst := a, snd := f }
⊢ abs (PFunctor.map (P F) (fun t => (↑t).1) { fst := a, snd := f }) = abs { fst := a, snd := fun i => (↑(f i)).1 }

Next tactic:
rfl
theorem liftr_iff {α : Type u} (r : α → α → Prop) (x y : F α) :
    Liftr r x y ↔ ∃ a f₀ f₁, x = abs ⟨a, f₀⟩ ∧ y = abs ⟨a, f₁⟩ ∧ ∀ i, r (f₀ i) (f₁ i) := by
  constructor
  · rintro ⟨u, xeq, yeq⟩
    cases' h : repr u with a f
    use a, fun i => (f i).val.fst, fun i => (f i).val.snd
    constructor
    · rw [← xeq, ← abs_repr u, h, ← abs_map]
      rfl
    

Proof state:
case h.right
F : Type u → Type u
inst✝ : Functor F
q : QPF F
α : Type u
r : α → α → Prop
x y : F α
u : F { p // r p.1 p.2 }
xeq : (fun t => (↑t).1) <$> u = x
yeq : (fun t => (↑t).2) <$> u = y
a : (P F).A
f : PFunctor.B (P F) a → { p // r p.1 p.2 }
h : repr u = { fst := a, snd := f }
⊢ y = abs { fst := a, snd := fun i => (↑(f i)).2 } ∧ ∀ (i : PFunctor.B (P F) a), r (↑(f i)).1 (↑(f i)).2

Next tactic:
constructor
theorem liftr_iff {α : Type u} (r : α → α → Prop) (x y : F α) :
    Liftr r x y ↔ ∃ a f₀ f₁, x = abs ⟨a, f₀⟩ ∧ y = abs ⟨a, f₁⟩ ∧ ∀ i, r (f₀ i) (f₁ i) := by
  constructor
  · rintro ⟨u, xeq, yeq⟩
    cases' h : repr u with a f
    use a, fun i => (f i).val.fst, fun i => (f i).val.snd
    constructor
    · rw [← xeq, ← abs_repr u, h, ← abs_map]
      rfl
    constructor
    · 

Proof state:
case h.right.left
F : Type u → Type u
inst✝ : Functor F
q : QPF F
α : Type u
r : α → α → Prop
x y : F α
u : F { p // r p.1 p.2 }
xeq : (fun t => (↑t).1) <$> u = x
yeq : (fun t => (↑t).2) <$> u = y
a : (P F).A
f : PFunctor.B (P F) a → { p // r p.1 p.2 }
h : repr u = { fst := a, snd := f }
⊢ y = abs { fst := a, snd := fun i => (↑(f i)).2 }

Next tactic:
rw [← yeq, ← abs_repr u, h, ← abs_map]
theorem liftr_iff {α : Type u} (r : α → α → Prop) (x y : F α) :
    Liftr r x y ↔ ∃ a f₀ f₁, x = abs ⟨a, f₀⟩ ∧ y = abs ⟨a, f₁⟩ ∧ ∀ i, r (f₀ i) (f₁ i) := by
  constructor
  · rintro ⟨u, xeq, yeq⟩
    cases' h : repr u with a f
    use a, fun i => (f i).val.fst, fun i => (f i).val.snd
    constructor
    · rw [← xeq, ← abs_repr u, h, ← abs_map]
      rfl
    constructor
    · rw [← yeq, ← abs_repr u, h, ← abs_map]
      

Proof state:
case h.right.left
F : Type u → Type u
inst✝ : Functor F
q : QPF F
α : Type u
r : α → α → Prop
x y : F α
u : F { p // r p.1 p.2 }
xeq : (fun t => (↑t).1) <$> u = x
yeq : (fun t => (↑t).2) <$> u = y
a : (P F).A
f : PFunctor.B (P F) a → { p // r p.1 p.2 }
h : repr u = { fst := a, snd := f }
⊢ abs (PFunctor.map (P F) (fun t => (↑t).2) { fst := a, snd := f }) = abs { fst := a, snd := fun i => (↑(f i)).2 }

Next tactic:
rfl
theorem liftr_iff {α : Type u} (r : α → α → Prop) (x y : F α) :
    Liftr r x y ↔ ∃ a f₀ f₁, x = abs ⟨a, f₀⟩ ∧ y = abs ⟨a, f₁⟩ ∧ ∀ i, r (f₀ i) (f₁ i) := by
  constructor
  · rintro ⟨u, xeq, yeq⟩
    cases' h : repr u with a f
    use a, fun i => (f i).val.fst, fun i => (f i).val.snd
    constructor
    · rw [← xeq, ← abs_repr u, h, ← abs_map]
      rfl
    constructor
    · rw [← yeq, ← abs_repr u, h, ← abs_map]
      rfl
    

Proof state:
case h.right.right
F : Type u → Type u
inst✝ : Functor F
q : QPF F
α : Type u
r : α → α → Prop
x y : F α
u : F { p // r p.1 p.2 }
xeq : (fun t => (↑t).1) <$> u = x
yeq : (fun t => (↑t).2) <$> u = y
a : (P F).A
f : PFunctor.B (P F) a → { p // r p.1 p.2 }
h : repr u = { fst := a, snd := f }
⊢ ∀ (i : PFunctor.B (P F) a), r (↑(f i)).1 (↑(f i)).2

Next tactic:
intro i
theorem liftr_iff {α : Type u} (r : α → α → Prop) (x y : F α) :
    Liftr r x y ↔ ∃ a f₀ f₁, x = abs ⟨a, f₀⟩ ∧ y = abs ⟨a, f₁⟩ ∧ ∀ i, r (f₀ i) (f₁ i) := by
  constructor
  · rintro ⟨u, xeq, yeq⟩
    cases' h : repr u with a f
    use a, fun i => (f i).val.fst, fun i => (f i).val.snd
    constructor
    · rw [← xeq, ← abs_repr u, h, ← abs_map]
      rfl
    constructor
    · rw [← yeq, ← abs_repr u, h, ← abs_map]
      rfl
    intro i
    

Proof state:
case h.right.right
F : Type u → Type u
inst✝ : Functor F
q : QPF F
α : Type u
r : α → α → Prop
x y : F α
u : F { p // r p.1 p.2 }
xeq : (fun t => (↑t).1) <$> u = x
yeq : (fun t => (↑t).2) <$> u = y
a : (P F).A
f : PFunctor.B (P F) a → { p // r p.1 p.2 }
h : repr u = { fst := a, snd := f }
i : PFunctor.B (P F) a
⊢ r (↑(f i)).1 (↑(f i)).2

Next tactic:
exact (f i).property
theorem liftr_iff {α : Type u} (r : α → α → Prop) (x y : F α) :
    Liftr r x y ↔ ∃ a f₀ f₁, x = abs ⟨a, f₀⟩ ∧ y = abs ⟨a, f₁⟩ ∧ ∀ i, r (f₀ i) (f₁ i) := by
  constructor
  · rintro ⟨u, xeq, yeq⟩
    cases' h : repr u with a f
    use a, fun i => (f i).val.fst, fun i => (f i).val.snd
    constructor
    · rw [← xeq, ← abs_repr u, h, ← abs_map]
      rfl
    constructor
    · rw [← yeq, ← abs_repr u, h, ← abs_map]
      rfl
    intro i
    exact (f i).property
  

Proof state:
case mpr
F : Type u → Type u
inst✝ : Functor F
q : QPF F
α : Type u
r : α → α → Prop
x y : F α
⊢ (∃ a f₀ f₁,
      x = abs { fst := a, snd := f₀ } ∧ y = abs { fst := a, snd := f₁ } ∧ ∀ (i : PFunctor.B (P F) a), r (f₀ i) (f₁ i)) →
    Liftr r x y

Next tactic:
rintro ⟨a, f₀, f₁, xeq, yeq, h⟩
theorem liftr_iff {α : Type u} (r : α → α → Prop) (x y : F α) :
    Liftr r x y ↔ ∃ a f₀ f₁, x = abs ⟨a, f₀⟩ ∧ y = abs ⟨a, f₁⟩ ∧ ∀ i, r (f₀ i) (f₁ i) := by
  constructor
  · rintro ⟨u, xeq, yeq⟩
    cases' h : repr u with a f
    use a, fun i => (f i).val.fst, fun i => (f i).val.snd
    constructor
    · rw [← xeq, ← abs_repr u, h, ← abs_map]
      rfl
    constructor
    · rw [← yeq, ← abs_repr u, h, ← abs_map]
      rfl
    intro i
    exact (f i).property
  rintro ⟨a, f₀, f₁, xeq, yeq, h⟩
  

Proof state:
case mpr.intro.intro.intro.intro.intro
F : Type u → Type u
inst✝ : Functor F
q : QPF F
α : Type u
r : α → α → Prop
x y : F α
a : (P F).A
f₀ f₁ : PFunctor.B (P F) a → α
xeq : x = abs { fst := a, snd := f₀ }
yeq : y = abs { fst := a, snd := f₁ }
h : ∀ (i : PFunctor.B (P F) a), r (f₀ i) (f₁ i)
⊢ Liftr r x y

Next tactic:
use abs ⟨a, fun i => ⟨(f₀ i, f₁ i), h i⟩⟩
theorem liftr_iff {α : Type u} (r : α → α → Prop) (x y : F α) :
    Liftr r x y ↔ ∃ a f₀ f₁, x = abs ⟨a, f₀⟩ ∧ y = abs ⟨a, f₁⟩ ∧ ∀ i, r (f₀ i) (f₁ i) := by
  constructor
  · rintro ⟨u, xeq, yeq⟩
    cases' h : repr u with a f
    use a, fun i => (f i).val.fst, fun i => (f i).val.snd
    constructor
    · rw [← xeq, ← abs_repr u, h, ← abs_map]
      rfl
    constructor
    · rw [← yeq, ← abs_repr u, h, ← abs_map]
      rfl
    intro i
    exact (f i).property
  rintro ⟨a, f₀, f₁, xeq, yeq, h⟩
  use abs ⟨a, fun i => ⟨(f₀ i, f₁ i), h i⟩⟩
  

Proof state:
case h
F : Type u → Type u
inst✝ : Functor F
q : QPF F
α : Type u
r : α → α → Prop
x y : F α
a : (P F).A
f₀ f₁ : PFunctor.B (P F) a → α
xeq : x = abs { fst := a, snd := f₀ }
yeq : y = abs { fst := a, snd := f₁ }
h : ∀ (i : PFunctor.B (P F) a), r (f₀ i) (f₁ i)
⊢ (fun t => (↑t).1) <$> abs { fst := a, snd := fun i => { val := (f₀ i, f₁ i), property := (_ : r (f₀ i) (f₁ i)) } } =
      x ∧
    (fun t => (↑t).2) <$> abs { fst := a, snd := fun i => { val := (f₀ i, f₁ i), property := (_ : r (f₀ i) (f₁ i)) } } =
      y

Next tactic:
constructor
theorem liftr_iff {α : Type u} (r : α → α → Prop) (x y : F α) :
    Liftr r x y ↔ ∃ a f₀ f₁, x = abs ⟨a, f₀⟩ ∧ y = abs ⟨a, f₁⟩ ∧ ∀ i, r (f₀ i) (f₁ i) := by
  constructor
  · rintro ⟨u, xeq, yeq⟩
    cases' h : repr u with a f
    use a, fun i => (f i).val.fst, fun i => (f i).val.snd
    constructor
    · rw [← xeq, ← abs_repr u, h, ← abs_map]
      rfl
    constructor
    · rw [← yeq, ← abs_repr u, h, ← abs_map]
      rfl
    intro i
    exact (f i).property
  rintro ⟨a, f₀, f₁, xeq, yeq, h⟩
  use abs ⟨a, fun i => ⟨(f₀ i, f₁ i), h i⟩⟩
  constructor
  · 

Proof state:
case h.left
F : Type u → Type u
inst✝ : Functor F
q : QPF F
α : Type u
r : α → α → Prop
x y : F α
a : (P F).A
f₀ f₁ : PFunctor.B (P F) a → α
xeq : x = abs { fst := a, snd := f₀ }
yeq : y = abs { fst := a, snd := f₁ }
h : ∀ (i : PFunctor.B (P F) a), r (f₀ i) (f₁ i)
⊢ (fun t => (↑t).1) <$> abs { fst := a, snd := fun i => { val := (f₀ i, f₁ i), property := (_ : r (f₀ i) (f₁ i)) } } = x

Next tactic:
rw [xeq, ← abs_map]
theorem liftr_iff {α : Type u} (r : α → α → Prop) (x y : F α) :
    Liftr r x y ↔ ∃ a f₀ f₁, x = abs ⟨a, f₀⟩ ∧ y = abs ⟨a, f₁⟩ ∧ ∀ i, r (f₀ i) (f₁ i) := by
  constructor
  · rintro ⟨u, xeq, yeq⟩
    cases' h : repr u with a f
    use a, fun i => (f i).val.fst, fun i => (f i).val.snd
    constructor
    · rw [← xeq, ← abs_repr u, h, ← abs_map]
      rfl
    constructor
    · rw [← yeq, ← abs_repr u, h, ← abs_map]
      rfl
    intro i
    exact (f i).property
  rintro ⟨a, f₀, f₁, xeq, yeq, h⟩
  use abs ⟨a, fun i => ⟨(f₀ i, f₁ i), h i⟩⟩
  constructor
  · rw [xeq, ← abs_map]
    

Proof state:
case h.left
F : Type u → Type u
inst✝ : Functor F
q : QPF F
α : Type u
r : α → α → Prop
x y : F α
a : (P F).A
f₀ f₁ : PFunctor.B (P F) a → α
xeq : x = abs { fst := a, snd := f₀ }
yeq : y = abs { fst := a, snd := f₁ }
h : ∀ (i : PFunctor.B (P F) a), r (f₀ i) (f₁ i)
⊢ abs
      (PFunctor.map (P F) (fun t => (↑t).1)
        { fst := a, snd := fun i => { val := (f₀ i, f₁ i), property := (_ : r (f₀ i) (f₁ i)) } }) =
    abs { fst := a, snd := f₀ }

Next tactic:
rfl
theorem liftr_iff {α : Type u} (r : α → α → Prop) (x y : F α) :
    Liftr r x y ↔ ∃ a f₀ f₁, x = abs ⟨a, f₀⟩ ∧ y = abs ⟨a, f₁⟩ ∧ ∀ i, r (f₀ i) (f₁ i) := by
  constructor
  · rintro ⟨u, xeq, yeq⟩
    cases' h : repr u with a f
    use a, fun i => (f i).val.fst, fun i => (f i).val.snd
    constructor
    · rw [← xeq, ← abs_repr u, h, ← abs_map]
      rfl
    constructor
    · rw [← yeq, ← abs_repr u, h, ← abs_map]
      rfl
    intro i
    exact (f i).property
  rintro ⟨a, f₀, f₁, xeq, yeq, h⟩
  use abs ⟨a, fun i => ⟨(f₀ i, f₁ i), h i⟩⟩
  constructor
  · rw [xeq, ← abs_map]
    rfl
  

Proof state:
case h.right
F : Type u → Type u
inst✝ : Functor F
q : QPF F
α : Type u
r : α → α → Prop
x y : F α
a : (P F).A
f₀ f₁ : PFunctor.B (P F) a → α
xeq : x = abs { fst := a, snd := f₀ }
yeq : y = abs { fst := a, snd := f₁ }
h : ∀ (i : PFunctor.B (P F) a), r (f₀ i) (f₁ i)
⊢ (fun t => (↑t).2) <$> abs { fst := a, snd := fun i => { val := (f₀ i, f₁ i), property := (_ : r (f₀ i) (f₁ i)) } } = y

Next tactic:
rw [yeq, ← abs_map]
theorem liftr_iff {α : Type u} (r : α → α → Prop) (x y : F α) :
    Liftr r x y ↔ ∃ a f₀ f₁, x = abs ⟨a, f₀⟩ ∧ y = abs ⟨a, f₁⟩ ∧ ∀ i, r (f₀ i) (f₁ i) := by
  constructor
  · rintro ⟨u, xeq, yeq⟩
    cases' h : repr u with a f
    use a, fun i => (f i).val.fst, fun i => (f i).val.snd
    constructor
    · rw [← xeq, ← abs_repr u, h, ← abs_map]
      rfl
    constructor
    · rw [← yeq, ← abs_repr u, h, ← abs_map]
      rfl
    intro i
    exact (f i).property
  rintro ⟨a, f₀, f₁, xeq, yeq, h⟩
  use abs ⟨a, fun i => ⟨(f₀ i, f₁ i), h i⟩⟩
  constructor
  · rw [xeq, ← abs_map]
    rfl
  rw [yeq, ← abs_map]; 

Proof state:
case h.right
F : Type u → Type u
inst✝ : Functor F
q : QPF F
α : Type u
r : α → α → Prop
x y : F α
a : (P F).A
f₀ f₁ : PFunctor.B (P F) a → α
xeq : x = abs { fst := a, snd := f₀ }
yeq : y = abs { fst := a, snd := f₁ }
h : ∀ (i : PFunctor.B (P F) a), r (f₀ i) (f₁ i)
⊢ abs
      (PFunctor.map (P F) (fun t => (↑t).2)
        { fst := a, snd := fun i => { val := (f₀ i, f₁ i), property := (_ : r (f₀ i) (f₁ i)) } }) =
    abs { fst := a, snd := f₁ }

Next tactic:
rfl
theorem recF_eq {α : Type _} (g : F α → α) (x : q.P.W) :
    recF g x = g (abs (q.P.map (recF g) x.dest)) := by
  

Proof state:
F : Type u → Type u
inst✝ : Functor F
q : QPF F
α : Type u
g : F α → α
x : PFunctor.W (P F)
⊢ recF g x = g (abs (PFunctor.map (P F) (recF g) (PFunctor.W.dest x)))

Next tactic:
cases x
theorem recF_eq {α : Type _} (g : F α → α) (x : q.P.W) :
    recF g x = g (abs (q.P.map (recF g) x.dest)) := by
  cases x
  

Proof state:
case mk
F : Type u → Type u
inst✝ : Functor F
q : QPF F
α : Type u
g : F α → α
a✝ : (P F).A
f✝ : PFunctor.B (P F) a✝ → WType (P F).B
⊢ recF g (WType.mk a✝ f✝) = g (abs (PFunctor.map (P F) (recF g) (PFunctor.W.dest (WType.mk a✝ f✝))))

Next tactic:
rfl
/-- `recF` is insensitive to the representation -/
theorem recF_eq_of_Wequiv {α : Type u} (u : F α → α) (x y : q.P.W) :
    Wequiv x y → recF u x = recF u y := by
  

Proof state:
F : Type u → Type u
inst✝ : Functor F
q : QPF F
α : Type u
u : F α → α
x y : PFunctor.W (P F)
⊢ Wequiv x y → recF u x = recF u y

Next tactic:
intro h
/-- `recF` is insensitive to the representation -/
theorem recF_eq_of_Wequiv {α : Type u} (u : F α → α) (x y : q.P.W) :
    Wequiv x y → recF u x = recF u y := by
  intro h
  

Proof state:
F : Type u → Type u
inst✝ : Functor F
q : QPF F
α : Type u
u : F α → α
x y : PFunctor.W (P F)
h : Wequiv x y
⊢ recF u x = recF u y

Next tactic:
induction h
/-- `recF` is insensitive to the representation -/
theorem recF_eq_of_Wequiv {α : Type u} (u : F α → α) (x y : q.P.W) :
    Wequiv x y → recF u x = recF u y := by
  intro h
  induction h
  

Proof state:
case ind
F : Type u → Type u
inst✝ : Functor F
q : QPF F
α : Type u
u : F α → α
x y : PFunctor.W (P F)
a✝¹ : (P F).A
f✝ f'✝ : PFunctor.B (P F) a✝¹ → PFunctor.W (P F)
a✝ : ∀ (x : PFunctor.B (P F) a✝¹), Wequiv (f✝ x) (f'✝ x)
a_ih✝ : ∀ (x : PFunctor.B (P F) a✝¹), recF u (f✝ x) = recF u (f'✝ x)
⊢ recF u (WType.mk a✝¹ f✝) = recF u (WType.mk a✝¹ f'✝)
case abs
F : Type u → Type u
inst✝ : Functor F
q : QPF F
α : Type u
u : F α → α
x y : PFunctor.W (P F)
a✝¹ : (P F).A
f✝ : PFunctor.B (P F) a✝¹ → PFunctor.W (P F)
a'✝ : (P F).A
f'✝ : PFunctor.B (P F) a'✝ → PFunctor.W (P F)
a✝ : abs { fst := a✝¹, snd := f✝ } = abs { fst := a'✝, snd := f'✝ }
⊢ recF u (WType.mk a✝¹ f✝) = recF u (WType.mk a'✝ f'✝)
case trans
F : Type u → Type u
inst✝ : Functor F
q : QPF F
α : Type u
u : F α → α
x y u✝ v✝ w✝ : PFunctor.W (P F)
a✝¹ : Wequiv u✝ v✝
a✝ : Wequiv v✝ w✝
a_ih✝¹ : recF u u✝ = recF u v✝
a_ih✝ : recF u v✝ = recF u w✝
⊢ recF u u✝ = recF u w✝

Next tactic:
case ind a f f' _ ih => simp only [recF_eq', PFunctor.map_eq, Function.comp, ih]
/-- `recF` is insensitive to the representation -/
theorem recF_eq_of_Wequiv {α : Type u} (u : F α → α) (x y : q.P.W) :
    Wequiv x y → recF u x = recF u y := by
  intro h
  induction h
  

Proof state:
F : Type u → Type u
inst✝ : Functor F
q : QPF F
α : Type u
u : F α → α
x y : PFunctor.W (P F)
a : (P F).A
f f' : PFunctor.B (P F) a → PFunctor.W (P F)
a✝ : ∀ (x : PFunctor.B (P F) a), Wequiv (f x) (f' x)
ih : ∀ (x : PFunctor.B (P F) a), recF u (f x) = recF u (f' x)
⊢ recF u (WType.mk a f) = recF u (WType.mk a f')

Next tactic:
case ind a f f' _ ih => simp only [recF_eq', PFunctor.map_eq, Function.comp, ih]
/-- `recF` is insensitive to the representation -/
theorem recF_eq_of_Wequiv {α : Type u} (u : F α → α) (x y : q.P.W) :
    Wequiv x y → recF u x = recF u y := by
  intro h
  induction h
  case ind a f f' _ ih => 

Proof state:
F : Type u → Type u
inst✝ : Functor F
q : QPF F
α : Type u
u : F α → α
x y : PFunctor.W (P F)
a : (P F).A
f f' : PFunctor.B (P F) a → PFunctor.W (P F)
a✝ : ∀ (x : PFunctor.B (P F) a), Wequiv (f x) (f' x)
ih : ∀ (x : PFunctor.B (P F) a), recF u (f x) = recF u (f' x)
⊢ recF u (WType.mk a f) = recF u (WType.mk a f')

Next tactic:
simp only [recF_eq', PFunctor.map_eq, Function.comp, ih]
/-- `recF` is insensitive to the representation -/
theorem recF_eq_of_Wequiv {α : Type u} (u : F α → α) (x y : q.P.W) :
    Wequiv x y → recF u x = recF u y := by
  intro h
  induction h
  case ind a f f' _ ih => simp only [recF_eq', PFunctor.map_eq, Function.comp, ih]
  

Proof state:
case abs
F : Type u → Type u
inst✝ : Functor F
q : QPF F
α : Type u
u : F α → α
x y : PFunctor.W (P F)
a✝¹ : (P F).A
f✝ : PFunctor.B (P F) a✝¹ → PFunctor.W (P F)
a'✝ : (P F).A
f'✝ : PFunctor.B (P F) a'✝ → PFunctor.W (P F)
a✝ : abs { fst := a✝¹, snd := f✝ } = abs { fst := a'✝, snd := f'✝ }
⊢ recF u (WType.mk a✝¹ f✝) = recF u (WType.mk a'✝ f'✝)
case trans
F : Type u → Type u
inst✝ : Functor F
q : QPF F
α : Type u
u : F α → α
x y u✝ v✝ w✝ : PFunctor.W (P F)
a✝¹ : Wequiv u✝ v✝
a✝ : Wequiv v✝ w✝
a_ih✝¹ : recF u u✝ = recF u v✝
a_ih✝ : recF u v✝ = recF u w✝
⊢ recF u u✝ = recF u w✝

Next tactic:
case abs a f a' f' h => simp only [recF_eq', abs_map, h]
/-- `recF` is insensitive to the representation -/
theorem recF_eq_of_Wequiv {α : Type u} (u : F α → α) (x y : q.P.W) :
    Wequiv x y → recF u x = recF u y := by
  intro h
  induction h
  case ind a f f' _ ih => simp only [recF_eq', PFunctor.map_eq, Function.comp, ih]
  

Proof state:
F : Type u → Type u
inst✝ : Functor F
q : QPF F
α : Type u
u : F α → α
x y : PFunctor.W (P F)
a : (P F).A
f : PFunctor.B (P F) a → PFunctor.W (P F)
a' : (P F).A
f' : PFunctor.B (P F) a' → PFunctor.W (P F)
h : abs { fst := a, snd := f } = abs { fst := a', snd := f' }
⊢ recF u (WType.mk a f) = recF u (WType.mk a' f')

Next tactic:
case abs a f a' f' h => simp only [recF_eq', abs_map, h]
/-- `recF` is insensitive to the representation -/
theorem recF_eq_of_Wequiv {α : Type u} (u : F α → α) (x y : q.P.W) :
    Wequiv x y → recF u x = recF u y := by
  intro h
  induction h
  case ind a f f' _ ih => simp only [recF_eq', PFunctor.map_eq, Function.comp, ih]
  case abs a f a' f' h => 

Proof state:
F : Type u → Type u
inst✝ : Functor F
q : QPF F
α : Type u
u : F α → α
x y : PFunctor.W (P F)
a : (P F).A
f : PFunctor.B (P F) a → PFunctor.W (P F)
a' : (P F).A
f' : PFunctor.B (P F) a' → PFunctor.W (P F)
h : abs { fst := a, snd := f } = abs { fst := a', snd := f' }
⊢ recF u (WType.mk a f) = recF u (WType.mk a' f')

Next tactic:
simp only [recF_eq', abs_map, h]
/-- `recF` is insensitive to the representation -/
theorem recF_eq_of_Wequiv {α : Type u} (u : F α → α) (x y : q.P.W) :
    Wequiv x y → recF u x = recF u y := by
  intro h
  induction h
  case ind a f f' _ ih => simp only [recF_eq', PFunctor.map_eq, Function.comp, ih]
  case abs a f a' f' h => simp only [recF_eq', abs_map, h]
  

Proof state:
case trans
F : Type u → Type u
inst✝ : Functor F
q : QPF F
α : Type u
u : F α → α
x y u✝ v✝ w✝ : PFunctor.W (P F)
a✝¹ : Wequiv u✝ v✝
a✝ : Wequiv v✝ w✝
a_ih✝¹ : recF u u✝ = recF u v✝
a_ih✝ : recF u v✝ = recF u w✝
⊢ recF u u✝ = recF u w✝

Next tactic:
case trans x y z _ _ ih₁ ih₂ => exact Eq.trans ih₁ ih₂
/-- `recF` is insensitive to the representation -/
theorem recF_eq_of_Wequiv {α : Type u} (u : F α → α) (x y : q.P.W) :
    Wequiv x y → recF u x = recF u y := by
  intro h
  induction h
  case ind a f f' _ ih => simp only [recF_eq', PFunctor.map_eq, Function.comp, ih]
  case abs a f a' f' h => simp only [recF_eq', abs_map, h]
  

Proof state:
F : Type u → Type u
inst✝ : Functor F
q : QPF F
α : Type u
u : F α → α
x✝ y✝ x y z : PFunctor.W (P F)
a✝¹ : Wequiv x y
a✝ : Wequiv y z
ih₁ : recF u x = recF u y
ih₂ : recF u y = recF u z
⊢ recF u x = recF u z

Next tactic:
case trans x y z _ _ ih₁ ih₂ => exact Eq.trans ih₁ ih₂
/-- `recF` is insensitive to the representation -/
theorem recF_eq_of_Wequiv {α : Type u} (u : F α → α) (x y : q.P.W) :
    Wequiv x y → recF u x = recF u y := by
  intro h
  induction h
  case ind a f f' _ ih => simp only [recF_eq', PFunctor.map_eq, Function.comp, ih]
  case abs a f a' f' h => simp only [recF_eq', abs_map, h]
  case trans x y z _ _ ih₁ ih₂ => 

Proof state:
F : Type u → Type u
inst✝ : Functor F
q : QPF F
α : Type u
u : F α → α
x✝ y✝ x y z : PFunctor.W (P F)
a✝¹ : Wequiv x y
a✝ : Wequiv y z
ih₁ : recF u x = recF u y
ih₂ : recF u y = recF u z
⊢ recF u x = recF u z

Next tactic:
exact Eq.trans ih₁ ih₂
theorem Wequiv.abs' (x y : q.P.W) (h : QPF.abs x.dest = QPF.abs y.dest) : Wequiv x y := by
  

Proof state:
F : Type u → Type u
inst✝ : Functor F
q : QPF F
x y : PFunctor.W (P F)
h : QPF.abs (PFunctor.W.dest x) = QPF.abs (PFunctor.W.dest y)
⊢ Wequiv x y

Next tactic:
cases x
theorem Wequiv.abs' (x y : q.P.W) (h : QPF.abs x.dest = QPF.abs y.dest) : Wequiv x y := by
  cases x
  

Proof state:
case mk
F : Type u → Type u
inst✝ : Functor F
q : QPF F
y : PFunctor.W (P F)
a✝ : (P F).A
f✝ : PFunctor.B (P F) a✝ → WType (P F).B
h : QPF.abs (PFunctor.W.dest (WType.mk a✝ f✝)) = QPF.abs (PFunctor.W.dest y)
⊢ Wequiv (WType.mk a✝ f✝) y

Next tactic:
cases y
theorem Wequiv.abs' (x y : q.P.W) (h : QPF.abs x.dest = QPF.abs y.dest) : Wequiv x y := by
  cases x
  cases y
  

Proof state:
case mk.mk
F : Type u → Type u
inst✝ : Functor F
q : QPF F
a✝¹ : (P F).A
f✝¹ : PFunctor.B (P F) a✝¹ → WType (P F).B
a✝ : (P F).A
f✝ : PFunctor.B (P F) a✝ → WType (P F).B
h : QPF.abs (PFunctor.W.dest (WType.mk a✝¹ f✝¹)) = QPF.abs (PFunctor.W.dest (WType.mk a✝ f✝))
⊢ Wequiv (WType.mk a✝¹ f✝¹) (WType.mk a✝ f✝)

Next tactic:
apply Wequiv.abs
theorem Wequiv.abs' (x y : q.P.W) (h : QPF.abs x.dest = QPF.abs y.dest) : Wequiv x y := by
  cases x
  cases y
  apply Wequiv.abs
  

Proof state:
case mk.mk.a
F : Type u → Type u
inst✝ : Functor F
q : QPF F
a✝¹ : (P F).A
f✝¹ : PFunctor.B (P F) a✝¹ → WType (P F).B
a✝ : (P F).A
f✝ : PFunctor.B (P F) a✝ → WType (P F).B
h : QPF.abs (PFunctor.W.dest (WType.mk a✝¹ f✝¹)) = QPF.abs (PFunctor.W.dest (WType.mk a✝ f✝))
⊢ QPF.abs { fst := a✝¹, snd := f✝¹ } = QPF.abs { fst := a✝, snd := f✝ }

Next tactic:
apply h
theorem Wequiv.refl (x : q.P.W) : Wequiv x x := by
  

Proof state:
F : Type u → Type u
inst✝ : Functor F
q : QPF F
x : PFunctor.W (P F)
⊢ Wequiv x x

Next tactic:
cases' x with a f
theorem Wequiv.refl (x : q.P.W) : Wequiv x x := by
  cases' x with a f
  

Proof state:
case mk
F : Type u → Type u
inst✝ : Functor F
q : QPF F
a : (P F).A
f : PFunctor.B (P F) a → WType (P F).B
⊢ Wequiv (WType.mk a f) (WType.mk a f)

Next tactic:
exact Wequiv.abs a f a f rfl
theorem Wequiv.symm (x y : q.P.W) : Wequiv x y → Wequiv y x := by
  

Proof state:
F : Type u → Type u
inst✝ : Functor F
q : QPF F
x y : PFunctor.W (P F)
⊢ Wequiv x y → Wequiv y x

Next tactic:
intro h
theorem Wequiv.symm (x y : q.P.W) : Wequiv x y → Wequiv y x := by
  intro h
  

Proof state:
F : Type u → Type u
inst✝ : Functor F
q : QPF F
x y : PFunctor.W (P F)
h : Wequiv x y
⊢ Wequiv y x

Next tactic:
induction h
theorem Wequiv.symm (x y : q.P.W) : Wequiv x y → Wequiv y x := by
  intro h
  induction h
  

Proof state:
case ind
F : Type u → Type u
inst✝ : Functor F
q : QPF F
x y : PFunctor.W (P F)
a✝¹ : (P F).A
f✝ f'✝ : PFunctor.B (P F) a✝¹ → PFunctor.W (P F)
a✝ : ∀ (x : PFunctor.B (P F) a✝¹), Wequiv (f✝ x) (f'✝ x)
a_ih✝ : ∀ (x : PFunctor.B (P F) a✝¹), Wequiv (f'✝ x) (f✝ x)
⊢ Wequiv (WType.mk a✝¹ f'✝) (WType.mk a✝¹ f✝)
case abs
F : Type u → Type u
inst✝ : Functor F
q : QPF F
x y : PFunctor.W (P F)
a✝¹ : (P F).A
f✝ : PFunctor.B (P F) a✝¹ → PFunctor.W (P F)
a'✝ : (P F).A
f'✝ : PFunctor.B (P F) a'✝ → PFunctor.W (P F)
a✝ : QPF.abs { fst := a✝¹, snd := f✝ } = QPF.abs { fst := a'✝, snd := f'✝ }
⊢ Wequiv (WType.mk a'✝ f'✝) (WType.mk a✝¹ f✝)
case trans
F : Type u → Type u
inst✝ : Functor F
q : QPF F
x y u✝ v✝ w✝ : PFunctor.W (P F)
a✝¹ : Wequiv u✝ v✝
a✝ : Wequiv v✝ w✝
a_ih✝¹ : Wequiv v✝ u✝
a_ih✝ : Wequiv w✝ v✝
⊢ Wequiv w✝ u✝

Next tactic:
case ind a f f' _ ih => exact Wequiv.ind _ _ _ ih
theorem Wequiv.symm (x y : q.P.W) : Wequiv x y → Wequiv y x := by
  intro h
  induction h
  

Proof state:
F : Type u → Type u
inst✝ : Functor F
q : QPF F
x y : PFunctor.W (P F)
a : (P F).A
f f' : PFunctor.B (P F) a → PFunctor.W (P F)
a✝ : ∀ (x : PFunctor.B (P F) a), Wequiv (f x) (f' x)
ih : ∀ (x : PFunctor.B (P F) a), Wequiv (f' x) (f x)
⊢ Wequiv (WType.mk a f') (WType.mk a f)

Next tactic:
case ind a f f' _ ih => exact Wequiv.ind _ _ _ ih
theorem Wequiv.symm (x y : q.P.W) : Wequiv x y → Wequiv y x := by
  intro h
  induction h
  case ind a f f' _ ih => 

Proof state:
F : Type u → Type u
inst✝ : Functor F
q : QPF F
x y : PFunctor.W (P F)
a : (P F).A
f f' : PFunctor.B (P F) a → PFunctor.W (P F)
a✝ : ∀ (x : PFunctor.B (P F) a), Wequiv (f x) (f' x)
ih : ∀ (x : PFunctor.B (P F) a), Wequiv (f' x) (f x)
⊢ Wequiv (WType.mk a f') (WType.mk a f)

Next tactic:
exact Wequiv.ind _ _ _ ih