l3lab/ntp-mathlib huggingface dataset:
instance ExtensionOf.inhabited : Inhabited (ExtensionOf i f) where
  default :=
    { domain := LinearMap.range i
      toFun :=
        { toFun := fun x => f x.2.choose
          map_add' := fun x y => by
            have eq1 : _ + _ = (x + y).1 := congr_arg₂ (· + ·) x.2.choose_spec y.2.choose_spec
            rw [← map_add, ← (x + y).2.choose_spec] at eq1
            dsimp
            rw [← Fact.out (p := Function.Injective i) eq1, map_add]
          map_smul' := fun r x => by
            have eq1 : r • _ = (r • x).1 := congr_arg (r • ·) x.2.choose_spec
            rw [← LinearMap.map_smul, ← (r • x).2.choose_spec] at eq1
            dsimp
            

Proof state:
R : Type u
inst✝⁷ : Ring R
Q : TypeMax
inst✝⁶ : AddCommGroup Q
inst✝⁵ : Module R Q
M N : Type (max u v)
inst✝⁴ : AddCommGroup M
inst✝³ : AddCommGroup N
inst✝² : Module R M
inst✝¹ : Module R N
i : M →ₗ[R] N
f : M →ₗ[R] Q
inst✝ : Fact (Function.Injective ⇑i)
r : R
x : ↥(LinearMap.range i)
eq1 : i (r • Exists.choose (_ : ↑x ∈ LinearMap.range i)) = i (Exists.choose (_ : ↑(r • x) ∈ LinearMap.range i))
⊢ f (Exists.choose (_ : ↑(r • x) ∈ LinearMap.range i)) = r • f (Exists.choose (_ : ↑x ∈ LinearMap.range i))

Next tactic:
rw [← Fact.out (p := Function.Injective i) eq1, LinearMap.map_smul]
instance ExtensionOf.inhabited : Inhabited (ExtensionOf i f) where
  default :=
    { domain := LinearMap.range i
      toFun :=
        { toFun := fun x => f x.2.choose
          map_add' := fun x y => by
            have eq1 : _ + _ = (x + y).1 := congr_arg₂ (· + ·) x.2.choose_spec y.2.choose_spec
            rw [← map_add, ← (x + y).2.choose_spec] at eq1
            dsimp
            rw [← Fact.out (p := Function.Injective i) eq1, map_add]
          map_smul' := fun r x => by
            have eq1 : r • _ = (r • x).1 := congr_arg (r • ·) x.2.choose_spec
            rw [← LinearMap.map_smul, ← (r • x).2.choose_spec] at eq1
            dsimp
            rw [← Fact.out (p := Function.Injective i) eq1, LinearMap.map_smul] }
      le := le_refl _
      is_extension := fun m => by
        

Proof state:
R : Type u
inst✝⁷ : Ring R
Q : TypeMax
inst✝⁶ : AddCommGroup Q
inst✝⁵ : Module R Q
M N : Type (max u v)
inst✝⁴ : AddCommGroup M
inst✝³ : AddCommGroup N
inst✝² : Module R M
inst✝¹ : Module R N
i : M →ₗ[R] N
f : M →ₗ[R] Q
inst✝ : Fact (Function.Injective ⇑i)
m : M
⊢ f m =
    ↑{ domain := LinearMap.range i,
          toFun :=
            {
              toAddHom :=
                { toFun := fun x => f (Exists.choose (_ : ↑x ∈ LinearMap.range i)),
                  map_add' :=
                    (_ :
                      ∀ (x y : ↥(LinearMap.range i)),
                        (fun x => f (Exists.choose (_ : ↑x ∈ LinearMap.range i))) (x + y) =
                          (fun x => f (Exists.choose (_ : ↑x ∈ LinearMap.range i))) x +
                            (fun x => f (Exists.choose (_ : ↑x ∈ LinearMap.range i))) y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (x : ↥(LinearMap.range i)),
                    AddHom.toFun
                        { toFun := fun x => f (Exists.choose (_ : ↑x ∈ LinearMap.range i)),
                          map_add' :=
                            (_ :
                              ∀ (x y : ↥(LinearMap.range i)),
                                (fun x => f (Exists.choose (_ : ↑x ∈ LinearMap.range i))) (x + y) =
                                  (fun x => f (Exists.choose (_ : ↑x ∈ LinearMap.range i))) x +
                                    (fun x => f (Exists.choose (_ : ↑x ∈ LinearMap.range i))) y) }
                        (r • x) =
                      (RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun x => f (Exists.choose (_ : ↑x ∈ LinearMap.range i)),
                            map_add' :=
                              (_ :
                                ∀ (x y : ↥(LinearMap.range i)),
                                  (fun x => f (Exists.choose (_ : ↑x ∈ LinearMap.range i))) (x + y) =
                                    (fun x => f (Exists.choose (_ : ↑x ∈ LinearMap.range i))) x +
                                      (fun x => f (Exists.choose (_ : ↑x ∈ LinearMap.range i))) y) }
                          x) } }
      { val := i m, property := (_ : i m ∈ LinearMap.range i) }

Next tactic:
simp only [LinearPMap.mk_apply, LinearMap.coe_mk]
instance ExtensionOf.inhabited : Inhabited (ExtensionOf i f) where
  default :=
    { domain := LinearMap.range i
      toFun :=
        { toFun := fun x => f x.2.choose
          map_add' := fun x y => by
            have eq1 : _ + _ = (x + y).1 := congr_arg₂ (· + ·) x.2.choose_spec y.2.choose_spec
            rw [← map_add, ← (x + y).2.choose_spec] at eq1
            dsimp
            rw [← Fact.out (p := Function.Injective i) eq1, map_add]
          map_smul' := fun r x => by
            have eq1 : r • _ = (r • x).1 := congr_arg (r • ·) x.2.choose_spec
            rw [← LinearMap.map_smul, ← (r • x).2.choose_spec] at eq1
            dsimp
            rw [← Fact.out (p := Function.Injective i) eq1, LinearMap.map_smul] }
      le := le_refl _
      is_extension := fun m => by
        simp only [LinearPMap.mk_apply, LinearMap.coe_mk]
        

Proof state:
R : Type u
inst✝⁷ : Ring R
Q : TypeMax
inst✝⁶ : AddCommGroup Q
inst✝⁵ : Module R Q
M N : Type (max u v)
inst✝⁴ : AddCommGroup M
inst✝³ : AddCommGroup N
inst✝² : Module R M
inst✝¹ : Module R N
i : M →ₗ[R] N
f : M →ₗ[R] Q
inst✝ : Fact (Function.Injective ⇑i)
m : M
⊢ f m =
    { toFun := fun x => f (Exists.choose (_ : ↑x ∈ LinearMap.range i)),
        map_add' :=
          (_ :
            ∀ (x y : ↥(LinearMap.range i)),
              f (Exists.choose (_ : ↑(x + y) ∈ LinearMap.range i)) =
                f (Exists.choose (_ : ↑x ∈ LinearMap.range i)) + f (Exists.choose (_ : ↑y ∈ LinearMap.range i))) }
      { val := i m, property := (_ : i m ∈ LinearMap.range i) }

Next tactic:
dsimp
instance ExtensionOf.inhabited : Inhabited (ExtensionOf i f) where
  default :=
    { domain := LinearMap.range i
      toFun :=
        { toFun := fun x => f x.2.choose
          map_add' := fun x y => by
            have eq1 : _ + _ = (x + y).1 := congr_arg₂ (· + ·) x.2.choose_spec y.2.choose_spec
            rw [← map_add, ← (x + y).2.choose_spec] at eq1
            dsimp
            rw [← Fact.out (p := Function.Injective i) eq1, map_add]
          map_smul' := fun r x => by
            have eq1 : r • _ = (r • x).1 := congr_arg (r • ·) x.2.choose_spec
            rw [← LinearMap.map_smul, ← (r • x).2.choose_spec] at eq1
            dsimp
            rw [← Fact.out (p := Function.Injective i) eq1, LinearMap.map_smul] }
      le := le_refl _
      is_extension := fun m => by
        simp only [LinearPMap.mk_apply, LinearMap.coe_mk]
        dsimp
        

Proof state:
R : Type u
inst✝⁷ : Ring R
Q : TypeMax
inst✝⁶ : AddCommGroup Q
inst✝⁵ : Module R Q
M N : Type (max u v)
inst✝⁴ : AddCommGroup M
inst✝³ : AddCommGroup N
inst✝² : Module R M
inst✝¹ : Module R N
i : M →ₗ[R] N
f : M →ₗ[R] Q
inst✝ : Fact (Function.Injective ⇑i)
m : M
⊢ f m = f (Exists.choose (_ : i m ∈ LinearMap.range i))

Next tactic:
apply congrArg
instance ExtensionOf.inhabited : Inhabited (ExtensionOf i f) where
  default :=
    { domain := LinearMap.range i
      toFun :=
        { toFun := fun x => f x.2.choose
          map_add' := fun x y => by
            have eq1 : _ + _ = (x + y).1 := congr_arg₂ (· + ·) x.2.choose_spec y.2.choose_spec
            rw [← map_add, ← (x + y).2.choose_spec] at eq1
            dsimp
            rw [← Fact.out (p := Function.Injective i) eq1, map_add]
          map_smul' := fun r x => by
            have eq1 : r • _ = (r • x).1 := congr_arg (r • ·) x.2.choose_spec
            rw [← LinearMap.map_smul, ← (r • x).2.choose_spec] at eq1
            dsimp
            rw [← Fact.out (p := Function.Injective i) eq1, LinearMap.map_smul] }
      le := le_refl _
      is_extension := fun m => by
        simp only [LinearPMap.mk_apply, LinearMap.coe_mk]
        dsimp
        apply congrArg
        

Proof state:
case h
R : Type u
inst✝⁷ : Ring R
Q : TypeMax
inst✝⁶ : AddCommGroup Q
inst✝⁵ : Module R Q
M N : Type (max u v)
inst✝⁴ : AddCommGroup M
inst✝³ : AddCommGroup N
inst✝² : Module R M
inst✝¹ : Module R N
i : M →ₗ[R] N
f : M →ₗ[R] Q
inst✝ : Fact (Function.Injective ⇑i)
m : M
⊢ m = Exists.choose (_ : i m ∈ LinearMap.range i)

Next tactic:
exact Fact.out (p := Function.Injective i)
          (⟨i m, ⟨_, rfl⟩⟩ : LinearMap.range i).2.choose_spec.symm
private theorem extensionOfMax_adjoin.aux1 {y : N} (x : supExtensionOfMaxSingleton i f y) :
    ∃ (a : (extensionOfMax i f).domain) (b : R), x.1 = a.1 + b • y := by
  

Proof state:
R : Type u
inst✝⁷ : Ring R
Q : TypeMax
inst✝⁶ : AddCommGroup Q
inst✝⁵ : Module R Q
M N : Type (max u v)
inst✝⁴ : AddCommGroup M
inst✝³ : AddCommGroup N
inst✝² : Module R M
inst✝¹ : Module R N
i : M →ₗ[R] N
f : M →ₗ[R] Q
inst✝ : Fact (Function.Injective ⇑i)
y : N
x : ↥(supExtensionOfMaxSingleton i f y)
⊢ ∃ a b, ↑x = ↑a + b • y

Next tactic:
have mem1 : x.1 ∈ (_ : Set _) := x.2
private theorem extensionOfMax_adjoin.aux1 {y : N} (x : supExtensionOfMaxSingleton i f y) :
    ∃ (a : (extensionOfMax i f).domain) (b : R), x.1 = a.1 + b • y := by
  have mem1 : x.1 ∈ (_ : Set _) := x.2
  

Proof state:
R : Type u
inst✝⁷ : Ring R
Q : TypeMax
inst✝⁶ : AddCommGroup Q
inst✝⁵ : Module R Q
M N : Type (max u v)
inst✝⁴ : AddCommGroup M
inst✝³ : AddCommGroup N
inst✝² : Module R M
inst✝¹ : Module R N
i : M →ₗ[R] N
f : M →ₗ[R] Q
inst✝ : Fact (Function.Injective ⇑i)
y : N
x : ↥(supExtensionOfMaxSingleton i f y)
mem1 : ↑x ∈ ↑(supExtensionOfMaxSingleton i f y)
⊢ ∃ a b, ↑x = ↑a + b • y

Next tactic:
rw [Submodule.coe_sup] at mem1
private theorem extensionOfMax_adjoin.aux1 {y : N} (x : supExtensionOfMaxSingleton i f y) :
    ∃ (a : (extensionOfMax i f).domain) (b : R), x.1 = a.1 + b • y := by
  have mem1 : x.1 ∈ (_ : Set _) := x.2
  rw [Submodule.coe_sup] at mem1
  

Proof state:
R : Type u
inst✝⁷ : Ring R
Q : TypeMax
inst✝⁶ : AddCommGroup Q
inst✝⁵ : Module R Q
M N : Type (max u v)
inst✝⁴ : AddCommGroup M
inst✝³ : AddCommGroup N
inst✝² : Module R M
inst✝¹ : Module R N
i : M →ₗ[R] N
f : M →ₗ[R] Q
inst✝ : Fact (Function.Injective ⇑i)
y : N
x : ↥(supExtensionOfMaxSingleton i f y)
mem1 : ↑x ∈ ↑(extensionOfMax i f).toLinearPMap.domain + ↑(Submodule.span R {y})
⊢ ∃ a b, ↑x = ↑a + b • y

Next tactic:
rcases mem1 with ⟨a, b, a_mem, b_mem : b ∈ (Submodule.span R _ : Submodule R N), eq1⟩
private theorem extensionOfMax_adjoin.aux1 {y : N} (x : supExtensionOfMaxSingleton i f y) :
    ∃ (a : (extensionOfMax i f).domain) (b : R), x.1 = a.1 + b • y := by
  have mem1 : x.1 ∈ (_ : Set _) := x.2
  rw [Submodule.coe_sup] at mem1
  rcases mem1 with ⟨a, b, a_mem, b_mem : b ∈ (Submodule.span R _ : Submodule R N), eq1⟩
  

Proof state:
case intro.intro.intro.intro
R : Type u
inst✝⁷ : Ring R
Q : TypeMax
inst✝⁶ : AddCommGroup Q
inst✝⁵ : Module R Q
M N : Type (max u v)
inst✝⁴ : AddCommGroup M
inst✝³ : AddCommGroup N
inst✝² : Module R M
inst✝¹ : Module R N
i : M →ₗ[R] N
f : M →ₗ[R] Q
inst✝ : Fact (Function.Injective ⇑i)
y : N
x : ↥(supExtensionOfMaxSingleton i f y)
a b : N
a_mem : a ∈ ↑(extensionOfMax i f).toLinearPMap.domain
b_mem : b ∈ Submodule.span R {y}
eq1 : (fun x x_1 => x + x_1) a b = ↑x
⊢ ∃ a b, ↑x = ↑a + b • y

Next tactic:
rw [Submodule.mem_span_singleton] at b_mem
private theorem extensionOfMax_adjoin.aux1 {y : N} (x : supExtensionOfMaxSingleton i f y) :
    ∃ (a : (extensionOfMax i f).domain) (b : R), x.1 = a.1 + b • y := by
  have mem1 : x.1 ∈ (_ : Set _) := x.2
  rw [Submodule.coe_sup] at mem1
  rcases mem1 with ⟨a, b, a_mem, b_mem : b ∈ (Submodule.span R _ : Submodule R N), eq1⟩
  rw [Submodule.mem_span_singleton] at b_mem
  

Proof state:
case intro.intro.intro.intro
R : Type u
inst✝⁷ : Ring R
Q : TypeMax
inst✝⁶ : AddCommGroup Q
inst✝⁵ : Module R Q
M N : Type (max u v)
inst✝⁴ : AddCommGroup M
inst✝³ : AddCommGroup N
inst✝² : Module R M
inst✝¹ : Module R N
i : M →ₗ[R] N
f : M →ₗ[R] Q
inst✝ : Fact (Function.Injective ⇑i)
y : N
x : ↥(supExtensionOfMaxSingleton i f y)
a b : N
a_mem : a ∈ ↑(extensionOfMax i f).toLinearPMap.domain
b_mem : ∃ a, a • y = b
eq1 : (fun x x_1 => x + x_1) a b = ↑x
⊢ ∃ a b, ↑x = ↑a + b • y

Next tactic:
rcases b_mem with ⟨z, eq2⟩
private theorem extensionOfMax_adjoin.aux1 {y : N} (x : supExtensionOfMaxSingleton i f y) :
    ∃ (a : (extensionOfMax i f).domain) (b : R), x.1 = a.1 + b • y := by
  have mem1 : x.1 ∈ (_ : Set _) := x.2
  rw [Submodule.coe_sup] at mem1
  rcases mem1 with ⟨a, b, a_mem, b_mem : b ∈ (Submodule.span R _ : Submodule R N), eq1⟩
  rw [Submodule.mem_span_singleton] at b_mem
  rcases b_mem with ⟨z, eq2⟩
  

Proof state:
case intro.intro.intro.intro.intro
R : Type u
inst✝⁷ : Ring R
Q : TypeMax
inst✝⁶ : AddCommGroup Q
inst✝⁵ : Module R Q
M N : Type (max u v)
inst✝⁴ : AddCommGroup M
inst✝³ : AddCommGroup N
inst✝² : Module R M
inst✝¹ : Module R N
i : M →ₗ[R] N
f : M →ₗ[R] Q
inst✝ : Fact (Function.Injective ⇑i)
y : N
x : ↥(supExtensionOfMaxSingleton i f y)
a b : N
a_mem : a ∈ ↑(extensionOfMax i f).toLinearPMap.domain
eq1 : (fun x x_1 => x + x_1) a b = ↑x
z : R
eq2 : z • y = b
⊢ ∃ a b, ↑x = ↑a + b • y

Next tactic:
exact ⟨⟨a, a_mem⟩, z, by rw [← eq1, ← eq2]⟩
private theorem extensionOfMax_adjoin.aux1 {y : N} (x : supExtensionOfMaxSingleton i f y) :
    ∃ (a : (extensionOfMax i f).domain) (b : R), x.1 = a.1 + b • y := by
  have mem1 : x.1 ∈ (_ : Set _) := x.2
  rw [Submodule.coe_sup] at mem1
  rcases mem1 with ⟨a, b, a_mem, b_mem : b ∈ (Submodule.span R _ : Submodule R N), eq1⟩
  rw [Submodule.mem_span_singleton] at b_mem
  rcases b_mem with ⟨z, eq2⟩
  exact ⟨⟨a, a_mem⟩, z, by 

Proof state:
R : Type u
inst✝⁷ : Ring R
Q : TypeMax
inst✝⁶ : AddCommGroup Q
inst✝⁵ : Module R Q
M N : Type (max u v)
inst✝⁴ : AddCommGroup M
inst✝³ : AddCommGroup N
inst✝² : Module R M
inst✝¹ : Module R N
i : M →ₗ[R] N
f : M →ₗ[R] Q
inst✝ : Fact (Function.Injective ⇑i)
y : N
x : ↥(supExtensionOfMaxSingleton i f y)
a b : N
a_mem : a ∈ ↑(extensionOfMax i f).toLinearPMap.domain
eq1 : (fun x x_1 => x + x_1) a b = ↑x
z : R
eq2 : z • y = b
⊢ ↑x = ↑{ val := a, property := a_mem } + z • y

Next tactic:
rw [← eq1, ← eq2]
/-- A linear map `I ⟶ Q` by `x ↦ f' (x • y)` where `f'` is the maximal extension-/
def ExtensionOfMaxAdjoin.idealTo (y : N) : ExtensionOfMaxAdjoin.ideal i f y →ₗ[R] Q where
  toFun (z : { x // x ∈ ideal i f y }) := (extensionOfMax i f).toLinearPMap ⟨(↑z : R) • y, z.prop⟩
  map_add' (z1 z2 : { x // x ∈ ideal i f y }) := by
    -- porting note: a single simp took care of the goal before reenableeta
    

Proof state:
R : Type u
inst✝⁷ : Ring R
Q : TypeMax
inst✝⁶ : AddCommGroup Q
inst✝⁵ : Module R Q
M N : Type (max u v)
inst✝⁴ : AddCommGroup M
inst✝³ : AddCommGroup N
inst✝² : Module R M
inst✝¹ : Module R N
i : M →ₗ[R] N
f : M →ₗ[R] Q
inst✝ : Fact (Function.Injective ⇑i)
y : N
z1 z2 : ↥(ideal i f y)
⊢ (fun z => ↑(extensionOfMax i f).toLinearPMap { val := ↑z • y, property := (_ : ↑z ∈ ideal i f y) }) (z1 + z2) =
    (fun z => ↑(extensionOfMax i f).toLinearPMap { val := ↑z • y, property := (_ : ↑z ∈ ideal i f y) }) z1 +
      (fun z => ↑(extensionOfMax i f).toLinearPMap { val := ↑z • y, property := (_ : ↑z ∈ ideal i f y) }) z2

Next tactic:
simp_rw [← (extensionOfMax i f).toLinearPMap.map_add]
/-- A linear map `I ⟶ Q` by `x ↦ f' (x • y)` where `f'` is the maximal extension-/
def ExtensionOfMaxAdjoin.idealTo (y : N) : ExtensionOfMaxAdjoin.ideal i f y →ₗ[R] Q where
  toFun (z : { x // x ∈ ideal i f y }) := (extensionOfMax i f).toLinearPMap ⟨(↑z : R) • y, z.prop⟩
  map_add' (z1 z2 : { x // x ∈ ideal i f y }) := by
    -- porting note: a single simp took care of the goal before reenableeta
    simp_rw [← (extensionOfMax i f).toLinearPMap.map_add]
    

Proof state:
R : Type u
inst✝⁷ : Ring R
Q : TypeMax
inst✝⁶ : AddCommGroup Q
inst✝⁵ : Module R Q
M N : Type (max u v)
inst✝⁴ : AddCommGroup M
inst✝³ : AddCommGroup N
inst✝² : Module R M
inst✝¹ : Module R N
i : M →ₗ[R] N
f : M →ₗ[R] Q
inst✝ : Fact (Function.Injective ⇑i)
y : N
z1 z2 : ↥(ideal i f y)
⊢ ↑(extensionOfMax i f).toLinearPMap { val := ↑(z1 + z2) • y, property := (_ : ↑(z1 + z2) ∈ ideal i f y) } =
    ↑(extensionOfMax i f).toLinearPMap
      ({ val := ↑z1 • y, property := (_ : ↑z1 ∈ ideal i f y) } +
        { val := ↑z2 • y, property := (_ : ↑z2 ∈ ideal i f y) })

Next tactic:
congr
/-- A linear map `I ⟶ Q` by `x ↦ f' (x • y)` where `f'` is the maximal extension-/
def ExtensionOfMaxAdjoin.idealTo (y : N) : ExtensionOfMaxAdjoin.ideal i f y →ₗ[R] Q where
  toFun (z : { x // x ∈ ideal i f y }) := (extensionOfMax i f).toLinearPMap ⟨(↑z : R) • y, z.prop⟩
  map_add' (z1 z2 : { x // x ∈ ideal i f y }) := by
    -- porting note: a single simp took care of the goal before reenableeta
    simp_rw [← (extensionOfMax i f).toLinearPMap.map_add]
    congr
    

Proof state:
case e_a.e_val
R : Type u
inst✝⁷ : Ring R
Q : TypeMax
inst✝⁶ : AddCommGroup Q
inst✝⁵ : Module R Q
M N : Type (max u v)
inst✝⁴ : AddCommGroup M
inst✝³ : AddCommGroup N
inst✝² : Module R M
inst✝¹ : Module R N
i : M →ₗ[R] N
f : M →ₗ[R] Q
inst✝ : Fact (Function.Injective ⇑i)
y : N
z1 z2 : ↥(ideal i f y)
⊢ ↑(z1 + z2) • y =
    ↑{ val := ↑z1 • y, property := (_ : ↑z1 ∈ ideal i f y) } + ↑{ val := ↑z2 • y, property := (_ : ↑z2 ∈ ideal i f y) }

Next tactic:
apply add_smul
/-- A linear map `I ⟶ Q` by `x ↦ f' (x • y)` where `f'` is the maximal extension-/
def ExtensionOfMaxAdjoin.idealTo (y : N) : ExtensionOfMaxAdjoin.ideal i f y →ₗ[R] Q where
  toFun (z : { x // x ∈ ideal i f y }) := (extensionOfMax i f).toLinearPMap ⟨(↑z : R) • y, z.prop⟩
  map_add' (z1 z2 : { x // x ∈ ideal i f y }) := by
    -- porting note: a single simp took care of the goal before reenableeta
    simp_rw [← (extensionOfMax i f).toLinearPMap.map_add]
    congr
    apply add_smul
  map_smul' z1 (z2 : {x // x ∈ ideal i f y}) := by
    -- porting note: a single simp took care of the goal before reenableeta
    

Proof state:
R : Type u
inst✝⁷ : Ring R
Q : TypeMax
inst✝⁶ : AddCommGroup Q
inst✝⁵ : Module R Q
M N : Type (max u v)
inst✝⁴ : AddCommGroup M
inst✝³ : AddCommGroup N
inst✝² : Module R M
inst✝¹ : Module R N
i : M →ₗ[R] N
f : M →ₗ[R] Q
inst✝ : Fact (Function.Injective ⇑i)
y : N
z1 : R
z2 : ↥(ideal i f y)
⊢ AddHom.toFun
      { toFun := fun z => ↑(extensionOfMax i f).toLinearPMap { val := ↑z • y, property := (_ : ↑z ∈ ideal i f y) },
        map_add' :=
          (_ :
            ∀ (z1 z2 : ↥(ideal i f y)),
              (fun z => ↑(extensionOfMax i f).toLinearPMap { val := ↑z • y, property := (_ : ↑z ∈ ideal i f y) })
                  (z1 + z2) =
                (fun z => ↑(extensionOfMax i f).toLinearPMap { val := ↑z • y, property := (_ : ↑z ∈ ideal i f y) }) z1 +
                  (fun z => ↑(extensionOfMax i f).toLinearPMap { val := ↑z • y, property := (_ : ↑z ∈ ideal i f y) })
                    z2) }
      (z1 • z2) =
    (RingHom.id R) z1 •
      AddHom.toFun
        { toFun := fun z => ↑(extensionOfMax i f).toLinearPMap { val := ↑z • y, property := (_ : ↑z ∈ ideal i f y) },
          map_add' :=
            (_ :
              ∀ (z1 z2 : ↥(ideal i f y)),
                (fun z => ↑(extensionOfMax i f).toLinearPMap { val := ↑z • y, property := (_ : ↑z ∈ ideal i f y) })
                    (z1 + z2) =
                  (fun z => ↑(extensionOfMax i f).toLinearPMap { val := ↑z • y, property := (_ : ↑z ∈ ideal i f y) })
                      z1 +
                    (fun z => ↑(extensionOfMax i f).toLinearPMap { val := ↑z • y, property := (_ : ↑z ∈ ideal i f y) })
                      z2) }
        z2

Next tactic:
simp_rw [← (extensionOfMax i f).toLinearPMap.map_smul]
/-- A linear map `I ⟶ Q` by `x ↦ f' (x • y)` where `f'` is the maximal extension-/
def ExtensionOfMaxAdjoin.idealTo (y : N) : ExtensionOfMaxAdjoin.ideal i f y →ₗ[R] Q where
  toFun (z : { x // x ∈ ideal i f y }) := (extensionOfMax i f).toLinearPMap ⟨(↑z : R) • y, z.prop⟩
  map_add' (z1 z2 : { x // x ∈ ideal i f y }) := by
    -- porting note: a single simp took care of the goal before reenableeta
    simp_rw [← (extensionOfMax i f).toLinearPMap.map_add]
    congr
    apply add_smul
  map_smul' z1 (z2 : {x // x ∈ ideal i f y}) := by
    -- porting note: a single simp took care of the goal before reenableeta
    simp_rw [← (extensionOfMax i f).toLinearPMap.map_smul]
    

Proof state:
R : Type u
inst✝⁷ : Ring R
Q : TypeMax
inst✝⁶ : AddCommGroup Q
inst✝⁵ : Module R Q
M N : Type (max u v)
inst✝⁴ : AddCommGroup M
inst✝³ : AddCommGroup N
inst✝² : Module R M
inst✝¹ : Module R N
i : M →ₗ[R] N
f : M →ₗ[R] Q
inst✝ : Fact (Function.Injective ⇑i)
y : N
z1 : R
z2 : ↥(ideal i f y)
⊢ ↑(extensionOfMax i f).toLinearPMap { val := ↑(z1 • z2) • y, property := (_ : ↑(z1 • z2) ∈ ideal i f y) } =
    ↑(extensionOfMax i f).toLinearPMap ((RingHom.id R) z1 • { val := ↑z2 • y, property := (_ : ↑z2 ∈ ideal i f y) })

Next tactic:
congr 2
/-- A linear map `I ⟶ Q` by `x ↦ f' (x • y)` where `f'` is the maximal extension-/
def ExtensionOfMaxAdjoin.idealTo (y : N) : ExtensionOfMaxAdjoin.ideal i f y →ₗ[R] Q where
  toFun (z : { x // x ∈ ideal i f y }) := (extensionOfMax i f).toLinearPMap ⟨(↑z : R) • y, z.prop⟩
  map_add' (z1 z2 : { x // x ∈ ideal i f y }) := by
    -- porting note: a single simp took care of the goal before reenableeta
    simp_rw [← (extensionOfMax i f).toLinearPMap.map_add]
    congr
    apply add_smul
  map_smul' z1 (z2 : {x // x ∈ ideal i f y}) := by
    -- porting note: a single simp took care of the goal before reenableeta
    simp_rw [← (extensionOfMax i f).toLinearPMap.map_smul]
    congr 2
    

Proof state:
case e_a.e_val
R : Type u
inst✝⁷ : Ring R
Q : TypeMax
inst✝⁶ : AddCommGroup Q
inst✝⁵ : Module R Q
M N : Type (max u v)
inst✝⁴ : AddCommGroup M
inst✝³ : AddCommGroup N
inst✝² : Module R M
inst✝¹ : Module R N
i : M →ₗ[R] N
f : M →ₗ[R] Q
inst✝ : Fact (Function.Injective ⇑i)
y : N
z1 : R
z2 : ↥(ideal i f y)
⊢ ↑(z1 • z2) • y = (RingHom.id R) z1 • ↑{ val := ↑z2 • y, property := (_ : ↑z2 ∈ ideal i f y) }

Next tactic:
apply mul_smul
theorem ExtensionOfMaxAdjoin.extendIdealTo_wd' (h : Module.Baer R Q) {y : N} (r : R)
    (eq1 : r • y = 0) : ExtensionOfMaxAdjoin.extendIdealTo i f h y r = 0 := by
  

Proof state:
R : Type u
inst✝⁷ : Ring R
Q : TypeMax
inst✝⁶ : AddCommGroup Q
inst✝⁵ : Module R Q
M N : Type (max u v)
inst✝⁴ : AddCommGroup M
inst✝³ : AddCommGroup N
inst✝² : Module R M
inst✝¹ : Module R N
i : M →ₗ[R] N
f : M →ₗ[R] Q
inst✝ : Fact (Function.Injective ⇑i)
h : Baer R Q
y : N
r : R
eq1 : r • y = 0
⊢ (extendIdealTo i f h y) r = 0

Next tactic:
have : r ∈ ideal i f y := by
    change (r • y) ∈ (extensionOfMax i f).toLinearPMap.domain
    rw [eq1]
    apply Submodule.zero_mem _
theorem ExtensionOfMaxAdjoin.extendIdealTo_wd' (h : Module.Baer R Q) {y : N} (r : R)
    (eq1 : r • y = 0) : ExtensionOfMaxAdjoin.extendIdealTo i f h y r = 0 := by
  have : r ∈ ideal i f y := by
    

Proof state:
R : Type u
inst✝⁷ : Ring R
Q : TypeMax
inst✝⁶ : AddCommGroup Q
inst✝⁵ : Module R Q
M N : Type (max u v)
inst✝⁴ : AddCommGroup M
inst✝³ : AddCommGroup N
inst✝² : Module R M
inst✝¹ : Module R N
i : M →ₗ[R] N
f : M →ₗ[R] Q
inst✝ : Fact (Function.Injective ⇑i)
h : Baer R Q
y : N
r : R
eq1 : r • y = 0
⊢ r ∈ ideal i f y

Next tactic:
change (r • y) ∈ (extensionOfMax i f).toLinearPMap.domain
theorem ExtensionOfMaxAdjoin.extendIdealTo_wd' (h : Module.Baer R Q) {y : N} (r : R)
    (eq1 : r • y = 0) : ExtensionOfMaxAdjoin.extendIdealTo i f h y r = 0 := by
  have : r ∈ ideal i f y := by
    change (r • y) ∈ (extensionOfMax i f).toLinearPMap.domain
    

Proof state:
R : Type u
inst✝⁷ : Ring R
Q : TypeMax
inst✝⁶ : AddCommGroup Q
inst✝⁵ : Module R Q
M N : Type (max u v)
inst✝⁴ : AddCommGroup M
inst✝³ : AddCommGroup N
inst✝² : Module R M
inst✝¹ : Module R N
i : M →ₗ[R] N
f : M →ₗ[R] Q
inst✝ : Fact (Function.Injective ⇑i)
h : Baer R Q
y : N
r : R
eq1 : r • y = 0
⊢ r • y ∈ (extensionOfMax i f).toLinearPMap.domain

Next tactic:
rw [eq1]