l3lab/ntp-mathlib huggingface dataset:
@[to_additive existing Interval.subtractionCommMonoid]
instance divisionCommMonoid : DivisionCommMonoid (Interval α) :=
  { Interval.commMonoid with
    inv := Inv.inv
    div := (· / ·)
    div_eq_mul_inv := by
      rintro (_ | s) (_ | t) <;> first |rfl|exact congr_arg some (div_eq_mul_inv _ _)
    inv_inv := by rintro (_ | s) <;> first |rfl|exact congr_arg some (inv_inv _)
    mul_inv_rev := by rintro (_ | s) (_ | t) <;> 

Proof state:
case some.some
ι : Type u_1
α : Type u_2
inst✝ : OrderedCommGroup α
s✝ t✝ : Interval α
src✝ : CommMonoid (Interval α) := commMonoid
s t : NonemptyInterval α
⊢ (some s * some t)⁻¹ = (some t)⁻¹ * (some s)⁻¹

Next tactic:
first |rfl|exact congr_arg some (mul_inv_rev _ _)
@[to_additive existing Interval.subtractionCommMonoid]
instance divisionCommMonoid : DivisionCommMonoid (Interval α) :=
  { Interval.commMonoid with
    inv := Inv.inv
    div := (· / ·)
    div_eq_mul_inv := by
      rintro (_ | s) (_ | t) <;> first |rfl|exact congr_arg some (div_eq_mul_inv _ _)
    inv_inv := by rintro (_ | s) <;> first |rfl|exact congr_arg some (inv_inv _)
    mul_inv_rev := by rintro (_ | s) (_ | t) <;> first |

Proof state:
case some.some
ι : Type u_1
α : Type u_2
inst✝ : OrderedCommGroup α
s✝ t✝ : Interval α
src✝ : CommMonoid (Interval α) := commMonoid
s t : NonemptyInterval α
⊢ (some s * some t)⁻¹ = (some t)⁻¹ * (some s)⁻¹

Next tactic:
rfl
@[to_additive existing Interval.subtractionCommMonoid]
instance divisionCommMonoid : DivisionCommMonoid (Interval α) :=
  { Interval.commMonoid with
    inv := Inv.inv
    div := (· / ·)
    div_eq_mul_inv := by
      rintro (_ | s) (_ | t) <;> first |rfl|exact congr_arg some (div_eq_mul_inv _ _)
    inv_inv := by rintro (_ | s) <;> first |rfl|exact congr_arg some (inv_inv _)
    mul_inv_rev := by rintro (_ | s) (_ | t) <;> first |rfl|

Proof state:
case some.some
ι : Type u_1
α : Type u_2
inst✝ : OrderedCommGroup α
s✝ t✝ : Interval α
src✝ : CommMonoid (Interval α) := commMonoid
s t : NonemptyInterval α
⊢ (some s * some t)⁻¹ = (some t)⁻¹ * (some s)⁻¹

Next tactic:
exact congr_arg some (mul_inv_rev _ _)
@[to_additive existing Interval.subtractionCommMonoid]
instance divisionCommMonoid : DivisionCommMonoid (Interval α) :=
  { Interval.commMonoid with
    inv := Inv.inv
    div := (· / ·)
    div_eq_mul_inv := by
      rintro (_ | s) (_ | t) <;> first |rfl|exact congr_arg some (div_eq_mul_inv _ _)
    inv_inv := by rintro (_ | s) <;> first |rfl|exact congr_arg some (inv_inv _)
    mul_inv_rev := by rintro (_ | s) (_ | t) <;> first |rfl|exact congr_arg some (mul_inv_rev _ _)
    inv_eq_of_mul := by
      

Proof state:
ι : Type u_1
α : Type u_2
inst✝ : OrderedCommGroup α
s t : Interval α
src✝ : CommMonoid (Interval α) := commMonoid
⊢ ∀ (a b : Interval α), a * b = 1 → a⁻¹ = b

Next tactic:
rintro (_ | s) (_ | t) h
@[to_additive existing Interval.subtractionCommMonoid]
instance divisionCommMonoid : DivisionCommMonoid (Interval α) :=
  { Interval.commMonoid with
    inv := Inv.inv
    div := (· / ·)
    div_eq_mul_inv := by
      rintro (_ | s) (_ | t) <;> first |rfl|exact congr_arg some (div_eq_mul_inv _ _)
    inv_inv := by rintro (_ | s) <;> first |rfl|exact congr_arg some (inv_inv _)
    mul_inv_rev := by rintro (_ | s) (_ | t) <;> first |rfl|exact congr_arg some (mul_inv_rev _ _)
    inv_eq_of_mul := by
      rintro (_ | s) (_ | t) h <;>
        

Proof state:
case none.none
ι : Type u_1
α : Type u_2
inst✝ : OrderedCommGroup α
s t : Interval α
src✝ : CommMonoid (Interval α) := commMonoid
h : none * none = 1
⊢ none⁻¹ = none

Next tactic:
first
          | cases h
          | exact congr_arg some (inv_eq_of_mul_eq_one_right <| Option.some_injective _ h)
@[to_additive existing Interval.subtractionCommMonoid]
instance divisionCommMonoid : DivisionCommMonoid (Interval α) :=
  { Interval.commMonoid with
    inv := Inv.inv
    div := (· / ·)
    div_eq_mul_inv := by
      rintro (_ | s) (_ | t) <;> first |rfl|exact congr_arg some (div_eq_mul_inv _ _)
    inv_inv := by rintro (_ | s) <;> first |rfl|exact congr_arg some (inv_inv _)
    mul_inv_rev := by rintro (_ | s) (_ | t) <;> first |rfl|exact congr_arg some (mul_inv_rev _ _)
    inv_eq_of_mul := by
      rintro (_ | s) (_ | t) h <;>
        first
          | 

Proof state:
case none.none
ι : Type u_1
α : Type u_2
inst✝ : OrderedCommGroup α
s t : Interval α
src✝ : CommMonoid (Interval α) := commMonoid
h : none * none = 1
⊢ none⁻¹ = none

Next tactic:
cases h
@[to_additive existing Interval.subtractionCommMonoid]
instance divisionCommMonoid : DivisionCommMonoid (Interval α) :=
  { Interval.commMonoid with
    inv := Inv.inv
    div := (· / ·)
    div_eq_mul_inv := by
      rintro (_ | s) (_ | t) <;> first |rfl|exact congr_arg some (div_eq_mul_inv _ _)
    inv_inv := by rintro (_ | s) <;> first |rfl|exact congr_arg some (inv_inv _)
    mul_inv_rev := by rintro (_ | s) (_ | t) <;> first |rfl|exact congr_arg some (mul_inv_rev _ _)
    inv_eq_of_mul := by
      rintro (_ | s) (_ | t) h <;>
        

Proof state:
case none.some
ι : Type u_1
α : Type u_2
inst✝ : OrderedCommGroup α
s t✝ : Interval α
src✝ : CommMonoid (Interval α) := commMonoid
t : NonemptyInterval α
h : none * some t = 1
⊢ none⁻¹ = some t

Next tactic:
first
          | cases h
          | exact congr_arg some (inv_eq_of_mul_eq_one_right <| Option.some_injective _ h)
@[to_additive existing Interval.subtractionCommMonoid]
instance divisionCommMonoid : DivisionCommMonoid (Interval α) :=
  { Interval.commMonoid with
    inv := Inv.inv
    div := (· / ·)
    div_eq_mul_inv := by
      rintro (_ | s) (_ | t) <;> first |rfl|exact congr_arg some (div_eq_mul_inv _ _)
    inv_inv := by rintro (_ | s) <;> first |rfl|exact congr_arg some (inv_inv _)
    mul_inv_rev := by rintro (_ | s) (_ | t) <;> first |rfl|exact congr_arg some (mul_inv_rev _ _)
    inv_eq_of_mul := by
      rintro (_ | s) (_ | t) h <;>
        first
          | 

Proof state:
case none.some
ι : Type u_1
α : Type u_2
inst✝ : OrderedCommGroup α
s t✝ : Interval α
src✝ : CommMonoid (Interval α) := commMonoid
t : NonemptyInterval α
h : none * some t = 1
⊢ none⁻¹ = some t

Next tactic:
cases h
@[to_additive existing Interval.subtractionCommMonoid]
instance divisionCommMonoid : DivisionCommMonoid (Interval α) :=
  { Interval.commMonoid with
    inv := Inv.inv
    div := (· / ·)
    div_eq_mul_inv := by
      rintro (_ | s) (_ | t) <;> first |rfl|exact congr_arg some (div_eq_mul_inv _ _)
    inv_inv := by rintro (_ | s) <;> first |rfl|exact congr_arg some (inv_inv _)
    mul_inv_rev := by rintro (_ | s) (_ | t) <;> first |rfl|exact congr_arg some (mul_inv_rev _ _)
    inv_eq_of_mul := by
      rintro (_ | s) (_ | t) h <;>
        

Proof state:
case some.none
ι : Type u_1
α : Type u_2
inst✝ : OrderedCommGroup α
s✝ t : Interval α
src✝ : CommMonoid (Interval α) := commMonoid
s : NonemptyInterval α
h : some s * none = 1
⊢ (some s)⁻¹ = none

Next tactic:
first
          | cases h
          | exact congr_arg some (inv_eq_of_mul_eq_one_right <| Option.some_injective _ h)
@[to_additive existing Interval.subtractionCommMonoid]
instance divisionCommMonoid : DivisionCommMonoid (Interval α) :=
  { Interval.commMonoid with
    inv := Inv.inv
    div := (· / ·)
    div_eq_mul_inv := by
      rintro (_ | s) (_ | t) <;> first |rfl|exact congr_arg some (div_eq_mul_inv _ _)
    inv_inv := by rintro (_ | s) <;> first |rfl|exact congr_arg some (inv_inv _)
    mul_inv_rev := by rintro (_ | s) (_ | t) <;> first |rfl|exact congr_arg some (mul_inv_rev _ _)
    inv_eq_of_mul := by
      rintro (_ | s) (_ | t) h <;>
        first
          | 

Proof state:
case some.none
ι : Type u_1
α : Type u_2
inst✝ : OrderedCommGroup α
s✝ t : Interval α
src✝ : CommMonoid (Interval α) := commMonoid
s : NonemptyInterval α
h : some s * none = 1
⊢ (some s)⁻¹ = none

Next tactic:
cases h
@[to_additive existing Interval.subtractionCommMonoid]
instance divisionCommMonoid : DivisionCommMonoid (Interval α) :=
  { Interval.commMonoid with
    inv := Inv.inv
    div := (· / ·)
    div_eq_mul_inv := by
      rintro (_ | s) (_ | t) <;> first |rfl|exact congr_arg some (div_eq_mul_inv _ _)
    inv_inv := by rintro (_ | s) <;> first |rfl|exact congr_arg some (inv_inv _)
    mul_inv_rev := by rintro (_ | s) (_ | t) <;> first |rfl|exact congr_arg some (mul_inv_rev _ _)
    inv_eq_of_mul := by
      rintro (_ | s) (_ | t) h <;>
        

Proof state:
case some.some
ι : Type u_1
α : Type u_2
inst✝ : OrderedCommGroup α
s✝ t✝ : Interval α
src✝ : CommMonoid (Interval α) := commMonoid
s t : NonemptyInterval α
h : some s * some t = 1
⊢ (some s)⁻¹ = some t

Next tactic:
first
          | cases h
          | exact congr_arg some (inv_eq_of_mul_eq_one_right <| Option.some_injective _ h)
@[to_additive existing Interval.subtractionCommMonoid]
instance divisionCommMonoid : DivisionCommMonoid (Interval α) :=
  { Interval.commMonoid with
    inv := Inv.inv
    div := (· / ·)
    div_eq_mul_inv := by
      rintro (_ | s) (_ | t) <;> first |rfl|exact congr_arg some (div_eq_mul_inv _ _)
    inv_inv := by rintro (_ | s) <;> first |rfl|exact congr_arg some (inv_inv _)
    mul_inv_rev := by rintro (_ | s) (_ | t) <;> first |rfl|exact congr_arg some (mul_inv_rev _ _)
    inv_eq_of_mul := by
      rintro (_ | s) (_ | t) h <;>
        first
          | 

Proof state:
case some.some
ι : Type u_1
α : Type u_2
inst✝ : OrderedCommGroup α
s✝ t✝ : Interval α
src✝ : CommMonoid (Interval α) := commMonoid
s t : NonemptyInterval α
h : some s * some t = 1
⊢ (some s)⁻¹ = some t

Next tactic:
cases h
@[to_additive existing Interval.subtractionCommMonoid]
instance divisionCommMonoid : DivisionCommMonoid (Interval α) :=
  { Interval.commMonoid with
    inv := Inv.inv
    div := (· / ·)
    div_eq_mul_inv := by
      rintro (_ | s) (_ | t) <;> first |rfl|exact congr_arg some (div_eq_mul_inv _ _)
    inv_inv := by rintro (_ | s) <;> first |rfl|exact congr_arg some (inv_inv _)
    mul_inv_rev := by rintro (_ | s) (_ | t) <;> first |rfl|exact congr_arg some (mul_inv_rev _ _)
    inv_eq_of_mul := by
      rintro (_ | s) (_ | t) h <;>
        first
          | cases h
          | 

Proof state:
case some.some
ι : Type u_1
α : Type u_2
inst✝ : OrderedCommGroup α
s✝ t✝ : Interval α
src✝ : CommMonoid (Interval α) := commMonoid
s t : NonemptyInterval α
h : some s * some t = 1
⊢ (some s)⁻¹ = some t

Next tactic:
exact congr_arg some (inv_eq_of_mul_eq_one_right <| Option.some_injective _ h)
@[simp]
theorem length_sub : (s - t).length = s.length + t.length := by 

Proof state:
ι : Type u_1
α : Type u_2
inst✝ : OrderedAddCommGroup α
s t : NonemptyInterval α
a : α
⊢ length (s - t) = length s + length t

Next tactic:
simp [sub_eq_add_neg]
theorem length_add_le : ∀ s t : Interval α, (s + t).length ≤ s.length + t.length
  | ⊥, _ => by 

Proof state:
ι : Type u_1
α : Type u_2
inst✝ : OrderedAddCommGroup α
s t : Interval α
a : α
x✝ : Interval α
⊢ length (⊥ + x✝) ≤ length ⊥ + length x✝

Next tactic:
simp
theorem length_add_le : ∀ s t : Interval α, (s + t).length ≤ s.length + t.length
  | ⊥, _ => by simp
  | _, ⊥ => by 

Proof state:
ι : Type u_1
α : Type u_2
inst✝ : OrderedAddCommGroup α
s t : Interval α
a : α
x✝ : Interval α
⊢ length (x✝ + ⊥) ≤ length x✝ + length ⊥

Next tactic:
simp
theorem length_sub_le : (s - t).length ≤ s.length + t.length := by
  

Proof state:
ι : Type u_1
α : Type u_2
inst✝ : OrderedAddCommGroup α
s t : Interval α
a : α
⊢ length (s - t) ≤ length s + length t

Next tactic:
simpa [sub_eq_add_neg] using length_add_le s (-t)
theorem length_sum_le (f : ι → Interval α) (s : Finset ι) :
    (∑ i in s, f i).length ≤ ∑ i in s, (f i).length := by
  -- Porting note: Old proof was `:= Finset.le_sum_of_subadditive _ length_zero length_add_le _ _`
  

Proof state:
ι : Type u_1
α : Type u_2
inst✝ : OrderedAddCommGroup α
s✝ t : Interval α
a : α
f : ι → Interval α
s : Finset ι
⊢ length (∑ i in s, f i) ≤ ∑ i in s, length (f i)

Next tactic:
apply Finset.le_sum_of_subadditive
theorem length_sum_le (f : ι → Interval α) (s : Finset ι) :
    (∑ i in s, f i).length ≤ ∑ i in s, (f i).length := by
  -- Porting note: Old proof was `:= Finset.le_sum_of_subadditive _ length_zero length_add_le _ _`
  apply Finset.le_sum_of_subadditive
  

Proof state:
case h_one
ι : Type u_1
α : Type u_2
inst✝ : OrderedAddCommGroup α
s✝ t : Interval α
a : α
f : ι → Interval α
s : Finset ι
⊢ length 0 = 0
case h_mul
ι : Type u_1
α : Type u_2
inst✝ : OrderedAddCommGroup α
s✝ t : Interval α
a : α
f : ι → Interval α
s : Finset ι
⊢ ∀ (x y : Interval α), length (x + y) ≤ length x + length y

Next tactic:
exact length_zero
theorem length_sum_le (f : ι → Interval α) (s : Finset ι) :
    (∑ i in s, f i).length ≤ ∑ i in s, (f i).length := by
  -- Porting note: Old proof was `:= Finset.le_sum_of_subadditive _ length_zero length_add_le _ _`
  apply Finset.le_sum_of_subadditive
  exact length_zero
  

Proof state:
case h_mul
ι : Type u_1
α : Type u_2
inst✝ : OrderedAddCommGroup α
s✝ t : Interval α
a : α
f : ι → Interval α
s : Finset ι
⊢ ∀ (x y : Interval α), length (x + y) ≤ length x + length y

Next tactic:
exact length_add_le
lemma nil_ne_cons (p : Path a b) (e : b ⟶ a) : Path.nil ≠ p.cons e :=
  fun h => by 

Proof state:
V : Type u
inst✝ : Quiver V
a b c d : V
p : Path a b
e : b ⟶ a
h : nil = cons p e
⊢ False

Next tactic:
injection h
lemma cons_ne_nil (p : Path a b) (e : b ⟶ a) : p.cons e ≠ Path.nil :=
  fun h => by 

Proof state:
V : Type u
inst✝ : Quiver V
a b c d : V
p : Path a b
e : b ⟶ a
h : cons p e = nil
⊢ False

Next tactic:
injection h
lemma obj_eq_of_cons_eq_cons {p : Path a b} {p' : Path a c}
    {e : b ⟶ d} {e' : c ⟶ d} (h : p.cons e = p'.cons e') : b = c := by 

Proof state:
V : Type u
inst✝ : Quiver V
a b c d : V
p : Path a b
p' : Path a c
e : b ⟶ d
e' : c ⟶ d
h : cons p e = cons p' e'
⊢ b = c

Next tactic:
injection h
lemma heq_of_cons_eq_cons {p : Path a b} {p' : Path a c}
    {e : b ⟶ d} {e' : c ⟶ d} (h : p.cons e = p'.cons e') : HEq p p' := by 

Proof state:
V : Type u
inst✝ : Quiver V
a b c d : V
p : Path a b
p' : Path a c
e : b ⟶ d
e' : c ⟶ d
h : cons p e = cons p' e'
⊢ HEq p p'

Next tactic:
injection h
lemma hom_heq_of_cons_eq_cons {p : Path a b} {p' : Path a c}
    {e : b ⟶ d} {e' : c ⟶ d} (h : p.cons e = p'.cons e') : HEq e e' := by 

Proof state:
V : Type u
inst✝ : Quiver V
a b c d : V
p : Path a b
p' : Path a c
e : b ⟶ d
e' : c ⟶ d
h : cons p e = cons p' e'
⊢ HEq e e'

Next tactic:
injection h
theorem eq_of_length_zero (p : Path a b) (hzero : p.length = 0) : a = b := by
  

Proof state:
V : Type u
inst✝ : Quiver V
a b c d : V
p : Path a b
hzero : length p = 0
⊢ a = b

Next tactic:
cases p
theorem eq_of_length_zero (p : Path a b) (hzero : p.length = 0) : a = b := by
  cases p
  · 

Proof state:
case nil
V : Type u
inst✝ : Quiver V
a c d : V
hzero : length nil = 0
⊢ a = a

Next tactic:
rfl
theorem eq_of_length_zero (p : Path a b) (hzero : p.length = 0) : a = b := by
  cases p
  · rfl
  · 

Proof state:
case cons
V : Type u
inst✝ : Quiver V
a b c d b✝ : V
a✝¹ : Path a b✝
a✝ : b✝ ⟶ b
hzero : length (cons a✝¹ a✝) = 0
⊢ a = b

Next tactic:
cases Nat.succ_ne_zero _ hzero
@[simp]
theorem nil_comp {a : V} : ∀ {b} (p : Path a b), Path.nil.comp p = p
  | _, nil => rfl
  | _, cons p _ => by 

Proof state:
V : Type u
inst✝ : Quiver V
a✝¹ b c d a x✝ b✝ : V
p : Path a b✝
a✝ : b✝ ⟶ x✝
⊢ comp nil (cons p a✝) = cons p a✝

Next tactic:
rw [comp_cons, nil_comp p]
@[simp]
theorem comp_assoc {a b c : V} :
    ∀ {d} (p : Path a b) (q : Path b c) (r : Path c d), (p.comp q).comp r = p.comp (q.comp r)
  | _, _, _, nil => rfl
  | _, p, q, cons r _ => by 

Proof state:
V : Type u
inst✝ : Quiver V
a✝¹ b✝¹ c✝ d a b c x✝ : V
p : Path a b
q : Path b c
b✝ : V
r : Path c b✝
a✝ : b✝ ⟶ x✝
⊢ comp (comp p q) (cons r a✝) = comp p (comp q (cons r a✝))

Next tactic:
rw [comp_cons, comp_cons, comp_cons, comp_assoc p q r]
theorem comp_inj {p₁ p₂ : Path a b} {q₁ q₂ : Path b c} (hq : q₁.length = q₂.length) :
    p₁.comp q₁ = p₂.comp q₂ ↔ p₁ = p₂ ∧ q₁ = q₂ := by
  

Proof state:
V : Type u
inst✝ : Quiver V
a b c d : V
p₁ p₂ : Path a b
q₁ q₂ : Path b c
hq : length q₁ = length q₂
⊢ comp p₁ q₁ = comp p₂ q₂ ↔ p₁ = p₂ ∧ q₁ = q₂

Next tactic:
refine' ⟨fun h => _, by rintro ⟨rfl, rfl⟩; rfl⟩
theorem comp_inj {p₁ p₂ : Path a b} {q₁ q₂ : Path b c} (hq : q₁.length = q₂.length) :
    p₁.comp q₁ = p₂.comp q₂ ↔ p₁ = p₂ ∧ q₁ = q₂ := by
  refine' ⟨fun h => _, by 

Proof state:
V : Type u
inst✝ : Quiver V
a b c d : V
p₁ p₂ : Path a b
q₁ q₂ : Path b c
hq : length q₁ = length q₂
⊢ p₁ = p₂ ∧ q₁ = q₂ → comp p₁ q₁ = comp p₂ q₂

Next tactic:
rintro ⟨rfl, rfl⟩
theorem comp_inj {p₁ p₂ : Path a b} {q₁ q₂ : Path b c} (hq : q₁.length = q₂.length) :
    p₁.comp q₁ = p₂.comp q₂ ↔ p₁ = p₂ ∧ q₁ = q₂ := by
  refine' ⟨fun h => _, by rintro ⟨rfl, rfl⟩; 

Proof state:
case intro
V : Type u
inst✝ : Quiver V
a b c d : V
p₁ : Path a b
q₁ : Path b c
hq : length q₁ = length q₁
⊢ comp p₁ q₁ = comp p₁ q₁

Next tactic:
rfl
theorem comp_inj {p₁ p₂ : Path a b} {q₁ q₂ : Path b c} (hq : q₁.length = q₂.length) :
    p₁.comp q₁ = p₂.comp q₂ ↔ p₁ = p₂ ∧ q₁ = q₂ := by
  refine' ⟨fun h => _, by rintro ⟨rfl, rfl⟩; rfl⟩
  

Proof state:
V : Type u
inst✝ : Quiver V
a b c d : V
p₁ p₂ : Path a b
q₁ q₂ : Path b c
hq : length q₁ = length q₂
h : comp p₁ q₁ = comp p₂ q₂
⊢ p₁ = p₂ ∧ q₁ = q₂

Next tactic:
induction' q₁ with d₁ e₁ q₁ f₁ ih
theorem comp_inj {p₁ p₂ : Path a b} {q₁ q₂ : Path b c} (hq : q₁.length = q₂.length) :
    p₁.comp q₁ = p₂.comp q₂ ↔ p₁ = p₂ ∧ q₁ = q₂ := by
  refine' ⟨fun h => _, by rintro ⟨rfl, rfl⟩; rfl⟩
  induction' q₁ with d₁ e₁ q₁ f₁ ih <;> 

Proof state:
case nil
V : Type u
inst✝ : Quiver V
a b c d : V
p₁ p₂ : Path a b
q₂ : Path b b
hq : length nil = length q₂
h : comp p₁ nil = comp p₂ q₂
⊢ p₁ = p₂ ∧ nil = q₂

Next tactic:
obtain _ | ⟨q₂, f₂⟩ := q₂
theorem comp_inj {p₁ p₂ : Path a b} {q₁ q₂ : Path b c} (hq : q₁.length = q₂.length) :
    p₁.comp q₁ = p₂.comp q₂ ↔ p₁ = p₂ ∧ q₁ = q₂ := by
  refine' ⟨fun h => _, by rintro ⟨rfl, rfl⟩; rfl⟩
  induction' q₁ with d₁ e₁ q₁ f₁ ih <;> 

Proof state:
case cons
V : Type u
inst✝ : Quiver V
a b c d : V
p₁ p₂ : Path a b
d₁ e₁ : V
q₁ : Path b d₁
f₁ : d₁ ⟶ e₁
ih : ∀ {q₂ : Path b d₁}, length q₁ = length q₂ → comp p₁ q₁ = comp p₂ q₂ → p₁ = p₂ ∧ q₁ = q₂
q₂ : Path b e₁
hq : length (cons q₁ f₁) = length q₂
h : comp p₁ (cons q₁ f₁) = comp p₂ q₂
⊢ p₁ = p₂ ∧ cons q₁ f₁ = q₂

Next tactic:
obtain _ | ⟨q₂, f₂⟩ := q₂
theorem comp_inj {p₁ p₂ : Path a b} {q₁ q₂ : Path b c} (hq : q₁.length = q₂.length) :
    p₁.comp q₁ = p₂.comp q₂ ↔ p₁ = p₂ ∧ q₁ = q₂ := by
  refine' ⟨fun h => _, by rintro ⟨rfl, rfl⟩; rfl⟩
  induction' q₁ with d₁ e₁ q₁ f₁ ih <;> obtain _ | ⟨q₂, f₂⟩ := q₂
  · 

Proof state:
case nil.nil
V : Type u
inst✝ : Quiver V
a b c d : V
p₁ p₂ : Path a b
hq : length nil = length nil
h : comp p₁ nil = comp p₂ nil
⊢ p₁ = p₂ ∧ nil = nil

Next tactic:
exact ⟨h, rfl⟩
theorem comp_inj {p₁ p₂ : Path a b} {q₁ q₂ : Path b c} (hq : q₁.length = q₂.length) :
    p₁.comp q₁ = p₂.comp q₂ ↔ p₁ = p₂ ∧ q₁ = q₂ := by
  refine' ⟨fun h => _, by rintro ⟨rfl, rfl⟩; rfl⟩
  induction' q₁ with d₁ e₁ q₁ f₁ ih <;> obtain _ | ⟨q₂, f₂⟩ := q₂
  · exact ⟨h, rfl⟩
  · 

Proof state:
case nil.cons
V : Type u
inst✝ : Quiver V
a b c d : V
p₁ p₂ : Path a b
b✝ : V
q₂ : Path b b✝
f₂ : b✝ ⟶ b
hq : length nil = length (cons q₂ f₂)
h : comp p₁ nil = comp p₂ (cons q₂ f₂)
⊢ p₁ = p₂ ∧ nil = cons q₂ f₂

Next tactic:
cases hq
theorem comp_inj {p₁ p₂ : Path a b} {q₁ q₂ : Path b c} (hq : q₁.length = q₂.length) :
    p₁.comp q₁ = p₂.comp q₂ ↔ p₁ = p₂ ∧ q₁ = q₂ := by
  refine' ⟨fun h => _, by rintro ⟨rfl, rfl⟩; rfl⟩
  induction' q₁ with d₁ e₁ q₁ f₁ ih <;> obtain _ | ⟨q₂, f₂⟩ := q₂
  · exact ⟨h, rfl⟩
  · cases hq
  · 

Proof state:
case cons.nil
V : Type u
inst✝ : Quiver V
a b c d : V
p₁ p₂ : Path a b
d₁ : V
q₁ : Path b d₁
ih : ∀ {q₂ : Path b d₁}, length q₁ = length q₂ → comp p₁ q₁ = comp p₂ q₂ → p₁ = p₂ ∧ q₁ = q₂
f₁ : d₁ ⟶ b
hq : length (cons q₁ f₁) = length nil
h : comp p₁ (cons q₁ f₁) = comp p₂ nil
⊢ p₁ = p₂ ∧ cons q₁ f₁ = nil

Next tactic:
cases hq
theorem comp_inj {p₁ p₂ : Path a b} {q₁ q₂ : Path b c} (hq : q₁.length = q₂.length) :
    p₁.comp q₁ = p₂.comp q₂ ↔ p₁ = p₂ ∧ q₁ = q₂ := by
  refine' ⟨fun h => _, by rintro ⟨rfl, rfl⟩; rfl⟩
  induction' q₁ with d₁ e₁ q₁ f₁ ih <;> obtain _ | ⟨q₂, f₂⟩ := q₂
  · exact ⟨h, rfl⟩
  · cases hq
  · cases hq
  · 

Proof state:
case cons.cons
V : Type u
inst✝ : Quiver V
a b c d : V
p₁ p₂ : Path a b
d₁ e₁ : V
q₁ : Path b d₁
f₁ : d₁ ⟶ e₁
ih : ∀ {q₂ : Path b d₁}, length q₁ = length q₂ → comp p₁ q₁ = comp p₂ q₂ → p₁ = p₂ ∧ q₁ = q₂
b✝ : V
q₂ : Path b b✝
f₂ : b✝ ⟶ e₁
hq : length (cons q₁ f₁) = length (cons q₂ f₂)
h : comp p₁ (cons q₁ f₁) = comp p₂ (cons q₂ f₂)
⊢ p₁ = p₂ ∧ cons q₁ f₁ = cons q₂ f₂

Next tactic:
simp only [comp_cons, cons.injEq] at h
theorem comp_inj {p₁ p₂ : Path a b} {q₁ q₂ : Path b c} (hq : q₁.length = q₂.length) :
    p₁.comp q₁ = p₂.comp q₂ ↔ p₁ = p₂ ∧ q₁ = q₂ := by
  refine' ⟨fun h => _, by rintro ⟨rfl, rfl⟩; rfl⟩
  induction' q₁ with d₁ e₁ q₁ f₁ ih <;> obtain _ | ⟨q₂, f₂⟩ := q₂
  · exact ⟨h, rfl⟩
  · cases hq
  · cases hq
  · simp only [comp_cons, cons.injEq] at h
    

Proof state:
case cons.cons
V : Type u
inst✝ : Quiver V
a b c d : V
p₁ p₂ : Path a b
d₁ e₁ : V
q₁ : Path b d₁
f₁ : d₁ ⟶ e₁
ih : ∀ {q₂ : Path b d₁}, length q₁ = length q₂ → comp p₁ q₁ = comp p₂ q₂ → p₁ = p₂ ∧ q₁ = q₂
b✝ : V
q₂ : Path b b✝
f₂ : b✝ ⟶ e₁
hq : length (cons q₁ f₁) = length (cons q₂ f₂)
h : d₁ = b✝ ∧ HEq (comp p₁ q₁) (comp p₂ q₂) ∧ HEq f₁ f₂
⊢ p₁ = p₂ ∧ cons q₁ f₁ = cons q₂ f₂

Next tactic:
obtain rfl := h.1
theorem comp_inj {p₁ p₂ : Path a b} {q₁ q₂ : Path b c} (hq : q₁.length = q₂.length) :
    p₁.comp q₁ = p₂.comp q₂ ↔ p₁ = p₂ ∧ q₁ = q₂ := by
  refine' ⟨fun h => _, by rintro ⟨rfl, rfl⟩; rfl⟩
  induction' q₁ with d₁ e₁ q₁ f₁ ih <;> obtain _ | ⟨q₂, f₂⟩ := q₂
  · exact ⟨h, rfl⟩
  · cases hq
  · cases hq
  · simp only [comp_cons, cons.injEq] at h
    obtain rfl := h.1
    

Proof state:
case cons.cons
V : Type u
inst✝ : Quiver V
a b c d : V
p₁ p₂ : Path a b
d₁ e₁ : V
q₁ : Path b d₁
f₁ : d₁ ⟶ e₁
ih : ∀ {q₂ : Path b d₁}, length q₁ = length q₂ → comp p₁ q₁ = comp p₂ q₂ → p₁ = p₂ ∧ q₁ = q₂
q₂ : Path b d₁
f₂ : d₁ ⟶ e₁
hq : length (cons q₁ f₁) = length (cons q₂ f₂)
h : d₁ = d₁ ∧ HEq (comp p₁ q₁) (comp p₂ q₂) ∧ HEq f₁ f₂
⊢ p₁ = p₂ ∧ cons q₁ f₁ = cons q₂ f₂

Next tactic:
obtain ⟨rfl, rfl⟩ := ih (Nat.succ.inj hq) h.2.1.eq
theorem comp_inj {p₁ p₂ : Path a b} {q₁ q₂ : Path b c} (hq : q₁.length = q₂.length) :
    p₁.comp q₁ = p₂.comp q₂ ↔ p₁ = p₂ ∧ q₁ = q₂ := by
  refine' ⟨fun h => _, by rintro ⟨rfl, rfl⟩; rfl⟩
  induction' q₁ with d₁ e₁ q₁ f₁ ih <;> obtain _ | ⟨q₂, f₂⟩ := q₂
  · exact ⟨h, rfl⟩
  · cases hq
  · cases hq
  · simp only [comp_cons, cons.injEq] at h
    obtain rfl := h.1
    obtain ⟨rfl, rfl⟩ := ih (Nat.succ.inj hq) h.2.1.eq
    

Proof state:
case cons.cons.intro
V : Type u
inst✝ : Quiver V
a b c d : V
p₁ : Path a b
d₁ e₁ : V
q₁ : Path b d₁
f₁ f₂ : d₁ ⟶ e₁
ih : ∀ {q₂ : Path b d₁}, length q₁ = length q₂ → comp p₁ q₁ = comp p₁ q₂ → p₁ = p₁ ∧ q₁ = q₂
hq : length (cons q₁ f₁) = length (cons q₁ f₂)
h : d₁ = d₁ ∧ HEq (comp p₁ q₁) (comp p₁ q₁) ∧ HEq f₁ f₂
⊢ p₁ = p₁ ∧ cons q₁ f₁ = cons q₁ f₂

Next tactic:
rw [h.2.2.eq]
theorem comp_inj {p₁ p₂ : Path a b} {q₁ q₂ : Path b c} (hq : q₁.length = q₂.length) :
    p₁.comp q₁ = p₂.comp q₂ ↔ p₁ = p₂ ∧ q₁ = q₂ := by
  refine' ⟨fun h => _, by rintro ⟨rfl, rfl⟩; rfl⟩
  induction' q₁ with d₁ e₁ q₁ f₁ ih <;> obtain _ | ⟨q₂, f₂⟩ := q₂
  · exact ⟨h, rfl⟩
  · cases hq
  · cases hq
  · simp only [comp_cons, cons.injEq] at h
    obtain rfl := h.1
    obtain ⟨rfl, rfl⟩ := ih (Nat.succ.inj hq) h.2.1.eq
    rw [h.2.2.eq]
    

Proof state:
case cons.cons.intro
V : Type u
inst✝ : Quiver V
a b c d : V
p₁ : Path a b
d₁ e₁ : V
q₁ : Path b d₁
f₁ f₂ : d₁ ⟶ e₁
ih : ∀ {q₂ : Path b d₁}, length q₁ = length q₂ → comp p₁ q₁ = comp p₁ q₂ → p₁ = p₁ ∧ q₁ = q₂
hq : length (cons q₁ f₁) = length (cons q₁ f₂)
h : d₁ = d₁ ∧ HEq (comp p₁ q₁) (comp p₁ q₁) ∧ HEq f₁ f₂
⊢ p₁ = p₁ ∧ cons q₁ f₂ = cons q₁ f₂

Next tactic:
exact ⟨rfl, rfl⟩
theorem comp_inj' {p₁ p₂ : Path a b} {q₁ q₂ : Path b c} (h : p₁.length = p₂.length) :
    p₁.comp q₁ = p₂.comp q₂ ↔ p₁ = p₂ ∧ q₁ = q₂ :=
  ⟨fun h_eq => (comp_inj <| Nat.add_left_cancel <| by 

Proof state:
V : Type u
inst✝ : Quiver V
a b c d : V
p₁ p₂ : Path a b
q₁ q₂ : Path b c
h : length p₁ = length p₂
h_eq : comp p₁ q₁ = comp p₂ q₂
⊢ ?m.8802 h h_eq + length q₁ = ?m.8802 h h_eq + length q₂

Next tactic:
simpa [h] using congr_arg length h_eq