Theorem: PFunctor.Approx.head_succ'
File: Mathlib/Data/PFunctor/Univariate/M.lean

tactic: suffices ∀ n, head' (x (succ n)) = head' (x 1) by simp [this]
state_before: F : PFunctor.{u}
X : Type w
f : X → ↑F X
n m : ℕ
x : (n : ℕ) → CofixA F n
Hconsistent : AllAgree x
⊢ head' (x n.succ) = head' (x m.succ)
state_after: F : PFunctor.{u}
X : Type w
f : X → ↑F X
n m : ℕ
x : (n : ℕ) → CofixA F n
Hconsistent : AllAgree x
⊢ ∀ (n : ℕ), head' (x n.succ) = head' (x 1)

tactic: clear m n
state_before: F : PFunctor.{u}
X : Type w
f : X → ↑F X
n m : ℕ
x : (n : ℕ) → CofixA F n
Hconsistent : AllAgree x
⊢ ∀ (n : ℕ), head' (x n.succ) = head' (x 1)
state_after: F : PFunctor.{u}
X : Type w
f : X → ↑F X
x : (n : ℕ) → CofixA F n
Hconsistent : AllAgree x
⊢ ∀ (n : ℕ), head' (x n.succ) = head' (x 1)

tactic: intro n
state_before: F : PFunctor.{u}
X : Type w
f : X → ↑F X
x : (n : ℕ) → CofixA F n
Hconsistent : AllAgree x
⊢ ∀ (n : ℕ), head' (x n.succ) = head' (x 1)
state_after: F : PFunctor.{u}
X : Type w
f : X → ↑F X
x : (n : ℕ) → CofixA F n
Hconsistent : AllAgree x
n : ℕ
⊢ head' (x n.succ) = head' (x 1)

tactic: cases' h₀ : x (succ n) with _ i₀ f₀
state_before: F : PFunctor.{u}
X : Type w
f : X → ↑F X
x : (n : ℕ) → CofixA F n
Hconsistent : AllAgree x
n : ℕ
⊢ head' (x n.succ) = head' (x 1)
state_after: case intro
F : PFunctor.{u}
X : Type w
f : X → ↑F X
x : (n : ℕ) → CofixA F n
Hconsistent : AllAgree x
n : ℕ
i₀ : F.A
f₀ : F.B i₀ → CofixA F n
h₀ : x n.succ = CofixA.intro i₀ f₀
⊢ head' (CofixA.intro i₀ f₀) = head' (x 1)

tactic: cases' h₁ : x 1 with _ i₁ f₁
state_before: case intro
F : PFunctor.{u}
X : Type w
f : X → ↑F X
x : (n : ℕ) → CofixA F n
Hconsistent : AllAgree x
n : ℕ
i₀ : F.A
f₀ : F.B i₀ → CofixA F n
h₀ : x n.succ = CofixA.intro i₀ f₀
⊢ head' (CofixA.intro i₀ f₀) = head' (x 1)
state_after: case intro.intro
F : PFunctor.{u}
X : Type w
f : X → ↑F X
x : (n : ℕ) → CofixA F n
Hconsistent : AllAgree x
n : ℕ
i₀ : F.A
f₀ : F.B i₀ → CofixA F n
h₀ : x n.succ = CofixA.intro i₀ f₀
i₁ : F.A
f₁ : F.B i₁ → CofixA F 0
h₁ : x 1 = CofixA.intro i₁ f₁
⊢ head' (CofixA.intro i₀ f₀) = head' (CofixA.intro i₁ f₁)

tactic: dsimp only [head']
state_before: case intro.intro
F : PFunctor.{u}
X : Type w
f : X → ↑F X
x : (n : ℕ) → CofixA F n
Hconsistent : AllAgree x
n : ℕ
i₀ : F.A
f₀ : F.B i₀ → CofixA F n
h₀ : x n.succ = CofixA.intro i₀ f₀
i₁ : F.A
f₁ : F.B i₁ → CofixA F 0
h₁ : x 1 = CofixA.intro i₁ f₁
⊢ head' (CofixA.intro i₀ f₀) = head' (CofixA.intro i₁ f₁)
state_after: case intro.intro
F : PFunctor.{u}
X : Type w
f : X → ↑F X
x : (n : ℕ) → CofixA F n
Hconsistent : AllAgree x
n : ℕ
i₀ : F.A
f₀ : F.B i₀ → CofixA F n
h₀ : x n.succ = CofixA.intro i₀ f₀
i₁ : F.A
f₁ : F.B i₁ → CofixA F 0
h₁ : x 1 = CofixA.intro i₁ f₁
⊢ (match n, CofixA.intro i₀ f₀ with
    | x, CofixA.intro i a => i) =
    match 0, CofixA.intro i₁ f₁ with
    | x, CofixA.intro i a => i

tactic: induction' n with n n_ih
state_before: case intro.intro
F : PFunctor.{u}
X : Type w
f : X → ↑F X
x : (n : ℕ) → CofixA F n
Hconsistent : AllAgree x
n : ℕ
i₀ : F.A
f₀ : F.B i₀ → CofixA F n
h₀ : x n.succ = CofixA.intro i₀ f₀
i₁ : F.A
f₁ : F.B i₁ → CofixA F 0
h₁ : x 1 = CofixA.intro i₁ f₁
⊢ (match n, CofixA.intro i₀ f₀ with
    | x, CofixA.intro i a => i) =
    match 0, CofixA.intro i₁ f₁ with
    | x, CofixA.intro i a => i
state_after: case intro.intro.zero
F : PFunctor.{u}
X : Type w
f : X → ↑F X
x : (n : ℕ) → CofixA F n
Hconsistent : AllAgree x
i₀ i₁ : F.A
f₁ : F.B i₁ → CofixA F 0
h₁ : x 1 = CofixA.intro i₁ f₁
f₀ : F.B i₀ → CofixA F 0
h₀ : x (succ 0) = CofixA.intro i₀ f₀
⊢ (match 0, CofixA.intro i₀ f₀ with
    | x, CofixA.intro i a => i) =
    match 0, CofixA.intro i₁ f₁ with
    | x, CofixA.intro i a => i

case intro.intro.succ
F : PFunctor.{u}
X : Type w
f : X → ↑F X
x : (n : ℕ) → CofixA F n
Hconsistent : AllAgree x
i₀ i₁ : F.A
f₁ : F.B i₁ → CofixA F 0
h₁ : x 1 = CofixA.intro i₁ f₁
n : ℕ
n_ih :
  ∀ (f₀ : F.B i₀ → CofixA F n),
    x n.succ = CofixA.intro i₀ f₀ →
      (match n, CofixA.intro i₀ f₀ with
        | x, CofixA.intro i a => i) =
        match 0, CofixA.intro i₁ f₁ with
        | x, CofixA.intro i a => i
f₀ : F.B i₀ → CofixA F (n + 1)
h₀ : x (n + 1).succ = CofixA.intro i₀ f₀
⊢ (match n + 1, CofixA.intro i₀ f₀ with
    | x, CofixA.intro i a => i) =
    match 0, CofixA.intro i₁ f₁ with
    | x, CofixA.intro i a => i

tactic: simp [this]
state_before: F : PFunctor.{u}
X : Type w
f : X → ↑F X
n m : ℕ
x : (n : ℕ) → CofixA F n
Hconsistent : AllAgree x
this : ∀ (n : ℕ), head' (x n.succ) = head' (x 1)
⊢ head' (x n.succ) = head' (x m.succ)
state_after: no goals

tactic: rw [h₁] at h₀
state_before: case intro.intro.zero
F : PFunctor.{u}
X : Type w
f : X → ↑F X
x : (n : ℕ) → CofixA F n
Hconsistent : AllAgree x
i₀ i₁ : F.A
f₁ : F.B i₁ → CofixA F 0
h₁ : x 1 = CofixA.intro i₁ f₁
f₀ : F.B i₀ → CofixA F 0
h₀ : x (succ 0) = CofixA.intro i₀ f₀
⊢ (match 0, CofixA.intro i₀ f₀ with
    | x, CofixA.intro i a => i) =
    match 0, CofixA.intro i₁ f₁ with
    | x, CofixA.intro i a => i
state_after: case intro.intro.zero
F : PFunctor.{u}
X : Type w
f : X → ↑F X
x : (n : ℕ) → CofixA F n
Hconsistent : AllAgree x
i₀ i₁ : F.A
f₁ : F.B i₁ → CofixA F 0
h₁ : x 1 = CofixA.intro i₁ f₁
f₀ : F.B i₀ → CofixA F 0
h₀ : CofixA.intro i₁ f₁ = CofixA.intro i₀ f₀
⊢ (match 0, CofixA.intro i₀ f₀ with
    | x, CofixA.intro i a => i) =
    match 0, CofixA.intro i₁ f₁ with
    | x, CofixA.intro i a => i

tactic: cases h₀
state_before: case intro.intro.zero
F : PFunctor.{u}
X : Type w
f : X → ↑F X
x : (n : ℕ) → CofixA F n
Hconsistent : AllAgree x
i₀ i₁ : F.A
f₁ : F.B i₁ → CofixA F 0
h₁ : x 1 = CofixA.intro i₁ f₁
f₀ : F.B i₀ → CofixA F 0
h₀ : CofixA.intro i₁ f₁ = CofixA.intro i₀ f₀
⊢ (match 0, CofixA.intro i₀ f₀ with
    | x, CofixA.intro i a => i) =
    match 0, CofixA.intro i₁ f₁ with
    | x, CofixA.intro i a => i
state_after: case intro.intro.zero.refl
F : PFunctor.{u}
X : Type w
f : X → ↑F X
x : (n : ℕ) → CofixA F n
Hconsistent : AllAgree x
i₀ : F.A
f₀ : F.B i₀ → CofixA F 0
h₁ : x 1 = CofixA.intro i₀ f₀
⊢ (match 0, CofixA.intro i₀ f₀ with
    | x, CofixA.intro i a => i) =
    match 0, CofixA.intro i₀ f₀ with
    | x, CofixA.intro i a => i

tactic: trivial
state_before: case intro.intro.zero.refl
F : PFunctor.{u}
X : Type w
f : X → ↑F X
x : (n : ℕ) → CofixA F n
Hconsistent : AllAgree x
i₀ : F.A
f₀ : F.B i₀ → CofixA F 0
h₁ : x 1 = CofixA.intro i₀ f₀
⊢ (match 0, CofixA.intro i₀ f₀ with
    | x, CofixA.intro i a => i) =
    match 0, CofixA.intro i₀ f₀ with
    | x, CofixA.intro i a => i
state_after: no goals

tactic: have H := Hconsistent (succ n)
state_before: case intro.intro.succ
F : PFunctor.{u}
X : Type w
f : X → ↑F X
x : (n : ℕ) → CofixA F n
Hconsistent : AllAgree x
i₀ i₁ : F.A
f₁ : F.B i₁ → CofixA F 0
h₁ : x 1 = CofixA.intro i₁ f₁
n : ℕ
n_ih :
  ∀ (f₀ : F.B i₀ → CofixA F n),
    x n.succ = CofixA.intro i₀ f₀ →
      (match n, CofixA.intro i₀ f₀ with
        | x, CofixA.intro i a => i) =
        match 0, CofixA.intro i₁ f₁ with
        | x, CofixA.intro i a => i
f₀ : F.B i₀ → CofixA F (n + 1)
h₀ : x (n + 1).succ = CofixA.intro i₀ f₀
⊢ (match n + 1, CofixA.intro i₀ f₀ with
    | x, CofixA.intro i a => i) =
    match 0, CofixA.intro i₁ f₁ with
    | x, CofixA.intro i a => i
state_after: case intro.intro.succ
F : PFunctor.{u}
X : Type w
f : X → ↑F X
x : (n : ℕ) → CofixA F n
Hconsistent : AllAgree x
i₀ i₁ : F.A
f₁ : F.B i₁ → CofixA F 0
h₁ : x 1 = CofixA.intro i₁ f₁
n : ℕ
n_ih :
  ∀ (f₀ : F.B i₀ → CofixA F n),
    x n.succ = CofixA.intro i₀ f₀ →
      (match n, CofixA.intro i₀ f₀ with
        | x, CofixA.intro i a => i) =
        match 0, CofixA.intro i₁ f₁ with
        | x, CofixA.intro i a => i
f₀ : F.B i₀ → CofixA F (n + 1)
h₀ : x (n + 1).succ = CofixA.intro i₀ f₀
H : Agree (x n.succ) (x n.succ.succ)
⊢ (match n + 1, CofixA.intro i₀ f₀ with
    | x, CofixA.intro i a => i) =
    match 0, CofixA.intro i₁ f₁ with
    | x, CofixA.intro i a => i

tactic: cases' h₂ : x (succ n) with _ i₂ f₂
state_before: case intro.intro.succ
F : PFunctor.{u}
X : Type w
f : X → ↑F X
x : (n : ℕ) → CofixA F n
Hconsistent : AllAgree x
i₀ i₁ : F.A
f₁ : F.B i₁ → CofixA F 0
h₁ : x 1 = CofixA.intro i₁ f₁
n : ℕ
n_ih :
  ∀ (f₀ : F.B i₀ → CofixA F n),
    x n.succ = CofixA.intro i₀ f₀ →
      (match n, CofixA.intro i₀ f₀ with
        | x, CofixA.intro i a => i) =
        match 0, CofixA.intro i₁ f₁ with
        | x, CofixA.intro i a => i
f₀ : F.B i₀ → CofixA F (n + 1)
h₀ : x (n + 1).succ = CofixA.intro i₀ f₀
H : Agree (x n.succ) (x n.succ.succ)
⊢ (match n + 1, CofixA.intro i₀ f₀ with
    | x, CofixA.intro i a => i) =
    match 0, CofixA.intro i₁ f₁ with
    | x, CofixA.intro i a => i
state_after: case intro.intro.succ.intro
F : PFunctor.{u}
X : Type w
f : X → ↑F X
x : (n : ℕ) → CofixA F n
Hconsistent : AllAgree x
i₀ i₁ : F.A
f₁ : F.B i₁ → CofixA F 0
h₁ : x 1 = CofixA.intro i₁ f₁
n : ℕ
n_ih :
  ∀ (f₀ : F.B i₀ → CofixA F n),
    x n.succ = CofixA.intro i₀ f₀ →
      (match n, CofixA.intro i₀ f₀ with
        | x, CofixA.intro i a => i) =
        match 0, CofixA.intro i₁ f₁ with
        | x, CofixA.intro i a => i
f₀ : F.B i₀ → CofixA F (n + 1)
h₀ : x (n + 1).succ = CofixA.intro i₀ f₀
H : Agree (x n.succ) (x n.succ.succ)
i₂ : F.A
f₂ : F.B i₂ → CofixA F n
h₂ : x n.succ = CofixA.intro i₂ f₂
⊢ (match n + 1, CofixA.intro i₀ f₀ with
    | x, CofixA.intro i a => i) =
    match 0, CofixA.intro i₁ f₁ with
    | x, CofixA.intro i a => i

tactic: rw [h₀, h₂] at H
state_before: case intro.intro.succ.intro
F : PFunctor.{u}
X : Type w
f : X → ↑F X
x : (n : ℕ) → CofixA F n
Hconsistent : AllAgree x
i₀ i₁ : F.A
f₁ : F.B i₁ → CofixA F 0
h₁ : x 1 = CofixA.intro i₁ f₁
n : ℕ
n_ih :
  ∀ (f₀ : F.B i₀ → CofixA F n),
    x n.succ = CofixA.intro i₀ f₀ →
      (match n, CofixA.intro i₀ f₀ with
        | x, CofixA.intro i a => i) =
        match 0, CofixA.intro i₁ f₁ with
        | x, CofixA.intro i a => i
f₀ : F.B i₀ → CofixA F (n + 1)
h₀ : x (n + 1).succ = CofixA.intro i₀ f₀
H : Agree (x n.succ) (x n.succ.succ)
i₂ : F.A
f₂ : F.B i₂ → CofixA F n
h₂ : x n.succ = CofixA.intro i₂ f₂
⊢ (match n + 1, CofixA.intro i₀ f₀ with
    | x, CofixA.intro i a => i) =
    match 0, CofixA.intro i₁ f₁ with
    | x, CofixA.intro i a => i
state_after: case intro.intro.succ.intro
F : PFunctor.{u}
X : Type w
f : X → ↑F X
x : (n : ℕ) → CofixA F n
Hconsistent : AllAgree x
i₀ i₁ : F.A
f₁ : F.B i₁ → CofixA F 0
h₁ : x 1 = CofixA.intro i₁ f₁
n : ℕ
n_ih :
  ∀ (f₀ : F.B i₀ → CofixA F n),
    x n.succ = CofixA.intro i₀ f₀ →
      (match n, CofixA.intro i₀ f₀ with
        | x, CofixA.intro i a => i) =
        match 0, CofixA.intro i₁ f₁ with
        | x, CofixA.intro i a => i
f₀ : F.B i₀ → CofixA F (n + 1)
h₀ : x (n + 1).succ = CofixA.intro i₀ f₀
i₂ : F.A
f₂ : F.B i₂ → CofixA F n
H : Agree (CofixA.intro i₂ f₂) (CofixA.intro i₀ f₀)
h₂ : x n.succ = CofixA.intro i₂ f₂
⊢ (match n + 1, CofixA.intro i₀ f₀ with
    | x, CofixA.intro i a => i) =
    match 0, CofixA.intro i₁ f₁ with
    | x, CofixA.intro i a => i

tactic: apply n_ih (truncate ∘ f₀)
state_before: case intro.intro.succ.intro
F : PFunctor.{u}
X : Type w
f : X → ↑F X
x : (n : ℕ) → CofixA F n
Hconsistent : AllAgree x
i₀ i₁ : F.A
f₁ : F.B i₁ → CofixA F 0
h₁ : x 1 = CofixA.intro i₁ f₁
n : ℕ
n_ih :
  ∀ (f₀ : F.B i₀ → CofixA F n),
    x n.succ = CofixA.intro i₀ f₀ →
      (match n, CofixA.intro i₀ f₀ with
        | x, CofixA.intro i a => i) =
        match 0, CofixA.intro i₁ f₁ with
        | x, CofixA.intro i a => i
f₀ : F.B i₀ → CofixA F (n + 1)
h₀ : x (n + 1).succ = CofixA.intro i₀ f₀
i₂ : F.A
f₂ : F.B i₂ → CofixA F n
H : Agree (CofixA.intro i₂ f₂) (CofixA.intro i₀ f₀)
h₂ : x n.succ = CofixA.intro i₂ f₂
⊢ (match n + 1, CofixA.intro i₀ f₀ with
    | x, CofixA.intro i a => i) =
    match 0, CofixA.intro i₁ f₁ with
    | x, CofixA.intro i a => i
state_after: case intro.intro.succ.intro
F : PFunctor.{u}
X : Type w
f : X → ↑F X
x : (n : ℕ) → CofixA F n
Hconsistent : AllAgree x
i₀ i₁ : F.A
f₁ : F.B i₁ → CofixA F 0
h₁ : x 1 = CofixA.intro i₁ f₁
n : ℕ
n_ih :
  ∀ (f₀ : F.B i₀ → CofixA F n),
    x n.succ = CofixA.intro i₀ f₀ →
      (match n, CofixA.intro i₀ f₀ with
        | x, CofixA.intro i a => i) =
        match 0, CofixA.intro i₁ f₁ with
        | x, CofixA.intro i a => i
f₀ : F.B i₀ → CofixA F (n + 1)
h₀ : x (n + 1).succ = CofixA.intro i₀ f₀
i₂ : F.A
f₂ : F.B i₂ → CofixA F n
H : Agree (CofixA.intro i₂ f₂) (CofixA.intro i₀ f₀)
h₂ : x n.succ = CofixA.intro i₂ f₂
⊢ x n.succ = CofixA.intro i₀ (truncate ∘ f₀)

tactic: rw [h₂]
state_before: case intro.intro.succ.intro
F : PFunctor.{u}
X : Type w
f : X → ↑F X
x : (n : ℕ) → CofixA F n
Hconsistent : AllAgree x
i₀ i₁ : F.A
f₁ : F.B i₁ → CofixA F 0
h₁ : x 1 = CofixA.intro i₁ f₁
n : ℕ
n_ih :
  ∀ (f₀ : F.B i₀ → CofixA F n),
    x n.succ = CofixA.intro i₀ f₀ →
      (match n, CofixA.intro i₀ f₀ with
        | x, CofixA.intro i a => i) =
        match 0, CofixA.intro i₁ f₁ with
        | x, CofixA.intro i a => i
f₀ : F.B i₀ → CofixA F (n + 1)
h₀ : x (n + 1).succ = CofixA.intro i₀ f₀
i₂ : F.A
f₂ : F.B i₂ → CofixA F n
H : Agree (CofixA.intro i₂ f₂) (CofixA.intro i₀ f₀)
h₂ : x n.succ = CofixA.intro i₂ f₂
⊢ x n.succ = CofixA.intro i₀ (truncate ∘ f₀)
state_after: case intro.intro.succ.intro
F : PFunctor.{u}
X : Type w
f : X → ↑F X
x : (n : ℕ) → CofixA F n
Hconsistent : AllAgree x
i₀ i₁ : F.A
f₁ : F.B i₁ → CofixA F 0
h₁ : x 1 = CofixA.intro i₁ f₁
n : ℕ
n_ih :
  ∀ (f₀ : F.B i₀ → CofixA F n),
    x n.succ = CofixA.intro i₀ f₀ →
      (match n, CofixA.intro i₀ f₀ with
        | x, CofixA.intro i a => i) =
        match 0, CofixA.intro i₁ f₁ with
        | x, CofixA.intro i a => i
f₀ : F.B i₀ → CofixA F (n + 1)
h₀ : x (n + 1).succ = CofixA.intro i₀ f₀
i₂ : F.A
f₂ : F.B i₂ → CofixA F n
H : Agree (CofixA.intro i₂ f₂) (CofixA.intro i₀ f₀)
h₂ : x n.succ = CofixA.intro i₂ f₂
⊢ CofixA.intro i₂ f₂ = CofixA.intro i₀ (truncate ∘ f₀)

tactic: cases' H with _ _ _ _ _ _ hagree
state_before: case intro.intro.succ.intro
F : PFunctor.{u}
X : Type w
f : X → ↑F X
x : (n : ℕ) → CofixA F n
Hconsistent : AllAgree x
i₀ i₁ : F.A
f₁ : F.B i₁ → CofixA F 0
h₁ : x 1 = CofixA.intro i₁ f₁
n : ℕ
n_ih :
  ∀ (f₀ : F.B i₀ → CofixA F n),
    x n.succ = CofixA.intro i₀ f₀ →
      (match n, CofixA.intro i₀ f₀ with
        | x, CofixA.intro i a => i) =
        match 0, CofixA.intro i₁ f₁ with
        | x, CofixA.intro i a => i
f₀ : F.B i₀ → CofixA F (n + 1)
h₀ : x (n + 1).succ = CofixA.intro i₀ f₀
i₂ : F.A
f₂ : F.B i₂ → CofixA F n
H : Agree (CofixA.intro i₂ f₂) (CofixA.intro i₀ f₀)
h₂ : x n.succ = CofixA.intro i₂ f₂
⊢ CofixA.intro i₂ f₂ = CofixA.intro i₀ (truncate ∘ f₀)
state_after: case intro.intro.succ.intro.intro
F : PFunctor.{u}
X : Type w
f : X → ↑F X
x : (n : ℕ) → CofixA F n
Hconsistent : AllAgree x
i₀ i₁ : F.A
f₁ : F.B i₁ → CofixA F 0
h₁ : x 1 = CofixA.intro i₁ f₁
n : ℕ
n_ih :
  ∀ (f₀ : F.B i₀ → CofixA F n),
    x n.succ = CofixA.intro i₀ f₀ →
      (match n, CofixA.intro i₀ f₀ with
        | x, CofixA.intro i a => i) =
        match 0, CofixA.intro i₁ f₁ with
        | x, CofixA.intro i a => i
f₀ : F.B i₀ → CofixA F (n + 1)
h₀ : x (n + 1).succ = CofixA.intro i₀ f₀
f₂ : F.B i₀ → CofixA F n
h₂ : x n.succ = CofixA.intro i₀ f₂
hagree : ∀ (i : F.B i₀), Agree (f₂ i) (f₀ i)
⊢ CofixA.intro i₀ f₂ = CofixA.intro i₀ (truncate ∘ f₀)

tactic: congr
state_before: case intro.intro.succ.intro.intro
F : PFunctor.{u}
X : Type w
f : X → ↑F X
x : (n : ℕ) → CofixA F n
Hconsistent : AllAgree x
i₀ i₁ : F.A
f₁ : F.B i₁ → CofixA F 0
h₁ : x 1 = CofixA.intro i₁ f₁
n : ℕ
n_ih :
  ∀ (f₀ : F.B i₀ → CofixA F n),
    x n.succ = CofixA.intro i₀ f₀ →
      (match n, CofixA.intro i₀ f₀ with
        | x, CofixA.intro i a => i) =
        match 0, CofixA.intro i₁ f₁ with
        | x, CofixA.intro i a => i
f₀ : F.B i₀ → CofixA F (n + 1)
h₀ : x (n + 1).succ = CofixA.intro i₀ f₀
f₂ : F.B i₀ → CofixA F n
h₂ : x n.succ = CofixA.intro i₀ f₂
hagree : ∀ (i : F.B i₀), Agree (f₂ i) (f₀ i)
⊢ CofixA.intro i₀ f₂ = CofixA.intro i₀ (truncate ∘ f₀)
state_after: case intro.intro.succ.intro.intro.e_a
F : PFunctor.{u}
X : Type w
f : X → ↑F X
x : (n : ℕ) → CofixA F n
Hconsistent : AllAgree x
i₀ i₁ : F.A
f₁ : F.B i₁ → CofixA F 0
h₁ : x 1 = CofixA.intro i₁ f₁
n : ℕ
n_ih :
  ∀ (f₀ : F.B i₀ → CofixA F n),
    x n.succ = CofixA.intro i₀ f₀ →
      (match n, CofixA.intro i₀ f₀ with
        | x, CofixA.intro i a => i) =
        match 0, CofixA.intro i₁ f₁ with
        | x, CofixA.intro i a => i
f₀ : F.B i₀ → CofixA F (n + 1)
h₀ : x (n + 1).succ = CofixA.intro i₀ f₀
f₂ : F.B i₀ → CofixA F n
h₂ : x n.succ = CofixA.intro i₀ f₂
hagree : ∀ (i : F.B i₀), Agree (f₂ i) (f₀ i)
⊢ f₂ = truncate ∘ f₀

tactic: funext j
state_before: case intro.intro.succ.intro.intro.e_a
F : PFunctor.{u}
X : Type w
f : X → ↑F X
x : (n : ℕ) → CofixA F n
Hconsistent : AllAgree x
i₀ i₁ : F.A
f₁ : F.B i₁ → CofixA F 0
h₁ : x 1 = CofixA.intro i₁ f₁
n : ℕ
n_ih :
  ∀ (f₀ : F.B i₀ → CofixA F n),
    x n.succ = CofixA.intro i₀ f₀ →
      (match n, CofixA.intro i₀ f₀ with
        | x, CofixA.intro i a => i) =
        match 0, CofixA.intro i₁ f₁ with
        | x, CofixA.intro i a => i
f₀ : F.B i₀ → CofixA F (n + 1)
h₀ : x (n + 1).succ = CofixA.intro i₀ f₀
f₂ : F.B i₀ → CofixA F n
h₂ : x n.succ = CofixA.intro i₀ f₂
hagree : ∀ (i : F.B i₀), Agree (f₂ i) (f₀ i)
⊢ f₂ = truncate ∘ f₀
state_after: case intro.intro.succ.intro.intro.e_a.h
F : PFunctor.{u}
X : Type w
f : X → ↑F X
x : (n : ℕ) → CofixA F n
Hconsistent : AllAgree x
i₀ i₁ : F.A
f₁ : F.B i₁ → CofixA F 0
h₁ : x 1 = CofixA.intro i₁ f₁
n : ℕ
n_ih :
  ∀ (f₀ : F.B i₀ → CofixA F n),
    x n.succ = CofixA.intro i₀ f₀ →
      (match n, CofixA.intro i₀ f₀ with
        | x, CofixA.intro i a => i) =
        match 0, CofixA.intro i₁ f₁ with
        | x, CofixA.intro i a => i
f₀ : F.B i₀ → CofixA F (n + 1)
h₀ : x (n + 1).succ = CofixA.intro i₀ f₀
f₂ : F.B i₀ → CofixA F n
h₂ : x n.succ = CofixA.intro i₀ f₂
hagree : ∀ (i : F.B i₀), Agree (f₂ i) (f₀ i)
j : F.B i₀
⊢ f₂ j = (truncate ∘ f₀) j

tactic: dsimp only [comp_apply]
state_before: case intro.intro.succ.intro.intro.e_a.h
F : PFunctor.{u}
X : Type w
f : X → ↑F X
x : (n : ℕ) → CofixA F n
Hconsistent : AllAgree x
i₀ i₁ : F.A
f₁ : F.B i₁ → CofixA F 0
h₁ : x 1 = CofixA.intro i₁ f₁
n : ℕ
n_ih :
  ∀ (f₀ : F.B i₀ → CofixA F n),
    x n.succ = CofixA.intro i₀ f₀ →
      (match n, CofixA.intro i₀ f₀ with
        | x, CofixA.intro i a => i) =
        match 0, CofixA.intro i₁ f₁ with
        | x, CofixA.intro i a => i
f₀ : F.B i₀ → CofixA F (n + 1)
h₀ : x (n + 1).succ = CofixA.intro i₀ f₀
f₂ : F.B i₀ → CofixA F n
h₂ : x n.succ = CofixA.intro i₀ f₂
hagree : ∀ (i : F.B i₀), Agree (f₂ i) (f₀ i)
j : F.B i₀
⊢ f₂ j = (truncate ∘ f₀) j
state_after: case intro.intro.succ.intro.intro.e_a.h
F : PFunctor.{u}
X : Type w
f : X → ↑F X
x : (n : ℕ) → CofixA F n
Hconsistent : AllAgree x
i₀ i₁ : F.A
f₁ : F.B i₁ → CofixA F 0
h₁ : x 1 = CofixA.intro i₁ f₁
n : ℕ
n_ih :
  ∀ (f₀ : F.B i₀ → CofixA F n),
    x n.succ = CofixA.intro i₀ f₀ →
      (match n, CofixA.intro i₀ f₀ with
        | x, CofixA.intro i a => i) =
        match 0, CofixA.intro i₁ f₁ with
        | x, CofixA.intro i a => i
f₀ : F.B i₀ → CofixA F (n + 1)
h₀ : x (n + 1).succ = CofixA.intro i₀ f₀
f₂ : F.B i₀ → CofixA F n
h₂ : x n.succ = CofixA.intro i₀ f₂
hagree : ∀ (i : F.B i₀), Agree (f₂ i) (f₀ i)
j : F.B i₀
⊢ f₂ j = truncate (f₀ j)

tactic: rw [truncate_eq_of_agree]
state_before: case intro.intro.succ.intro.intro.e_a.h
F : PFunctor.{u}
X : Type w
f : X → ↑F X
x : (n : ℕ) → CofixA F n
Hconsistent : AllAgree x
i₀ i₁ : F.A
f₁ : F.B i₁ → CofixA F 0
h₁ : x 1 = CofixA.intro i₁ f₁
n : ℕ
n_ih :
  ∀ (f₀ : F.B i₀ → CofixA F n),
    x n.succ = CofixA.intro i₀ f₀ →
      (match n, CofixA.intro i₀ f₀ with
        | x, CofixA.intro i a => i) =
        match 0, CofixA.intro i₁ f₁ with
        | x, CofixA.intro i a => i
f₀ : F.B i₀ → CofixA F (n + 1)
h₀ : x (n + 1).succ = CofixA.intro i₀ f₀
f₂ : F.B i₀ → CofixA F n
h₂ : x n.succ = CofixA.intro i₀ f₂
hagree : ∀ (i : F.B i₀), Agree (f₂ i) (f₀ i)
j : F.B i₀
⊢ f₂ j = truncate (f₀ j)
state_after: case intro.intro.succ.intro.intro.e_a.h.h
F : PFunctor.{u}
X : Type w
f : X → ↑F X
x : (n : ℕ) → CofixA F n
Hconsistent : AllAgree x
i₀ i₁ : F.A
f₁ : F.B i₁ → CofixA F 0
h₁ : x 1 = CofixA.intro i₁ f₁
n : ℕ
n_ih :
  ∀ (f₀ : F.B i₀ → CofixA F n),
    x n.succ = CofixA.intro i₀ f₀ →
      (match n, CofixA.intro i₀ f₀ with
        | x, CofixA.intro i a => i) =
        match 0, CofixA.intro i₁ f₁ with
        | x, CofixA.intro i a => i
f₀ : F.B i₀ → CofixA F (n + 1)
h₀ : x (n + 1).succ = CofixA.intro i₀ f₀
f₂ : F.B i₀ → CofixA F n
h₂ : x n.succ = CofixA.intro i₀ f₂
hagree : ∀ (i : F.B i₀), Agree (f₂ i) (f₀ i)
j : F.B i₀
⊢ Agree (f₂ j) (f₀ j)

tactic: apply hagree
state_before: case intro.intro.succ.intro.intro.e_a.h.h
F : PFunctor.{u}
X : Type w
f : X → ↑F X
x : (n : ℕ) → CofixA F n
Hconsistent : AllAgree x
i₀ i₁ : F.A
f₁ : F.B i₁ → CofixA F 0
h₁ : x 1 = CofixA.intro i₁ f₁
n : ℕ
n_ih :
  ∀ (f₀ : F.B i₀ → CofixA F n),
    x n.succ = CofixA.intro i₀ f₀ →
      (match n, CofixA.intro i₀ f₀ with
        | x, CofixA.intro i a => i) =
        match 0, CofixA.intro i₁ f₁ with
        | x, CofixA.intro i a => i
f₀ : F.B i₀ → CofixA F (n + 1)
h₀ : x (n + 1).succ = CofixA.intro i₀ f₀
f₂ : F.B i₀ → CofixA F n
h₂ : x n.succ = CofixA.intro i₀ f₂
hagree : ∀ (i : F.B i₀), Agree (f₂ i) (f₀ i)
j : F.B i₀
⊢ Agree (f₂ j) (f₀ j)
state_after: no goals