l3lab/ntp-mathlib huggingface dataset:
theorem liftR_iff {α : TypeVec n} (r : ∀ ⦃i⦄, α i → α i → Prop) (x y : P α) :
    LiftR @r x y ↔ ∃ a f₀ f₁, x = ⟨a, f₀⟩ ∧ y = ⟨a, f₁⟩ ∧ ∀ i j, r (f₀ i j) (f₁ i j) := by
  constructor
  · rintro ⟨u, xeq, yeq⟩
    cases' h : u with a f
    use a, fun i j => (f i j).val.fst, fun i j => (f i j).val.snd
    constructor
    · rw [← xeq, h]
      rfl
    constructor
    · rw [← yeq, h]
      

Proof state:
case h.right.left
n m : ℕ
P : MvPFunctor.{u} n
Q : Fin2 n → MvPFunctor.{u} m
α✝ β : TypeVec.{u} m
α : TypeVec.{u} n
r : ⦃i : Fin2 n⦄ → α i → α i → Prop
x y : ↑P α
u : ↑P fun i => { p // r p.1 p.2 }
xeq : (fun i t => (↑t).1) <$$> u = x
yeq : (fun i t => (↑t).2) <$$> u = y
a : P.A
f : B P a ⟹ fun i => { p // r p.1 p.2 }
h : u = { fst := a, snd := f }
⊢ (fun i t => (↑t).2) <$$> { fst := a, snd := f } = { fst := a, snd := fun i j => (↑(f i j)).2 }

Next tactic:
rfl
theorem liftR_iff {α : TypeVec n} (r : ∀ ⦃i⦄, α i → α i → Prop) (x y : P α) :
    LiftR @r x y ↔ ∃ a f₀ f₁, x = ⟨a, f₀⟩ ∧ y = ⟨a, f₁⟩ ∧ ∀ i j, r (f₀ i j) (f₁ i j) := by
  constructor
  · rintro ⟨u, xeq, yeq⟩
    cases' h : u with a f
    use a, fun i j => (f i j).val.fst, fun i j => (f i j).val.snd
    constructor
    · rw [← xeq, h]
      rfl
    constructor
    · rw [← yeq, h]
      rfl
    

Proof state:
case h.right.right
n m : ℕ
P : MvPFunctor.{u} n
Q : Fin2 n → MvPFunctor.{u} m
α✝ β : TypeVec.{u} m
α : TypeVec.{u} n
r : ⦃i : Fin2 n⦄ → α i → α i → Prop
x y : ↑P α
u : ↑P fun i => { p // r p.1 p.2 }
xeq : (fun i t => (↑t).1) <$$> u = x
yeq : (fun i t => (↑t).2) <$$> u = y
a : P.A
f : B P a ⟹ fun i => { p // r p.1 p.2 }
h : u = { fst := a, snd := f }
⊢ ∀ (i : Fin2 n) (j : B P a i), r (↑(f i j)).1 (↑(f i j)).2

Next tactic:
intro i j
theorem liftR_iff {α : TypeVec n} (r : ∀ ⦃i⦄, α i → α i → Prop) (x y : P α) :
    LiftR @r x y ↔ ∃ a f₀ f₁, x = ⟨a, f₀⟩ ∧ y = ⟨a, f₁⟩ ∧ ∀ i j, r (f₀ i j) (f₁ i j) := by
  constructor
  · rintro ⟨u, xeq, yeq⟩
    cases' h : u with a f
    use a, fun i j => (f i j).val.fst, fun i j => (f i j).val.snd
    constructor
    · rw [← xeq, h]
      rfl
    constructor
    · rw [← yeq, h]
      rfl
    intro i j
    

Proof state:
case h.right.right
n m : ℕ
P : MvPFunctor.{u} n
Q : Fin2 n → MvPFunctor.{u} m
α✝ β : TypeVec.{u} m
α : TypeVec.{u} n
r : ⦃i : Fin2 n⦄ → α i → α i → Prop
x y : ↑P α
u : ↑P fun i => { p // r p.1 p.2 }
xeq : (fun i t => (↑t).1) <$$> u = x
yeq : (fun i t => (↑t).2) <$$> u = y
a : P.A
f : B P a ⟹ fun i => { p // r p.1 p.2 }
h : u = { fst := a, snd := f }
i : Fin2 n
j : B P a i
⊢ r (↑(f i j)).1 (↑(f i j)).2

Next tactic:
exact (f i j).property
theorem liftR_iff {α : TypeVec n} (r : ∀ ⦃i⦄, α i → α i → Prop) (x y : P α) :
    LiftR @r x y ↔ ∃ a f₀ f₁, x = ⟨a, f₀⟩ ∧ y = ⟨a, f₁⟩ ∧ ∀ i j, r (f₀ i j) (f₁ i j) := by
  constructor
  · rintro ⟨u, xeq, yeq⟩
    cases' h : u with a f
    use a, fun i j => (f i j).val.fst, fun i j => (f i j).val.snd
    constructor
    · rw [← xeq, h]
      rfl
    constructor
    · rw [← yeq, h]
      rfl
    intro i j
    exact (f i j).property
  

Proof state:
case mpr
n m : ℕ
P : MvPFunctor.{u} n
Q : Fin2 n → MvPFunctor.{u} m
α✝ β : TypeVec.{u} m
α : TypeVec.{u} n
r : ⦃i : Fin2 n⦄ → α i → α i → Prop
x y : ↑P α
⊢ (∃ a f₀ f₁,
      x = { fst := a, snd := f₀ } ∧ y = { fst := a, snd := f₁ } ∧ ∀ (i : Fin2 n) (j : B P a i), r (f₀ i j) (f₁ i j)) →
    LiftR r x y

Next tactic:
rintro ⟨a, f₀, f₁, xeq, yeq, h⟩
theorem liftR_iff {α : TypeVec n} (r : ∀ ⦃i⦄, α i → α i → Prop) (x y : P α) :
    LiftR @r x y ↔ ∃ a f₀ f₁, x = ⟨a, f₀⟩ ∧ y = ⟨a, f₁⟩ ∧ ∀ i j, r (f₀ i j) (f₁ i j) := by
  constructor
  · rintro ⟨u, xeq, yeq⟩
    cases' h : u with a f
    use a, fun i j => (f i j).val.fst, fun i j => (f i j).val.snd
    constructor
    · rw [← xeq, h]
      rfl
    constructor
    · rw [← yeq, h]
      rfl
    intro i j
    exact (f i j).property
  rintro ⟨a, f₀, f₁, xeq, yeq, h⟩
  

Proof state:
case mpr.intro.intro.intro.intro.intro
n m : ℕ
P : MvPFunctor.{u} n
Q : Fin2 n → MvPFunctor.{u} m
α✝ β : TypeVec.{u} m
α : TypeVec.{u} n
r : ⦃i : Fin2 n⦄ → α i → α i → Prop
x y : ↑P α
a : P.A
f₀ f₁ : B P a ⟹ α
xeq : x = { fst := a, snd := f₀ }
yeq : y = { fst := a, snd := f₁ }
h : ∀ (i : Fin2 n) (j : B P a i), r (f₀ i j) (f₁ i j)
⊢ LiftR r x y

Next tactic:
use ⟨a, fun i j => ⟨(f₀ i j, f₁ i j), h i j⟩⟩
theorem liftR_iff {α : TypeVec n} (r : ∀ ⦃i⦄, α i → α i → Prop) (x y : P α) :
    LiftR @r x y ↔ ∃ a f₀ f₁, x = ⟨a, f₀⟩ ∧ y = ⟨a, f₁⟩ ∧ ∀ i j, r (f₀ i j) (f₁ i j) := by
  constructor
  · rintro ⟨u, xeq, yeq⟩
    cases' h : u with a f
    use a, fun i j => (f i j).val.fst, fun i j => (f i j).val.snd
    constructor
    · rw [← xeq, h]
      rfl
    constructor
    · rw [← yeq, h]
      rfl
    intro i j
    exact (f i j).property
  rintro ⟨a, f₀, f₁, xeq, yeq, h⟩
  use ⟨a, fun i j => ⟨(f₀ i j, f₁ i j), h i j⟩⟩
  

Proof state:
case h
n m : ℕ
P : MvPFunctor.{u} n
Q : Fin2 n → MvPFunctor.{u} m
α✝ β : TypeVec.{u} m
α : TypeVec.{u} n
r : ⦃i : Fin2 n⦄ → α i → α i → Prop
x y : ↑P α
a : P.A
f₀ f₁ : B P a ⟹ α
xeq : x = { fst := a, snd := f₀ }
yeq : y = { fst := a, snd := f₁ }
h : ∀ (i : Fin2 n) (j : B P a i), r (f₀ i j) (f₁ i j)
⊢ (fun i t => (↑t).1) <$$>
        { fst := a, snd := fun i j => { val := (f₀ i j, f₁ i j), property := (_ : r (f₀ i j) (f₁ i j)) } } =
      x ∧
    (fun i t => (↑t).2) <$$>
        { fst := a, snd := fun i j => { val := (f₀ i j, f₁ i j), property := (_ : r (f₀ i j) (f₁ i j)) } } =
      y

Next tactic:
dsimp
theorem liftR_iff {α : TypeVec n} (r : ∀ ⦃i⦄, α i → α i → Prop) (x y : P α) :
    LiftR @r x y ↔ ∃ a f₀ f₁, x = ⟨a, f₀⟩ ∧ y = ⟨a, f₁⟩ ∧ ∀ i j, r (f₀ i j) (f₁ i j) := by
  constructor
  · rintro ⟨u, xeq, yeq⟩
    cases' h : u with a f
    use a, fun i j => (f i j).val.fst, fun i j => (f i j).val.snd
    constructor
    · rw [← xeq, h]
      rfl
    constructor
    · rw [← yeq, h]
      rfl
    intro i j
    exact (f i j).property
  rintro ⟨a, f₀, f₁, xeq, yeq, h⟩
  use ⟨a, fun i j => ⟨(f₀ i j, f₁ i j), h i j⟩⟩
  dsimp; 

Proof state:
case h
n m : ℕ
P : MvPFunctor.{u} n
Q : Fin2 n → MvPFunctor.{u} m
α✝ β : TypeVec.{u} m
α : TypeVec.{u} n
r : ⦃i : Fin2 n⦄ → α i → α i → Prop
x y : ↑P α
a : P.A
f₀ f₁ : B P a ⟹ α
xeq : x = { fst := a, snd := f₀ }
yeq : y = { fst := a, snd := f₁ }
h : ∀ (i : Fin2 n) (j : B P a i), r (f₀ i j) (f₁ i j)
⊢ (fun i t => (↑t).1) <$$>
        { fst := a, snd := fun i j => { val := (f₀ i j, f₁ i j), property := (_ : r (f₀ i j) (f₁ i j)) } } =
      x ∧
    (fun i t => (↑t).2) <$$>
        { fst := a, snd := fun i j => { val := (f₀ i j, f₁ i j), property := (_ : r (f₀ i j) (f₁ i j)) } } =
      y

Next tactic:
constructor
theorem liftR_iff {α : TypeVec n} (r : ∀ ⦃i⦄, α i → α i → Prop) (x y : P α) :
    LiftR @r x y ↔ ∃ a f₀ f₁, x = ⟨a, f₀⟩ ∧ y = ⟨a, f₁⟩ ∧ ∀ i j, r (f₀ i j) (f₁ i j) := by
  constructor
  · rintro ⟨u, xeq, yeq⟩
    cases' h : u with a f
    use a, fun i j => (f i j).val.fst, fun i j => (f i j).val.snd
    constructor
    · rw [← xeq, h]
      rfl
    constructor
    · rw [← yeq, h]
      rfl
    intro i j
    exact (f i j).property
  rintro ⟨a, f₀, f₁, xeq, yeq, h⟩
  use ⟨a, fun i j => ⟨(f₀ i j, f₁ i j), h i j⟩⟩
  dsimp; constructor
  · 

Proof state:
case h.left
n m : ℕ
P : MvPFunctor.{u} n
Q : Fin2 n → MvPFunctor.{u} m
α✝ β : TypeVec.{u} m
α : TypeVec.{u} n
r : ⦃i : Fin2 n⦄ → α i → α i → Prop
x y : ↑P α
a : P.A
f₀ f₁ : B P a ⟹ α
xeq : x = { fst := a, snd := f₀ }
yeq : y = { fst := a, snd := f₁ }
h : ∀ (i : Fin2 n) (j : B P a i), r (f₀ i j) (f₁ i j)
⊢ (fun i t => (↑t).1) <$$>
      { fst := a, snd := fun i j => { val := (f₀ i j, f₁ i j), property := (_ : r (f₀ i j) (f₁ i j)) } } =
    x

Next tactic:
rw [xeq]
theorem liftR_iff {α : TypeVec n} (r : ∀ ⦃i⦄, α i → α i → Prop) (x y : P α) :
    LiftR @r x y ↔ ∃ a f₀ f₁, x = ⟨a, f₀⟩ ∧ y = ⟨a, f₁⟩ ∧ ∀ i j, r (f₀ i j) (f₁ i j) := by
  constructor
  · rintro ⟨u, xeq, yeq⟩
    cases' h : u with a f
    use a, fun i j => (f i j).val.fst, fun i j => (f i j).val.snd
    constructor
    · rw [← xeq, h]
      rfl
    constructor
    · rw [← yeq, h]
      rfl
    intro i j
    exact (f i j).property
  rintro ⟨a, f₀, f₁, xeq, yeq, h⟩
  use ⟨a, fun i j => ⟨(f₀ i j, f₁ i j), h i j⟩⟩
  dsimp; constructor
  · rw [xeq]
    

Proof state:
case h.left
n m : ℕ
P : MvPFunctor.{u} n
Q : Fin2 n → MvPFunctor.{u} m
α✝ β : TypeVec.{u} m
α : TypeVec.{u} n
r : ⦃i : Fin2 n⦄ → α i → α i → Prop
x y : ↑P α
a : P.A
f₀ f₁ : B P a ⟹ α
xeq : x = { fst := a, snd := f₀ }
yeq : y = { fst := a, snd := f₁ }
h : ∀ (i : Fin2 n) (j : B P a i), r (f₀ i j) (f₁ i j)
⊢ (fun i t => (↑t).1) <$$>
      { fst := a, snd := fun i j => { val := (f₀ i j, f₁ i j), property := (_ : r (f₀ i j) (f₁ i j)) } } =
    { fst := a, snd := f₀ }

Next tactic:
rfl
theorem liftR_iff {α : TypeVec n} (r : ∀ ⦃i⦄, α i → α i → Prop) (x y : P α) :
    LiftR @r x y ↔ ∃ a f₀ f₁, x = ⟨a, f₀⟩ ∧ y = ⟨a, f₁⟩ ∧ ∀ i j, r (f₀ i j) (f₁ i j) := by
  constructor
  · rintro ⟨u, xeq, yeq⟩
    cases' h : u with a f
    use a, fun i j => (f i j).val.fst, fun i j => (f i j).val.snd
    constructor
    · rw [← xeq, h]
      rfl
    constructor
    · rw [← yeq, h]
      rfl
    intro i j
    exact (f i j).property
  rintro ⟨a, f₀, f₁, xeq, yeq, h⟩
  use ⟨a, fun i j => ⟨(f₀ i j, f₁ i j), h i j⟩⟩
  dsimp; constructor
  · rw [xeq]
    rfl
  

Proof state:
case h.right
n m : ℕ
P : MvPFunctor.{u} n
Q : Fin2 n → MvPFunctor.{u} m
α✝ β : TypeVec.{u} m
α : TypeVec.{u} n
r : ⦃i : Fin2 n⦄ → α i → α i → Prop
x y : ↑P α
a : P.A
f₀ f₁ : B P a ⟹ α
xeq : x = { fst := a, snd := f₀ }
yeq : y = { fst := a, snd := f₁ }
h : ∀ (i : Fin2 n) (j : B P a i), r (f₀ i j) (f₁ i j)
⊢ (fun i t => (↑t).2) <$$>
      { fst := a, snd := fun i j => { val := (f₀ i j, f₁ i j), property := (_ : r (f₀ i j) (f₁ i j)) } } =
    y

Next tactic:
rw [yeq]
theorem liftR_iff {α : TypeVec n} (r : ∀ ⦃i⦄, α i → α i → Prop) (x y : P α) :
    LiftR @r x y ↔ ∃ a f₀ f₁, x = ⟨a, f₀⟩ ∧ y = ⟨a, f₁⟩ ∧ ∀ i j, r (f₀ i j) (f₁ i j) := by
  constructor
  · rintro ⟨u, xeq, yeq⟩
    cases' h : u with a f
    use a, fun i j => (f i j).val.fst, fun i j => (f i j).val.snd
    constructor
    · rw [← xeq, h]
      rfl
    constructor
    · rw [← yeq, h]
      rfl
    intro i j
    exact (f i j).property
  rintro ⟨a, f₀, f₁, xeq, yeq, h⟩
  use ⟨a, fun i j => ⟨(f₀ i j, f₁ i j), h i j⟩⟩
  dsimp; constructor
  · rw [xeq]
    rfl
  rw [yeq]; 

Proof state:
case h.right
n m : ℕ
P : MvPFunctor.{u} n
Q : Fin2 n → MvPFunctor.{u} m
α✝ β : TypeVec.{u} m
α : TypeVec.{u} n
r : ⦃i : Fin2 n⦄ → α i → α i → Prop
x y : ↑P α
a : P.A
f₀ f₁ : B P a ⟹ α
xeq : x = { fst := a, snd := f₀ }
yeq : y = { fst := a, snd := f₁ }
h : ∀ (i : Fin2 n) (j : B P a i), r (f₀ i j) (f₁ i j)
⊢ (fun i t => (↑t).2) <$$>
      { fst := a, snd := fun i j => { val := (f₀ i j, f₁ i j), property := (_ : r (f₀ i j) (f₁ i j)) } } =
    { fst := a, snd := f₁ }

Next tactic:
rfl
theorem supp_eq {α : TypeVec n} (a : P.A) (f : P.B a ⟹ α) (i) :
    @supp.{u} _ P.Obj _ α (⟨a, f⟩ : P α) i = f i '' univ := by
  

Proof state:
n m : ℕ
P : MvPFunctor.{u} n
Q : Fin2 n → MvPFunctor.{u} m
α✝ β : TypeVec.{u} m
α : TypeVec.{u} n
a : P.A
f : B P a ⟹ α
i : Fin2 n
⊢ supp { fst := a, snd := f } i = f i '' univ

Next tactic:
ext x
theorem supp_eq {α : TypeVec n} (a : P.A) (f : P.B a ⟹ α) (i) :
    @supp.{u} _ P.Obj _ α (⟨a, f⟩ : P α) i = f i '' univ := by
  ext x; 

Proof state:
case h
n m : ℕ
P : MvPFunctor.{u} n
Q : Fin2 n → MvPFunctor.{u} m
α✝ β : TypeVec.{u} m
α : TypeVec.{u} n
a : P.A
f : B P a ⟹ α
i : Fin2 n
x : α i
⊢ x ∈ supp { fst := a, snd := f } i ↔ x ∈ f i '' univ

Next tactic:
simp only [supp, image_univ, mem_range, mem_setOf_eq]
theorem supp_eq {α : TypeVec n} (a : P.A) (f : P.B a ⟹ α) (i) :
    @supp.{u} _ P.Obj _ α (⟨a, f⟩ : P α) i = f i '' univ := by
  ext x; simp only [supp, image_univ, mem_range, mem_setOf_eq]
  

Proof state:
case h
n m : ℕ
P : MvPFunctor.{u} n
Q : Fin2 n → MvPFunctor.{u} m
α✝ β : TypeVec.{u} m
α : TypeVec.{u} n
a : P.A
f : B P a ⟹ α
i : Fin2 n
x : α i
⊢ (∀ ⦃P_1 : (i : Fin2 n) → α i → Prop⦄, LiftP P_1 { fst := a, snd := f } → P_1 i x) ↔ ∃ y, f i y = x

Next tactic:
constructor
theorem supp_eq {α : TypeVec n} (a : P.A) (f : P.B a ⟹ α) (i) :
    @supp.{u} _ P.Obj _ α (⟨a, f⟩ : P α) i = f i '' univ := by
  ext x; simp only [supp, image_univ, mem_range, mem_setOf_eq]
  constructor <;> 

Proof state:
case h.mp
n m : ℕ
P : MvPFunctor.{u} n
Q : Fin2 n → MvPFunctor.{u} m
α✝ β : TypeVec.{u} m
α : TypeVec.{u} n
a : P.A
f : B P a ⟹ α
i : Fin2 n
x : α i
⊢ (∀ ⦃P_1 : (i : Fin2 n) → α i → Prop⦄, LiftP P_1 { fst := a, snd := f } → P_1 i x) → ∃ y, f i y = x

Next tactic:
intro h
theorem supp_eq {α : TypeVec n} (a : P.A) (f : P.B a ⟹ α) (i) :
    @supp.{u} _ P.Obj _ α (⟨a, f⟩ : P α) i = f i '' univ := by
  ext x; simp only [supp, image_univ, mem_range, mem_setOf_eq]
  constructor <;> 

Proof state:
case h.mpr
n m : ℕ
P : MvPFunctor.{u} n
Q : Fin2 n → MvPFunctor.{u} m
α✝ β : TypeVec.{u} m
α : TypeVec.{u} n
a : P.A
f : B P a ⟹ α
i : Fin2 n
x : α i
⊢ (∃ y, f i y = x) → ∀ ⦃P_1 : (i : Fin2 n) → α i → Prop⦄, LiftP P_1 { fst := a, snd := f } → P_1 i x

Next tactic:
intro h
theorem supp_eq {α : TypeVec n} (a : P.A) (f : P.B a ⟹ α) (i) :
    @supp.{u} _ P.Obj _ α (⟨a, f⟩ : P α) i = f i '' univ := by
  ext x; simp only [supp, image_univ, mem_range, mem_setOf_eq]
  constructor <;> intro h
  · 

Proof state:
case h.mp
n m : ℕ
P : MvPFunctor.{u} n
Q : Fin2 n → MvPFunctor.{u} m
α✝ β : TypeVec.{u} m
α : TypeVec.{u} n
a : P.A
f : B P a ⟹ α
i : Fin2 n
x : α i
h : ∀ ⦃P_1 : (i : Fin2 n) → α i → Prop⦄, LiftP P_1 { fst := a, snd := f } → P_1 i x
⊢ ∃ y, f i y = x

Next tactic:
apply @h fun i x => ∃ y : P.B a i, f i y = x
theorem supp_eq {α : TypeVec n} (a : P.A) (f : P.B a ⟹ α) (i) :
    @supp.{u} _ P.Obj _ α (⟨a, f⟩ : P α) i = f i '' univ := by
  ext x; simp only [supp, image_univ, mem_range, mem_setOf_eq]
  constructor <;> intro h
  · apply @h fun i x => ∃ y : P.B a i, f i y = x
    

Proof state:
case h.mp
n m : ℕ
P : MvPFunctor.{u} n
Q : Fin2 n → MvPFunctor.{u} m
α✝ β : TypeVec.{u} m
α : TypeVec.{u} n
a : P.A
f : B P a ⟹ α
i : Fin2 n
x : α i
h : ∀ ⦃P_1 : (i : Fin2 n) → α i → Prop⦄, LiftP P_1 { fst := a, snd := f } → P_1 i x
⊢ LiftP (fun i x => ∃ y, f i y = x) { fst := a, snd := f }

Next tactic:
rw [liftP_iff']
theorem supp_eq {α : TypeVec n} (a : P.A) (f : P.B a ⟹ α) (i) :
    @supp.{u} _ P.Obj _ α (⟨a, f⟩ : P α) i = f i '' univ := by
  ext x; simp only [supp, image_univ, mem_range, mem_setOf_eq]
  constructor <;> intro h
  · apply @h fun i x => ∃ y : P.B a i, f i y = x
    rw [liftP_iff']
    

Proof state:
case h.mp
n m : ℕ
P : MvPFunctor.{u} n
Q : Fin2 n → MvPFunctor.{u} m
α✝ β : TypeVec.{u} m
α : TypeVec.{u} n
a : P.A
f : B P a ⟹ α
i : Fin2 n
x : α i
h : ∀ ⦃P_1 : (i : Fin2 n) → α i → Prop⦄, LiftP P_1 { fst := a, snd := f } → P_1 i x
⊢ ∀ (i : Fin2 n) (x : B P a i), ∃ y, f i y = f i x

Next tactic:
intros
theorem supp_eq {α : TypeVec n} (a : P.A) (f : P.B a ⟹ α) (i) :
    @supp.{u} _ P.Obj _ α (⟨a, f⟩ : P α) i = f i '' univ := by
  ext x; simp only [supp, image_univ, mem_range, mem_setOf_eq]
  constructor <;> intro h
  · apply @h fun i x => ∃ y : P.B a i, f i y = x
    rw [liftP_iff']
    intros
    

Proof state:
case h.mp
n m : ℕ
P : MvPFunctor.{u} n
Q : Fin2 n → MvPFunctor.{u} m
α✝ β : TypeVec.{u} m
α : TypeVec.{u} n
a : P.A
f : B P a ⟹ α
i : Fin2 n
x : α i
h : ∀ ⦃P_1 : (i : Fin2 n) → α i → Prop⦄, LiftP P_1 { fst := a, snd := f } → P_1 i x
i✝ : Fin2 n
x✝ : B P a i✝
⊢ ∃ y, f i✝ y = f i✝ x✝

Next tactic:
refine' ⟨_, rfl⟩
theorem supp_eq {α : TypeVec n} (a : P.A) (f : P.B a ⟹ α) (i) :
    @supp.{u} _ P.Obj _ α (⟨a, f⟩ : P α) i = f i '' univ := by
  ext x; simp only [supp, image_univ, mem_range, mem_setOf_eq]
  constructor <;> intro h
  · apply @h fun i x => ∃ y : P.B a i, f i y = x
    rw [liftP_iff']
    intros
    refine' ⟨_, rfl⟩
  · 

Proof state:
case h.mpr
n m : ℕ
P : MvPFunctor.{u} n
Q : Fin2 n → MvPFunctor.{u} m
α✝ β : TypeVec.{u} m
α : TypeVec.{u} n
a : P.A
f : B P a ⟹ α
i : Fin2 n
x : α i
h : ∃ y, f i y = x
⊢ ∀ ⦃P_1 : (i : Fin2 n) → α i → Prop⦄, LiftP P_1 { fst := a, snd := f } → P_1 i x

Next tactic:
simp only [liftP_iff']
theorem supp_eq {α : TypeVec n} (a : P.A) (f : P.B a ⟹ α) (i) :
    @supp.{u} _ P.Obj _ α (⟨a, f⟩ : P α) i = f i '' univ := by
  ext x; simp only [supp, image_univ, mem_range, mem_setOf_eq]
  constructor <;> intro h
  · apply @h fun i x => ∃ y : P.B a i, f i y = x
    rw [liftP_iff']
    intros
    refine' ⟨_, rfl⟩
  · simp only [liftP_iff']
    

Proof state:
case h.mpr
n m : ℕ
P : MvPFunctor.{u} n
Q : Fin2 n → MvPFunctor.{u} m
α✝ β : TypeVec.{u} m
α : TypeVec.{u} n
a : P.A
f : B P a ⟹ α
i : Fin2 n
x : α i
h : ∃ y, f i y = x
⊢ ∀ ⦃P_1 : (i : Fin2 n) → α i → Prop⦄, (∀ (i : Fin2 n) (x : B P a i), P_1 i (f i x)) → P_1 i x

Next tactic:
cases h
theorem supp_eq {α : TypeVec n} (a : P.A) (f : P.B a ⟹ α) (i) :
    @supp.{u} _ P.Obj _ α (⟨a, f⟩ : P α) i = f i '' univ := by
  ext x; simp only [supp, image_univ, mem_range, mem_setOf_eq]
  constructor <;> intro h
  · apply @h fun i x => ∃ y : P.B a i, f i y = x
    rw [liftP_iff']
    intros
    refine' ⟨_, rfl⟩
  · simp only [liftP_iff']
    cases h
    

Proof state:
case h.mpr.intro
n m : ℕ
P : MvPFunctor.{u} n
Q : Fin2 n → MvPFunctor.{u} m
α✝ β : TypeVec.{u} m
α : TypeVec.{u} n
a : P.A
f : B P a ⟹ α
i : Fin2 n
x : α i
w✝ : B P a i
h✝ : f i w✝ = x
⊢ ∀ ⦃P_1 : (i : Fin2 n) → α i → Prop⦄, (∀ (i : Fin2 n) (x : B P a i), P_1 i (f i x)) → P_1 i x

Next tactic:
subst x
theorem supp_eq {α : TypeVec n} (a : P.A) (f : P.B a ⟹ α) (i) :
    @supp.{u} _ P.Obj _ α (⟨a, f⟩ : P α) i = f i '' univ := by
  ext x; simp only [supp, image_univ, mem_range, mem_setOf_eq]
  constructor <;> intro h
  · apply @h fun i x => ∃ y : P.B a i, f i y = x
    rw [liftP_iff']
    intros
    refine' ⟨_, rfl⟩
  · simp only [liftP_iff']
    cases h
    subst x
    

Proof state:
case h.mpr.intro
n m : ℕ
P : MvPFunctor.{u} n
Q : Fin2 n → MvPFunctor.{u} m
α✝ β : TypeVec.{u} m
α : TypeVec.{u} n
a : P.A
f : B P a ⟹ α
i : Fin2 n
w✝ : B P a i
⊢ ∀ ⦃P_1 : (i : Fin2 n) → α i → Prop⦄, (∀ (i : Fin2 n) (x : B P a i), P_1 i (f i x)) → P_1 i (f i w✝)

Next tactic:
tauto
theorem num_dvd (a) {b : ℤ} (b0 : b ≠ 0) : (a /. b).num ∣ a := by
  

Proof state:
a b : ℤ
b0 : b ≠ 0
⊢ (a /. b).num ∣ a

Next tactic:
cases' e : a /. b with n d h c
theorem num_dvd (a) {b : ℤ} (b0 : b ≠ 0) : (a /. b).num ∣ a := by
  cases' e : a /. b with n d h c
  

Proof state:
case mk'
a b : ℤ
b0 : b ≠ 0
n : ℤ
d : ℕ
h : d ≠ 0
c : Nat.Coprime (Int.natAbs n) d
e : a /. b = mk' n d
⊢ (mk' n d).num ∣ a

Next tactic:
rw [Rat.num_den', divInt_eq_iff b0 (ne_of_gt (Int.coe_nat_pos.2 (Nat.pos_of_ne_zero h)))] at e
theorem num_dvd (a) {b : ℤ} (b0 : b ≠ 0) : (a /. b).num ∣ a := by
  cases' e : a /. b with n d h c
  rw [Rat.num_den', divInt_eq_iff b0 (ne_of_gt (Int.coe_nat_pos.2 (Nat.pos_of_ne_zero h)))] at e
  

Proof state:
case mk'
a b : ℤ
b0 : b ≠ 0
n : ℤ
d : ℕ
h : d ≠ 0
c : Nat.Coprime (Int.natAbs n) d
e : a * ↑d = n * b
⊢ (mk' n d).num ∣ a

Next tactic:
refine' Int.natAbs_dvd.1 <| Int.dvd_natAbs.1 <| Int.coe_nat_dvd.2 <| c.dvd_of_dvd_mul_right _
theorem num_dvd (a) {b : ℤ} (b0 : b ≠ 0) : (a /. b).num ∣ a := by
  cases' e : a /. b with n d h c
  rw [Rat.num_den', divInt_eq_iff b0 (ne_of_gt (Int.coe_nat_pos.2 (Nat.pos_of_ne_zero h)))] at e
  refine' Int.natAbs_dvd.1 <| Int.dvd_natAbs.1 <| Int.coe_nat_dvd.2 <| c.dvd_of_dvd_mul_right _
  

Proof state:
case mk'
a b : ℤ
b0 : b ≠ 0
n : ℤ
d : ℕ
h : d ≠ 0
c : Nat.Coprime (Int.natAbs n) d
e : a * ↑d = n * b
⊢ Int.natAbs n ∣ Int.natAbs a * d

Next tactic:
have := congr_arg Int.natAbs e
theorem num_dvd (a) {b : ℤ} (b0 : b ≠ 0) : (a /. b).num ∣ a := by
  cases' e : a /. b with n d h c
  rw [Rat.num_den', divInt_eq_iff b0 (ne_of_gt (Int.coe_nat_pos.2 (Nat.pos_of_ne_zero h)))] at e
  refine' Int.natAbs_dvd.1 <| Int.dvd_natAbs.1 <| Int.coe_nat_dvd.2 <| c.dvd_of_dvd_mul_right _
  have := congr_arg Int.natAbs e
  

Proof state:
case mk'
a b : ℤ
b0 : b ≠ 0
n : ℤ
d : ℕ
h : d ≠ 0
c : Nat.Coprime (Int.natAbs n) d
e : a * ↑d = n * b
this : Int.natAbs (a * ↑d) = Int.natAbs (n * b)
⊢ Int.natAbs n ∣ Int.natAbs a * d

Next tactic:
simp only [Int.natAbs_mul, Int.natAbs_ofNat] at this
theorem num_dvd (a) {b : ℤ} (b0 : b ≠ 0) : (a /. b).num ∣ a := by
  cases' e : a /. b with n d h c
  rw [Rat.num_den', divInt_eq_iff b0 (ne_of_gt (Int.coe_nat_pos.2 (Nat.pos_of_ne_zero h)))] at e
  refine' Int.natAbs_dvd.1 <| Int.dvd_natAbs.1 <| Int.coe_nat_dvd.2 <| c.dvd_of_dvd_mul_right _
  have := congr_arg Int.natAbs e
  simp only [Int.natAbs_mul, Int.natAbs_ofNat] at this; 

Proof state:
case mk'
a b : ℤ
b0 : b ≠ 0
n : ℤ
d : ℕ
h : d ≠ 0
c : Nat.Coprime (Int.natAbs n) d
e : a * ↑d = n * b
this : Int.natAbs a * d = Int.natAbs n * Int.natAbs b
⊢ Int.natAbs n ∣ Int.natAbs a * d

Next tactic:
simp [this]
theorem den_dvd (a b : ℤ) : ((a /. b).den : ℤ) ∣ b := by
  

Proof state:
a b : ℤ
⊢ ↑(a /. b).den ∣ b

Next tactic:
by_cases b0 : b = 0
theorem den_dvd (a b : ℤ) : ((a /. b).den : ℤ) ∣ b := by
  by_cases b0 : b = 0; · 

Proof state:
case pos
a b : ℤ
b0 : b = 0
⊢ ↑(a /. b).den ∣ b

Next tactic:
simp [b0]
theorem den_dvd (a b : ℤ) : ((a /. b).den : ℤ) ∣ b := by
  by_cases b0 : b = 0; · simp [b0]
  

Proof state:
case neg
a b : ℤ
b0 : ¬b = 0
⊢ ↑(a /. b).den ∣ b

Next tactic:
cases' e : a /. b with n d h c
theorem den_dvd (a b : ℤ) : ((a /. b).den : ℤ) ∣ b := by
  by_cases b0 : b = 0; · simp [b0]
  cases' e : a /. b with n d h c
  

Proof state:
case neg.mk'
a b : ℤ
b0 : ¬b = 0
n : ℤ
d : ℕ
h : d ≠ 0
c : Nat.Coprime (Int.natAbs n) d
e : a /. b = mk' n d
⊢ ↑(mk' n d).den ∣ b

Next tactic:
rw [num_den', divInt_eq_iff b0 (ne_of_gt (Int.coe_nat_pos.2 (Nat.pos_of_ne_zero h)))] at e
theorem den_dvd (a b : ℤ) : ((a /. b).den : ℤ) ∣ b := by
  by_cases b0 : b = 0; · simp [b0]
  cases' e : a /. b with n d h c
  rw [num_den', divInt_eq_iff b0 (ne_of_gt (Int.coe_nat_pos.2 (Nat.pos_of_ne_zero h)))] at e
  

Proof state:
case neg.mk'
a b : ℤ
b0 : ¬b = 0
n : ℤ
d : ℕ
h : d ≠ 0
c : Nat.Coprime (Int.natAbs n) d
e : a * ↑d = n * b
⊢ ↑(mk' n d).den ∣ b

Next tactic:
refine' Int.dvd_natAbs.1 <| Int.coe_nat_dvd.2 <| c.symm.dvd_of_dvd_mul_left _
theorem den_dvd (a b : ℤ) : ((a /. b).den : ℤ) ∣ b := by
  by_cases b0 : b = 0; · simp [b0]
  cases' e : a /. b with n d h c
  rw [num_den', divInt_eq_iff b0 (ne_of_gt (Int.coe_nat_pos.2 (Nat.pos_of_ne_zero h)))] at e
  refine' Int.dvd_natAbs.1 <| Int.coe_nat_dvd.2 <| c.symm.dvd_of_dvd_mul_left _
  

Proof state:
case neg.mk'
a b : ℤ
b0 : ¬b = 0
n : ℤ
d : ℕ
h : d ≠ 0
c : Nat.Coprime (Int.natAbs n) d
e : a * ↑d = n * b
⊢ d ∣ Int.natAbs n * Int.natAbs b

Next tactic:
rw [← Int.natAbs_mul, ← Int.coe_nat_dvd, Int.dvd_natAbs, ← e]
theorem den_dvd (a b : ℤ) : ((a /. b).den : ℤ) ∣ b := by
  by_cases b0 : b = 0; · simp [b0]
  cases' e : a /. b with n d h c
  rw [num_den', divInt_eq_iff b0 (ne_of_gt (Int.coe_nat_pos.2 (Nat.pos_of_ne_zero h)))] at e
  refine' Int.dvd_natAbs.1 <| Int.coe_nat_dvd.2 <| c.symm.dvd_of_dvd_mul_left _
  rw [← Int.natAbs_mul, ← Int.coe_nat_dvd, Int.dvd_natAbs, ← e]; 

Proof state:
case neg.mk'
a b : ℤ
b0 : ¬b = 0
n : ℤ
d : ℕ
h : d ≠ 0
c : Nat.Coprime (Int.natAbs n) d
e : a * ↑d = n * b
⊢ ↑d ∣ a * ↑d

Next tactic:
simp
theorem num_den_mk {q : ℚ} {n d : ℤ} (hd : d ≠ 0) (qdf : q = n /. d) :
    ∃ c : ℤ, n = c * q.num ∧ d = c * q.den := by
  

Proof state:
q : ℚ
n d : ℤ
hd : d ≠ 0
qdf : q = n /. d
⊢ ∃ c, n = c * q.num ∧ d = c * ↑q.den

Next tactic:
obtain rfl | hn := eq_or_ne n 0
theorem num_den_mk {q : ℚ} {n d : ℤ} (hd : d ≠ 0) (qdf : q = n /. d) :
    ∃ c : ℤ, n = c * q.num ∧ d = c * q.den := by
  obtain rfl | hn := eq_or_ne n 0
  · 

Proof state:
case inl
q : ℚ
d : ℤ
hd : d ≠ 0
qdf : q = 0 /. d
⊢ ∃ c, 0 = c * q.num ∧ d = c * ↑q.den

Next tactic:
simp [qdf]
theorem num_den_mk {q : ℚ} {n d : ℤ} (hd : d ≠ 0) (qdf : q = n /. d) :
    ∃ c : ℤ, n = c * q.num ∧ d = c * q.den := by
  obtain rfl | hn := eq_or_ne n 0
  · simp [qdf]
  

Proof state:
case inr
q : ℚ
n d : ℤ
hd : d ≠ 0
qdf : q = n /. d
hn : n ≠ 0
⊢ ∃ c, n = c * q.num ∧ d = c * ↑q.den

Next tactic:
have : q.num * d = n * ↑q.den := by
    refine' (divInt_eq_iff _ hd).mp _
    · exact Int.coe_nat_ne_zero.mpr (Rat.den_nz _)
    · rwa [num_den]
theorem num_den_mk {q : ℚ} {n d : ℤ} (hd : d ≠ 0) (qdf : q = n /. d) :
    ∃ c : ℤ, n = c * q.num ∧ d = c * q.den := by
  obtain rfl | hn := eq_or_ne n 0
  · simp [qdf]
  have : q.num * d = n * ↑q.den := by
    

Proof state:
q : ℚ
n d : ℤ
hd : d ≠ 0
qdf : q = n /. d
hn : n ≠ 0
⊢ q.num * d = n * ↑q.den

Next tactic:
refine' (divInt_eq_iff _ hd).mp _