/-- If `B / S / R` is a tower of ring extensions where `S` is integral over `R`,
then `S` maps (uniquely) into an integral closure `B / A / R`. -/
noncomputable def lift : S →ₐ[R] A where
  toFun x := mk' A (algebraMap S B x) (IsIntegral.algebraMap (h x))
  map_one' := by simp only [RingHom.map_one, mk'_one]
  map_zero' := by simp only [RingHom.map_zero, mk'_zero]
  map_add' x y := by 

Proof state:
R : Type u_1
A : Type u_2
B : Type u_3
inst✝¹¹ : CommRing R
inst✝¹⁰ : CommRing A
inst✝⁹ : CommRing B
inst✝⁸ : Algebra R B
inst✝⁷ : Algebra A B
inst✝⁶ : IsIntegralClosure A R B
S : Type u_4
inst✝⁵ : CommRing S
inst✝⁴ : Algebra R S
inst✝³ : Algebra S B
inst✝² : IsScalarTower R S B
inst✝¹ : Algebra R A
inst✝ : IsScalarTower R A B
h : Algebra.IsIntegral R S
x y : S
⊢ OneHom.toFun
      (↑{
          toOneHom :=
            { toFun := fun x => mk' A ((algebraMap S B) x) (_ : IsIntegral R ((algebraMap S B) x)),
              map_one' := (_ : mk' A ((algebraMap S B) 1) (_ : IsIntegral R ((algebraMap S B) 1)) = 1) },
          map_mul' :=
            (_ :
              ∀ (x y : S),
                OneHom.toFun
                    { toFun := fun x => mk' A ((algebraMap S B) x) (_ : IsIntegral R ((algebraMap S B) x)),
                      map_one' := (_ : mk' A ((algebraMap S B) 1) (_ : IsIntegral R ((algebraMap S B) 1)) = 1) }
                    (x * y) =
                  OneHom.toFun
                      { toFun := fun x => mk' A ((algebraMap S B) x) (_ : IsIntegral R ((algebraMap S B) x)),
                        map_one' := (_ : mk' A ((algebraMap S B) 1) (_ : IsIntegral R ((algebraMap S B) 1)) = 1) }
                      x *
                    OneHom.toFun
                      { toFun := fun x => mk' A ((algebraMap S B) x) (_ : IsIntegral R ((algebraMap S B) x)),
                        map_one' := (_ : mk' A ((algebraMap S B) 1) (_ : IsIntegral R ((algebraMap S B) 1)) = 1) }
                      y) })
      (x + y) =
    OneHom.toFun
        (↑{
            toOneHom :=
              { toFun := fun x => mk' A ((algebraMap S B) x) (_ : IsIntegral R ((algebraMap S B) x)),
                map_one' := (_ : mk' A ((algebraMap S B) 1) (_ : IsIntegral R ((algebraMap S B) 1)) = 1) },
            map_mul' :=
              (_ :
                ∀ (x y : S),
                  OneHom.toFun
                      { toFun := fun x => mk' A ((algebraMap S B) x) (_ : IsIntegral R ((algebraMap S B) x)),
                        map_one' := (_ : mk' A ((algebraMap S B) 1) (_ : IsIntegral R ((algebraMap S B) 1)) = 1) }
                      (x * y) =
                    OneHom.toFun
                        { toFun := fun x => mk' A ((algebraMap S B) x) (_ : IsIntegral R ((algebraMap S B) x)),
                          map_one' := (_ : mk' A ((algebraMap S B) 1) (_ : IsIntegral R ((algebraMap S B) 1)) = 1) }
                        x *
                      OneHom.toFun
                        { toFun := fun x => mk' A ((algebraMap S B) x) (_ : IsIntegral R ((algebraMap S B) x)),
                          map_one' := (_ : mk' A ((algebraMap S B) 1) (_ : IsIntegral R ((algebraMap S B) 1)) = 1) }
                        y) })
        x +
      OneHom.toFun
        (↑{
            toOneHom :=
              { toFun := fun x => mk' A ((algebraMap S B) x) (_ : IsIntegral R ((algebraMap S B) x)),
                map_one' := (_ : mk' A ((algebraMap S B) 1) (_ : IsIntegral R ((algebraMap S B) 1)) = 1) },
            map_mul' :=
              (_ :
                ∀ (x y : S),
                  OneHom.toFun
                      { toFun := fun x => mk' A ((algebraMap S B) x) (_ : IsIntegral R ((algebraMap S B) x)),
                        map_one' := (_ : mk' A ((algebraMap S B) 1) (_ : IsIntegral R ((algebraMap S B) 1)) = 1) }
                      (x * y) =
                    OneHom.toFun
                        { toFun := fun x => mk' A ((algebraMap S B) x) (_ : IsIntegral R ((algebraMap S B) x)),
                          map_one' := (_ : mk' A ((algebraMap S B) 1) (_ : IsIntegral R ((algebraMap S B) 1)) = 1) }
                        x *
                      OneHom.toFun
                        { toFun := fun x => mk' A ((algebraMap S B) x) (_ : IsIntegral R ((algebraMap S B) x)),
                          map_one' := (_ : mk' A ((algebraMap S B) 1) (_ : IsIntegral R ((algebraMap S B) 1)) = 1) }
                        y) })
        y

Next tactic:
simp_rw [← mk'_add, RingHom.map_add]