Theorem: PFunctor.M.cases_mk
File: Mathlib/Data/PFunctor/Univariate/M.lean

tactic: dsimp only [M.mk, PFunctor.M.cases, dest, head, Approx.sMk, head']
state_before: F : PFunctor
X : Type ?u.18893
f✝ : X → Obj F X
r : M F → Sort u_1
x : Obj F (M F)
f : (x : Obj F (M F)) → r (M.mk x)
⊢ M.cases f (M.mk x) = f x

tactic: cases x
state_before: F : PFunctor
X : Type ?u.18893
f✝ : X → Obj F X
r : M F → Sort u_1
x : Obj F (M F)
f : (x : Obj F (M F)) → r (M.mk x)
⊢ Eq.mpr
      (_ :
        r
            {
              approx := fun x_1 =>
                match x_1 with
                | 0 => CofixA.continue
                | succ n => CofixA.intro x.fst fun i => MIntl.approx (Sigma.snd x i) n,
              consistent := (_ : AllAgree (Approx.sMk x)) } =
          r
            {
              approx := fun x_1 =>
                match x_1 with
                | 0 => CofixA.continue
                | succ n =>
                  CofixA.intro x.fst fun i =>
                    MIntl.approx
                      (children
                        {
                          approx := fun x_2 =>
                            match x_2 with
                            | 0 => CofixA.continue
                            | succ n => CofixA.intro x.fst fun i => MIntl.approx (Sigma.snd x i) n,
                          consistent := (_ : AllAgree (Approx.sMk x)) }
                        i)
                      n,
              consistent :=
                (_ :
                  AllAgree
                    (Approx.sMk
                      { fst := x.fst,
                        snd := fun i =>
                          children
                            {
                              approx := fun x_1 =>
                                match x_1 with
                                | 0 => CofixA.continue
                                | succ n => CofixA.intro x.fst fun i => MIntl.approx (Sigma.snd x i) n,
                              consistent := (_ : AllAgree (Approx.sMk x)) }
                            i })) })
      (f
        { fst := x.fst,
          snd := fun i =>
            children
              {
                approx := fun x_1 =>
                  match x_1 with
                  | 0 => CofixA.continue
                  | succ n => CofixA.intro x.fst fun i => MIntl.approx (Sigma.snd x i) n,
                consistent := (_ : AllAgree (Approx.sMk x)) }
              i }) =
    f x

tactic: dsimp only [Approx.sMk]
state_before: case mk
F : PFunctor
X : Type ?u.18893
f✝ : X → Obj F X
r : M F → Sort u_1
f : (x : Obj F (M F)) → r (M.mk x)
fst✝ : F.A
snd✝ : B F fst✝ → M F
⊢ Eq.mpr
      (_ :
        r
            {
              approx := fun x =>
                match x with
                | 0 => CofixA.continue
                | succ n =>
                  CofixA.intro { fst := fst✝, snd := snd✝ }.fst fun i =>
                    MIntl.approx (Sigma.snd { fst := fst✝, snd := snd✝ } i) n,
              consistent := (_ : AllAgree (Approx.sMk { fst := fst✝, snd := snd✝ })) } =
          r
            {
              approx := fun x =>
                match x with
                | 0 => CofixA.continue
                | succ n =>
                  CofixA.intro { fst := fst✝, snd := snd✝ }.fst fun i =>
                    MIntl.approx
                      (children
                        {
                          approx := fun x =>
                            match x with
                            | 0 => CofixA.continue
                            | succ n =>
                              CofixA.intro { fst := fst✝, snd := snd✝ }.fst fun i =>
                                MIntl.approx (Sigma.snd { fst := fst✝, snd := snd✝ } i) n,
                          consistent := (_ : AllAgree (Approx.sMk { fst := fst✝, snd := snd✝ })) }
                        i)
                      n,
              consistent :=
                (_ :
                  AllAgree
                    (Approx.sMk
                      { fst := { fst := fst✝, snd := snd✝ }.fst,
                        snd := fun i =>
                          children
                            {
                              approx := fun x =>
                                match x with
                                | 0 => CofixA.continue
                                | succ n =>
                                  CofixA.intro { fst := fst✝, snd := snd✝ }.fst fun i =>
                                    MIntl.approx (Sigma.snd { fst := fst✝, snd := snd✝ } i) n,
                              consistent := (_ : AllAgree (Approx.sMk { fst := fst✝, snd := snd✝ })) }
                            i })) })
      (f
        { fst := { fst := fst✝, snd := snd✝ }.fst,
          snd := fun i =>
            children
              {
                approx := fun x =>
                  match x with
                  | 0 => CofixA.continue
                  | succ n =>
                    CofixA.intro { fst := fst✝, snd := snd✝ }.fst fun i =>
                      MIntl.approx (Sigma.snd { fst := fst✝, snd := snd✝ } i) n,
                consistent := (_ : AllAgree (Approx.sMk { fst := fst✝, snd := snd✝ })) }
              i }) =
    f { fst := fst✝, snd := snd✝ }

tactic: simp only [Eq.mpr]
state_before: case mk
F : PFunctor
X : Type ?u.18893
f✝ : X → Obj F X
r : M F → Sort u_1
f : (x : Obj F (M F)) → r (M.mk x)
fst✝ : F.A
snd✝ : B F fst✝ → M F
⊢ Eq.mpr
      (_ :
        r
            {
              approx := fun x =>
                match x with
                | 0 => CofixA.continue
                | succ n => CofixA.intro fst✝ fun i => MIntl.approx (snd✝ i) n,
              consistent := (_ : AllAgree (Approx.sMk { fst := fst✝, snd := snd✝ })) } =
          r
            {
              approx := fun x =>
                match x with
                | 0 => CofixA.continue
                | succ n =>
                  CofixA.intro fst✝ fun i =>
                    MIntl.approx
                      (children
                        {
                          approx := fun x =>
                            match x with
                            | 0 => CofixA.continue
                            | succ n => CofixA.intro fst✝ fun i => MIntl.approx (snd✝ i) n,
                          consistent := (_ : AllAgree (Approx.sMk { fst := fst✝, snd := snd✝ })) }
                        i)
                      n,
              consistent :=
                (_ :
                  AllAgree
                    (Approx.sMk
                      { fst := fst✝,
                        snd := fun i =>
                          children
                            {
                              approx := fun x =>
                                match x with
                                | 0 => CofixA.continue
                                | succ n => CofixA.intro fst✝ fun i => MIntl.approx (snd✝ i) n,
                              consistent := (_ : AllAgree (Approx.sMk { fst := fst✝, snd := snd✝ })) }
                            i })) })
      (f
        { fst := fst✝,
          snd := fun i =>
            children
              {
                approx := fun x =>
                  match x with
                  | 0 => CofixA.continue
                  | succ n => CofixA.intro fst✝ fun i => MIntl.approx (snd✝ i) n,
                consistent := (_ : AllAgree (Approx.sMk { fst := fst✝, snd := snd✝ })) }
              i }) =
    f { fst := fst✝, snd := snd✝ }

tactic: apply congrFun
state_before: case mk
F : PFunctor
X : Type ?u.18893
f✝ : X → Obj F X
r : M F → Sort u_1
f : (x : Obj F (M F)) → r (M.mk x)
fst✝ : F.A
snd✝ : B F fst✝ → M F
⊢ f
      { fst := fst✝,
        snd := fun i =>
          children
            {
              approx := fun x =>
                match x with
                | 0 => CofixA.continue
                | succ n => CofixA.intro fst✝ fun i => MIntl.approx (snd✝ i) n,
              consistent := (_ : AllAgree (Approx.sMk { fst := fst✝, snd := snd✝ })) }
            i } =
    f { fst := fst✝, snd := snd✝ }

tactic: rfl
state_before: case mk.h
F : PFunctor
X : Type ?u.18893
f✝ : X → Obj F X
r : M F → Sort u_1
f : (x : Obj F (M F)) → r (M.mk x)
fst✝ : F.A
snd✝ : B F fst✝ → M F
⊢ f = f