Theorem: Algebra.FormallySmooth.iff_split_surjection
File: Mathlib/RingTheory/Smooth/Basic.lean

tactic: constructor
state_before: R S : Type u
inst✝⁶ : CommRing R
inst✝⁵ : CommSemiring S
P A : Type u
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing P
inst✝¹ : Algebra R P
I : Ideal P
f : P →ₐ[R] A
hf : Function.Surjective ⇑f
inst✝ : FormallySmooth R P
⊢ FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A
state_after: case mp
R S : Type u
inst✝⁶ : CommRing R
inst✝⁵ : CommSemiring S
P A : Type u
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing P
inst✝¹ : Algebra R P
I : Ideal P
f : P →ₐ[R] A
hf : Function.Surjective ⇑f
inst✝ : FormallySmooth R P
⊢ FormallySmooth R A → ∃ g, f.kerSquareLift.comp g = AlgHom.id R A

case mpr
R S : Type u
inst✝⁶ : CommRing R
inst✝⁵ : CommSemiring S
P A : Type u
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing P
inst✝¹ : Algebra R P
I : Ideal P
f : P →ₐ[R] A
hf : Function.Surjective ⇑f
inst✝ : FormallySmooth R P
⊢ (∃ g, f.kerSquareLift.comp g = AlgHom.id R A) → FormallySmooth R A

tactic: intro
state_before: case mp
R S : Type u
inst✝⁶ : CommRing R
inst✝⁵ : CommSemiring S
P A : Type u
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing P
inst✝¹ : Algebra R P
I : Ideal P
f : P →ₐ[R] A
hf : Function.Surjective ⇑f
inst✝ : FormallySmooth R P
⊢ FormallySmooth R A → ∃ g, f.kerSquareLift.comp g = AlgHom.id R A
state_after: case mp
R S : Type u
inst✝⁶ : CommRing R
inst✝⁵ : CommSemiring S
P A : Type u
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing P
inst✝¹ : Algebra R P
I : Ideal P
f : P →ₐ[R] A
hf : Function.Surjective ⇑f
inst✝ : FormallySmooth R P
a✝ : FormallySmooth R A
⊢ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A

tactic: have surj : Function.Surjective f.kerSquareLift := fun x =>
  ⟨Submodule.Quotient.mk (hf x).choose, (hf x).choose_spec⟩
state_before: case mp
R S : Type u
inst✝⁶ : CommRing R
inst✝⁵ : CommSemiring S
P A : Type u
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing P
inst✝¹ : Algebra R P
I : Ideal P
f : P →ₐ[R] A
hf : Function.Surjective ⇑f
inst✝ : FormallySmooth R P
a✝ : FormallySmooth R A
⊢ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A
state_after: case mp
R S : Type u
inst✝⁶ : CommRing R
inst✝⁵ : CommSemiring S
P A : Type u
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing P
inst✝¹ : Algebra R P
I : Ideal P
f : P →ₐ[R] A
hf : Function.Surjective ⇑f
inst✝ : FormallySmooth R P
a✝ : FormallySmooth R A
surj : Function.Surjective ⇑f.kerSquareLift
⊢ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A

tactic: have sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0 := by
  rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot]
state_before: case mp
R S : Type u
inst✝⁶ : CommRing R
inst✝⁵ : CommSemiring S
P A : Type u
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing P
inst✝¹ : Algebra R P
I : Ideal P
f : P →ₐ[R] A
hf : Function.Surjective ⇑f
inst✝ : FormallySmooth R P
a✝ : FormallySmooth R A
surj : Function.Surjective ⇑f.kerSquareLift
⊢ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A
state_after: case mp
R S : Type u
inst✝⁶ : CommRing R
inst✝⁵ : CommSemiring S
P A : Type u
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing P
inst✝¹ : Algebra R P
I : Ideal P
f : P →ₐ[R] A
hf : Function.Surjective ⇑f
inst✝ : FormallySmooth R P
a✝ : FormallySmooth R A
surj : Function.Surjective ⇑f.kerSquareLift
sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0
⊢ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A

tactic: refine
  ⟨FormallySmooth.lift _ ⟨2, sqz⟩ (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom,
    ?_⟩
state_before: case mp
R S : Type u
inst✝⁶ : CommRing R
inst✝⁵ : CommSemiring S
P A : Type u
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing P
inst✝¹ : Algebra R P
I : Ideal P
f : P →ₐ[R] A
hf : Function.Surjective ⇑f
inst✝ : FormallySmooth R P
a✝ : FormallySmooth R A
surj : Function.Surjective ⇑f.kerSquareLift
sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0
⊢ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A
state_after: case mp
R S : Type u
inst✝⁶ : CommRing R
inst✝⁵ : CommSemiring S
P A : Type u
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing P
inst✝¹ : Algebra R P
I : Ideal P
f : P →ₐ[R] A
hf : Function.Surjective ⇑f
inst✝ : FormallySmooth R P
a✝ : FormallySmooth R A
surj : Function.Surjective ⇑f.kerSquareLift
sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0
⊢ f.kerSquareLift.comp
      (lift (RingHom.ker f.kerSquareLift.toRingHom) ⋯ ↑(Ideal.quotientKerAlgEquivOfSurjective surj).symm) =
    AlgHom.id R A

tactic: ext x
state_before: case mp
R S : Type u
inst✝⁶ : CommRing R
inst✝⁵ : CommSemiring S
P A : Type u
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing P
inst✝¹ : Algebra R P
I : Ideal P
f : P →ₐ[R] A
hf : Function.Surjective ⇑f
inst✝ : FormallySmooth R P
a✝ : FormallySmooth R A
surj : Function.Surjective ⇑f.kerSquareLift
sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0
⊢ f.kerSquareLift.comp
      (lift (RingHom.ker f.kerSquareLift.toRingHom) ⋯ ↑(Ideal.quotientKerAlgEquivOfSurjective surj).symm) =
    AlgHom.id R A
state_after: case mp.H
R S : Type u
inst✝⁶ : CommRing R
inst✝⁵ : CommSemiring S
P A : Type u
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing P
inst✝¹ : Algebra R P
I : Ideal P
f : P →ₐ[R] A
hf : Function.Surjective ⇑f
inst✝ : FormallySmooth R P
a✝ : FormallySmooth R A
surj : Function.Surjective ⇑f.kerSquareLift
sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0
x : A
⊢ (f.kerSquareLift.comp
        (lift (RingHom.ker f.kerSquareLift.toRingHom) ⋯ ↑(Ideal.quotientKerAlgEquivOfSurjective surj).symm))
      x =
    (AlgHom.id R A) x

tactic: have :=
  (Ideal.quotientKerAlgEquivOfSurjective surj).toAlgHom.congr_arg
    (FormallySmooth.mk_lift _ ⟨2, sqz⟩
      (Ideal.quotientKerAlgEquivOfSurjective surj).symm.toAlgHom x)
state_before: case mp.H
R S : Type u
inst✝⁶ : CommRing R
inst✝⁵ : CommSemiring S
P A : Type u
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing P
inst✝¹ : Algebra R P
I : Ideal P
f : P →ₐ[R] A
hf : Function.Surjective ⇑f
inst✝ : FormallySmooth R P
a✝ : FormallySmooth R A
surj : Function.Surjective ⇑f.kerSquareLift
sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0
x : A
⊢ (f.kerSquareLift.comp
        (lift (RingHom.ker f.kerSquareLift.toRingHom) ⋯ ↑(Ideal.quotientKerAlgEquivOfSurjective surj).symm))
      x =
    (AlgHom.id R A) x
state_after: case mp.H
R S : Type u
inst✝⁶ : CommRing R
inst✝⁵ : CommSemiring S
P A : Type u
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing P
inst✝¹ : Algebra R P
I : Ideal P
f : P →ₐ[R] A
hf : Function.Surjective ⇑f
inst✝ : FormallySmooth R P
a✝ : FormallySmooth R A
surj : Function.Surjective ⇑f.kerSquareLift
sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0
x : A
this :
  ↑(Ideal.quotientKerAlgEquivOfSurjective surj)
      ((Ideal.Quotient.mk (RingHom.ker f.kerSquareLift.toRingHom))
        ((lift (RingHom.ker f.kerSquareLift.toRingHom) ⋯ ↑(Ideal.quotientKerAlgEquivOfSurjective surj).symm) x)) =
    ↑(Ideal.quotientKerAlgEquivOfSurjective surj) (↑(Ideal.quotientKerAlgEquivOfSurjective surj).symm x)
⊢ (f.kerSquareLift.comp
        (lift (RingHom.ker f.kerSquareLift.toRingHom) ⋯ ↑(Ideal.quotientKerAlgEquivOfSurjective surj).symm))
      x =
    (AlgHom.id R A) x

tactic: erw [AlgEquiv.apply_symm_apply] at this
state_before: case mp.H
R S : Type u
inst✝⁶ : CommRing R
inst✝⁵ : CommSemiring S
P A : Type u
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing P
inst✝¹ : Algebra R P
I : Ideal P
f : P →ₐ[R] A
hf : Function.Surjective ⇑f
inst✝ : FormallySmooth R P
a✝ : FormallySmooth R A
surj : Function.Surjective ⇑f.kerSquareLift
sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0
x : A
this :
  ↑(Ideal.quotientKerAlgEquivOfSurjective surj)
      ((Ideal.Quotient.mk (RingHom.ker f.kerSquareLift.toRingHom))
        ((lift (RingHom.ker f.kerSquareLift.toRingHom) ⋯ ↑(Ideal.quotientKerAlgEquivOfSurjective surj).symm) x)) =
    ↑(Ideal.quotientKerAlgEquivOfSurjective surj) (↑(Ideal.quotientKerAlgEquivOfSurjective surj).symm x)
⊢ (f.kerSquareLift.comp
        (lift (RingHom.ker f.kerSquareLift.toRingHom) ⋯ ↑(Ideal.quotientKerAlgEquivOfSurjective surj).symm))
      x =
    (AlgHom.id R A) x
state_after: case mp.H
R S : Type u
inst✝⁶ : CommRing R
inst✝⁵ : CommSemiring S
P A : Type u
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing P
inst✝¹ : Algebra R P
I : Ideal P
f : P →ₐ[R] A
hf : Function.Surjective ⇑f
inst✝ : FormallySmooth R P
a✝ : FormallySmooth R A
surj : Function.Surjective ⇑f.kerSquareLift
sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0
x : A
this :
  ↑(Ideal.quotientKerAlgEquivOfSurjective surj)
      ((Ideal.Quotient.mk (RingHom.ker f.kerSquareLift.toRingHom))
        ((lift (RingHom.ker f.kerSquareLift.toRingHom) ⋯ ↑(Ideal.quotientKerAlgEquivOfSurjective surj).symm) x)) =
    x
⊢ (f.kerSquareLift.comp
        (lift (RingHom.ker f.kerSquareLift.toRingHom) ⋯ ↑(Ideal.quotientKerAlgEquivOfSurjective surj).symm))
      x =
    (AlgHom.id R A) x

tactic: conv_rhs => rw [← this, AlgHom.id_apply]
state_before: case mp.H
R S : Type u
inst✝⁶ : CommRing R
inst✝⁵ : CommSemiring S
P A : Type u
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing P
inst✝¹ : Algebra R P
I : Ideal P
f : P →ₐ[R] A
hf : Function.Surjective ⇑f
inst✝ : FormallySmooth R P
a✝ : FormallySmooth R A
surj : Function.Surjective ⇑f.kerSquareLift
sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0
x : A
this :
  ↑(Ideal.quotientKerAlgEquivOfSurjective surj)
      ((Ideal.Quotient.mk (RingHom.ker f.kerSquareLift.toRingHom))
        ((lift (RingHom.ker f.kerSquareLift.toRingHom) ⋯ ↑(Ideal.quotientKerAlgEquivOfSurjective surj).symm) x)) =
    x
⊢ (f.kerSquareLift.comp
        (lift (RingHom.ker f.kerSquareLift.toRingHom) ⋯ ↑(Ideal.quotientKerAlgEquivOfSurjective surj).symm))
      x =
    (AlgHom.id R A) x
state_after: case mp.H
R S : Type u
inst✝⁶ : CommRing R
inst✝⁵ : CommSemiring S
P A : Type u
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing P
inst✝¹ : Algebra R P
I : Ideal P
f : P →ₐ[R] A
hf : Function.Surjective ⇑f
inst✝ : FormallySmooth R P
a✝ : FormallySmooth R A
surj : Function.Surjective ⇑f.kerSquareLift
sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0
x : A
this :
  ↑(Ideal.quotientKerAlgEquivOfSurjective surj)
      ((Ideal.Quotient.mk (RingHom.ker f.kerSquareLift.toRingHom))
        ((lift (RingHom.ker f.kerSquareLift.toRingHom) ⋯ ↑(Ideal.quotientKerAlgEquivOfSurjective surj).symm) x)) =
    x
⊢ (f.kerSquareLift.comp
        (lift (RingHom.ker f.kerSquareLift.toRingHom) ⋯ ↑(Ideal.quotientKerAlgEquivOfSurjective surj).symm))
      x =
    ↑(Ideal.quotientKerAlgEquivOfSurjective surj)
      ((Ideal.Quotient.mk (RingHom.ker f.kerSquareLift.toRingHom))
        ((lift (RingHom.ker f.kerSquareLift.toRingHom) ⋯ ↑(Ideal.quotientKerAlgEquivOfSurjective surj).symm) x))

tactic: rfl
state_before: case mp.H
R S : Type u
inst✝⁶ : CommRing R
inst✝⁵ : CommSemiring S
P A : Type u
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing P
inst✝¹ : Algebra R P
I : Ideal P
f : P →ₐ[R] A
hf : Function.Surjective ⇑f
inst✝ : FormallySmooth R P
a✝ : FormallySmooth R A
surj : Function.Surjective ⇑f.kerSquareLift
sqz : RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0
x : A
this :
  ↑(Ideal.quotientKerAlgEquivOfSurjective surj)
      ((Ideal.Quotient.mk (RingHom.ker f.kerSquareLift.toRingHom))
        ((lift (RingHom.ker f.kerSquareLift.toRingHom) ⋯ ↑(Ideal.quotientKerAlgEquivOfSurjective surj).symm) x)) =
    x
⊢ (f.kerSquareLift.comp
        (lift (RingHom.ker f.kerSquareLift.toRingHom) ⋯ ↑(Ideal.quotientKerAlgEquivOfSurjective surj).symm))
      x =
    ↑(Ideal.quotientKerAlgEquivOfSurjective surj)
      ((Ideal.Quotient.mk (RingHom.ker f.kerSquareLift.toRingHom))
        ((lift (RingHom.ker f.kerSquareLift.toRingHom) ⋯ ↑(Ideal.quotientKerAlgEquivOfSurjective surj).symm) x))
state_after: no goals

tactic: rw [AlgHom.ker_kerSquareLift, Ideal.cotangentIdeal_square, Ideal.zero_eq_bot]
state_before: R S : Type u
inst✝⁶ : CommRing R
inst✝⁵ : CommSemiring S
P A : Type u
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing P
inst✝¹ : Algebra R P
I : Ideal P
f : P →ₐ[R] A
hf : Function.Surjective ⇑f
inst✝ : FormallySmooth R P
a✝ : FormallySmooth R A
surj : Function.Surjective ⇑f.kerSquareLift
⊢ RingHom.ker f.kerSquareLift.toRingHom ^ 2 = 0
state_after: no goals

tactic: rintro ⟨g, hg⟩
state_before: case mpr
R S : Type u
inst✝⁶ : CommRing R
inst✝⁵ : CommSemiring S
P A : Type u
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing P
inst✝¹ : Algebra R P
I : Ideal P
f : P →ₐ[R] A
hf : Function.Surjective ⇑f
inst✝ : FormallySmooth R P
⊢ (∃ g, f.kerSquareLift.comp g = AlgHom.id R A) → FormallySmooth R A
state_after: case mpr.intro
R S : Type u
inst✝⁶ : CommRing R
inst✝⁵ : CommSemiring S
P A : Type u
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing P
inst✝¹ : Algebra R P
I : Ideal P
f : P →ₐ[R] A
hf : Function.Surjective ⇑f
inst✝ : FormallySmooth R P
g : A →ₐ[R] P ⧸ RingHom.ker f.toRingHom ^ 2
hg : f.kerSquareLift.comp g = AlgHom.id R A
⊢ FormallySmooth R A

tactic: exact FormallySmooth.of_split f g hg
state_before: case mpr.intro
R S : Type u
inst✝⁶ : CommRing R
inst✝⁵ : CommSemiring S
P A : Type u
inst✝⁴ : CommRing A
inst✝³ : Algebra R A
inst✝² : CommRing P
inst✝¹ : Algebra R P
I : Ideal P
f : P →ₐ[R] A
hf : Function.Surjective ⇑f
inst✝ : FormallySmooth R P
g : A →ₐ[R] P ⧸ RingHom.ker f.toRingHom ^ 2
hg : f.kerSquareLift.comp g = AlgHom.id R A
⊢ FormallySmooth R A
state_after: no goals