l3lab/ntp-mathlib huggingface dataset:
/-- In a vector space with dimension 1, each set {v} is a basis for `v ≠ 0`. -/
@[simps repr_apply]
noncomputable def basisSingleton (ι : Type*) [Unique ι] (h : finrank K V = 1) (v : V)
    (hv : v ≠ 0) : Basis ι K V :=
  let b := FiniteDimensional.basisUnique ι h
  let h : b.repr v default ≠ 0 := mt FiniteDimensional.basisUnique_repr_eq_zero_iff.mp hv
  Basis.ofRepr
    { toFun := fun w => Finsupp.single default (b.repr w default / b.repr v default)
      invFun := fun f => f default • v
      map_add' := by simp [add_div]
      map_smul' := by simp [mul_div]
      left_inv := fun w => by
        

Proof state:
K : Type u
V : Type v
inst✝⁵ : DivisionRing K
inst✝⁴ : AddCommGroup V
inst✝³ : Module K V
V₂ : Type v'
inst✝² : AddCommGroup V₂
inst✝¹ : Module K V₂
ι : Type u_1
inst✝ : Unique ι
h✝ : finrank K V = 1
v : V
hv : v ≠ 0
b : Basis ι K V := basisUnique ι h✝
h : (b.repr v) default ≠ 0 := mt basisUnique_repr_eq_zero_iff.mp hv
w : V
⊢ (fun f => f default • v)
      (AddHom.toFun
        {
            toAddHom :=
              { toFun := fun w => fun₀ | default => (b.repr w) default / (b.repr v) default,
                map_add' :=
                  (_ :
                    ∀ (a a_1 : V),
                      (fun₀
                          | default =>
                              ((basisUnique ι h✝).repr (a + a_1)) default / ((basisUnique ι h✝).repr v) default) =
                        (fun₀ | default => ((basisUnique ι h✝).repr a) default / ((basisUnique ι h✝).repr v) default) +
                          fun₀
                          | default => ((basisUnique ι h✝).repr a_1) default / ((basisUnique ι h✝).repr v) default) },
            map_smul' :=
              (_ :
                ∀ (a : K) (a_1 : V),
                  (fun₀
                      | default => ((basisUnique ι h✝).repr (a • a_1)) default / ((basisUnique ι h✝).repr v) default) =
                    a •
                      fun₀
                      | default =>
                          ((basisUnique ι h✝).repr a_1) default / ((basisUnique ι h✝).repr v) default) }.toAddHom
        w) =
    w

Next tactic:
apply_fun b.repr using b.repr.toEquiv.injective
/-- In a vector space with dimension 1, each set {v} is a basis for `v ≠ 0`. -/
@[simps repr_apply]
noncomputable def basisSingleton (ι : Type*) [Unique ι] (h : finrank K V = 1) (v : V)
    (hv : v ≠ 0) : Basis ι K V :=
  let b := FiniteDimensional.basisUnique ι h
  let h : b.repr v default ≠ 0 := mt FiniteDimensional.basisUnique_repr_eq_zero_iff.mp hv
  Basis.ofRepr
    { toFun := fun w => Finsupp.single default (b.repr w default / b.repr v default)
      invFun := fun f => f default • v
      map_add' := by simp [add_div]
      map_smul' := by simp [mul_div]
      left_inv := fun w => by
        apply_fun b.repr using b.repr.toEquiv.injective
        

Proof state:
K : Type u
V : Type v
inst✝⁵ : DivisionRing K
inst✝⁴ : AddCommGroup V
inst✝³ : Module K V
V₂ : Type v'
inst✝² : AddCommGroup V₂
inst✝¹ : Module K V₂
ι : Type u_1
inst✝ : Unique ι
h✝ : finrank K V = 1
v : V
hv : v ≠ 0
b : Basis ι K V := basisUnique ι h✝
h : (b.repr v) default ≠ 0 := mt basisUnique_repr_eq_zero_iff.mp hv
w : V
⊢ b.repr
      ((fun f => f default • v)
        (AddHom.toFun
          {
              toAddHom :=
                { toFun := fun w => fun₀ | default => (b.repr w) default / (b.repr v) default,
                  map_add' :=
                    (_ :
                      ∀ (a a_1 : V),
                        (fun₀
                            | default =>
                                ((basisUnique ι h✝).repr (a + a_1)) default / ((basisUnique ι h✝).repr v) default) =
                          (fun₀
                              | default => ((basisUnique ι h✝).repr a) default / ((basisUnique ι h✝).repr v) default) +
                            fun₀
                            | default => ((basisUnique ι h✝).repr a_1) default / ((basisUnique ι h✝).repr v) default) },
              map_smul' :=
                (_ :
                  ∀ (a : K) (a_1 : V),
                    (fun₀
                        | default =>
                            ((basisUnique ι h✝).repr (a • a_1)) default / ((basisUnique ι h✝).repr v) default) =
                      a •
                        fun₀
                        | default =>
                            ((basisUnique ι h✝).repr a_1) default / ((basisUnique ι h✝).repr v) default) }.toAddHom
          w)) =
    b.repr w

Next tactic:
apply_fun Equiv.finsuppUnique
/-- In a vector space with dimension 1, each set {v} is a basis for `v ≠ 0`. -/
@[simps repr_apply]
noncomputable def basisSingleton (ι : Type*) [Unique ι] (h : finrank K V = 1) (v : V)
    (hv : v ≠ 0) : Basis ι K V :=
  let b := FiniteDimensional.basisUnique ι h
  let h : b.repr v default ≠ 0 := mt FiniteDimensional.basisUnique_repr_eq_zero_iff.mp hv
  Basis.ofRepr
    { toFun := fun w => Finsupp.single default (b.repr w default / b.repr v default)
      invFun := fun f => f default • v
      map_add' := by simp [add_div]
      map_smul' := by simp [mul_div]
      left_inv := fun w => by
        apply_fun b.repr using b.repr.toEquiv.injective
        apply_fun Equiv.finsuppUnique
        

Proof state:
K : Type u
V : Type v
inst✝⁵ : DivisionRing K
inst✝⁴ : AddCommGroup V
inst✝³ : Module K V
V₂ : Type v'
inst✝² : AddCommGroup V₂
inst✝¹ : Module K V₂
ι : Type u_1
inst✝ : Unique ι
h✝ : finrank K V = 1
v : V
hv : v ≠ 0
b : Basis ι K V := basisUnique ι h✝
h : (b.repr v) default ≠ 0 := mt basisUnique_repr_eq_zero_iff.mp hv
w : V
⊢ Equiv.finsuppUnique
      (b.repr
        ((fun f => f default • v)
          (AddHom.toFun
            {
                toAddHom :=
                  { toFun := fun w => fun₀ | default => (b.repr w) default / (b.repr v) default,
                    map_add' :=
                      (_ :
                        ∀ (a a_1 : V),
                          (fun₀
                              | default =>
                                  ((basisUnique ι h✝).repr (a + a_1)) default / ((basisUnique ι h✝).repr v) default) =
                            (fun₀
                                | default =>
                                    ((basisUnique ι h✝).repr a) default / ((basisUnique ι h✝).repr v) default) +
                              fun₀
                              | default =>
                                  ((basisUnique ι h✝).repr a_1) default / ((basisUnique ι h✝).repr v) default) },
                map_smul' :=
                  (_ :
                    ∀ (a : K) (a_1 : V),
                      (fun₀
                          | default =>
                              ((basisUnique ι h✝).repr (a • a_1)) default / ((basisUnique ι h✝).repr v) default) =
                        a •
                          fun₀
                          | default =>
                              ((basisUnique ι h✝).repr a_1) default / ((basisUnique ι h✝).repr v) default) }.toAddHom
            w))) =
    Equiv.finsuppUnique (b.repr w)

Next tactic:
simp only [LinearEquiv.map_smulₛₗ, Finsupp.coe_smul, Finsupp.single_eq_same,
          RingHom.id_apply, smul_eq_mul, Pi.smul_apply, Equiv.finsuppUnique_apply]
/-- In a vector space with dimension 1, each set {v} is a basis for `v ≠ 0`. -/
@[simps repr_apply]
noncomputable def basisSingleton (ι : Type*) [Unique ι] (h : finrank K V = 1) (v : V)
    (hv : v ≠ 0) : Basis ι K V :=
  let b := FiniteDimensional.basisUnique ι h
  let h : b.repr v default ≠ 0 := mt FiniteDimensional.basisUnique_repr_eq_zero_iff.mp hv
  Basis.ofRepr
    { toFun := fun w => Finsupp.single default (b.repr w default / b.repr v default)
      invFun := fun f => f default • v
      map_add' := by simp [add_div]
      map_smul' := by simp [mul_div]
      left_inv := fun w => by
        apply_fun b.repr using b.repr.toEquiv.injective
        apply_fun Equiv.finsuppUnique
        simp only [LinearEquiv.map_smulₛₗ, Finsupp.coe_smul, Finsupp.single_eq_same,
          RingHom.id_apply, smul_eq_mul, Pi.smul_apply, Equiv.finsuppUnique_apply]
        

Proof state:
K : Type u
V : Type v
inst✝⁵ : DivisionRing K
inst✝⁴ : AddCommGroup V
inst✝³ : Module K V
V₂ : Type v'
inst✝² : AddCommGroup V₂
inst✝¹ : Module K V₂
ι : Type u_1
inst✝ : Unique ι
h✝ : finrank K V = 1
v : V
hv : v ≠ 0
b : Basis ι K V := basisUnique ι h✝
h : (b.repr v) default ≠ 0 := mt basisUnique_repr_eq_zero_iff.mp hv
w : V
⊢ ((basisUnique ι h✝).repr w) default / ((basisUnique ι h✝).repr v) default * ((basisUnique ι h✝).repr v) default =
    ((basisUnique ι h✝).repr w) default

Next tactic:
exact div_mul_cancel _ h
/-- In a vector space with dimension 1, each set {v} is a basis for `v ≠ 0`. -/
@[simps repr_apply]
noncomputable def basisSingleton (ι : Type*) [Unique ι] (h : finrank K V = 1) (v : V)
    (hv : v ≠ 0) : Basis ι K V :=
  let b := FiniteDimensional.basisUnique ι h
  let h : b.repr v default ≠ 0 := mt FiniteDimensional.basisUnique_repr_eq_zero_iff.mp hv
  Basis.ofRepr
    { toFun := fun w => Finsupp.single default (b.repr w default / b.repr v default)
      invFun := fun f => f default • v
      map_add' := by simp [add_div]
      map_smul' := by simp [mul_div]
      left_inv := fun w => by
        apply_fun b.repr using b.repr.toEquiv.injective
        apply_fun Equiv.finsuppUnique
        simp only [LinearEquiv.map_smulₛₗ, Finsupp.coe_smul, Finsupp.single_eq_same,
          RingHom.id_apply, smul_eq_mul, Pi.smul_apply, Equiv.finsuppUnique_apply]
        exact div_mul_cancel _ h
      right_inv := fun f => by
        

Proof state:
K : Type u
V : Type v
inst✝⁵ : DivisionRing K
inst✝⁴ : AddCommGroup V
inst✝³ : Module K V
V₂ : Type v'
inst✝² : AddCommGroup V₂
inst✝¹ : Module K V₂
ι : Type u_1
inst✝ : Unique ι
h✝ : finrank K V = 1
v : V
hv : v ≠ 0
b : Basis ι K V := basisUnique ι h✝
h : (b.repr v) default ≠ 0 := mt basisUnique_repr_eq_zero_iff.mp hv
f : ι →₀ K
⊢ AddHom.toFun
      {
          toAddHom :=
            { toFun := fun w => fun₀ | default => (b.repr w) default / (b.repr v) default,
              map_add' :=
                (_ :
                  ∀ (a a_1 : V),
                    (fun₀
                        | default =>
                            ((basisUnique ι h✝).repr (a + a_1)) default / ((basisUnique ι h✝).repr v) default) =
                      (fun₀ | default => ((basisUnique ι h✝).repr a) default / ((basisUnique ι h✝).repr v) default) +
                        fun₀
                        | default => ((basisUnique ι h✝).repr a_1) default / ((basisUnique ι h✝).repr v) default) },
          map_smul' :=
            (_ :
              ∀ (a : K) (a_1 : V),
                (fun₀ | default => ((basisUnique ι h✝).repr (a • a_1)) default / ((basisUnique ι h✝).repr v) default) =
                  a •
                    fun₀
                    | default => ((basisUnique ι h✝).repr a_1) default / ((basisUnique ι h✝).repr v) default) }.toAddHom
      ((fun f => f default • v) f) =
    f

Next tactic:
ext
/-- In a vector space with dimension 1, each set {v} is a basis for `v ≠ 0`. -/
@[simps repr_apply]
noncomputable def basisSingleton (ι : Type*) [Unique ι] (h : finrank K V = 1) (v : V)
    (hv : v ≠ 0) : Basis ι K V :=
  let b := FiniteDimensional.basisUnique ι h
  let h : b.repr v default ≠ 0 := mt FiniteDimensional.basisUnique_repr_eq_zero_iff.mp hv
  Basis.ofRepr
    { toFun := fun w => Finsupp.single default (b.repr w default / b.repr v default)
      invFun := fun f => f default • v
      map_add' := by simp [add_div]
      map_smul' := by simp [mul_div]
      left_inv := fun w => by
        apply_fun b.repr using b.repr.toEquiv.injective
        apply_fun Equiv.finsuppUnique
        simp only [LinearEquiv.map_smulₛₗ, Finsupp.coe_smul, Finsupp.single_eq_same,
          RingHom.id_apply, smul_eq_mul, Pi.smul_apply, Equiv.finsuppUnique_apply]
        exact div_mul_cancel _ h
      right_inv := fun f => by
        ext
        

Proof state:
case h
K : Type u
V : Type v
inst✝⁵ : DivisionRing K
inst✝⁴ : AddCommGroup V
inst✝³ : Module K V
V₂ : Type v'
inst✝² : AddCommGroup V₂
inst✝¹ : Module K V₂
ι : Type u_1
inst✝ : Unique ι
h✝ : finrank K V = 1
v : V
hv : v ≠ 0
b : Basis ι K V := basisUnique ι h✝
h : (b.repr v) default ≠ 0 := mt basisUnique_repr_eq_zero_iff.mp hv
f : ι →₀ K
⊢ (AddHom.toFun
        {
            toAddHom :=
              { toFun := fun w => fun₀ | default => (b.repr w) default / (b.repr v) default,
                map_add' :=
                  (_ :
                    ∀ (a a_1 : V),
                      (fun₀
                          | default =>
                              ((basisUnique ι h✝).repr (a + a_1)) default / ((basisUnique ι h✝).repr v) default) =
                        (fun₀ | default => ((basisUnique ι h✝).repr a) default / ((basisUnique ι h✝).repr v) default) +
                          fun₀
                          | default => ((basisUnique ι h✝).repr a_1) default / ((basisUnique ι h✝).repr v) default) },
            map_smul' :=
              (_ :
                ∀ (a : K) (a_1 : V),
                  (fun₀
                      | default => ((basisUnique ι h✝).repr (a • a_1)) default / ((basisUnique ι h✝).repr v) default) =
                    a •
                      fun₀
                      | default =>
                          ((basisUnique ι h✝).repr a_1) default / ((basisUnique ι h✝).repr v) default) }.toAddHom
        ((fun f => f default • v) f))
      default =
    f default

Next tactic:
simp only [LinearEquiv.map_smulₛₗ, Finsupp.coe_smul, Finsupp.single_eq_same,
          RingHom.id_apply, smul_eq_mul, Pi.smul_apply]
/-- In a vector space with dimension 1, each set {v} is a basis for `v ≠ 0`. -/
@[simps repr_apply]
noncomputable def basisSingleton (ι : Type*) [Unique ι] (h : finrank K V = 1) (v : V)
    (hv : v ≠ 0) : Basis ι K V :=
  let b := FiniteDimensional.basisUnique ι h
  let h : b.repr v default ≠ 0 := mt FiniteDimensional.basisUnique_repr_eq_zero_iff.mp hv
  Basis.ofRepr
    { toFun := fun w => Finsupp.single default (b.repr w default / b.repr v default)
      invFun := fun f => f default • v
      map_add' := by simp [add_div]
      map_smul' := by simp [mul_div]
      left_inv := fun w => by
        apply_fun b.repr using b.repr.toEquiv.injective
        apply_fun Equiv.finsuppUnique
        simp only [LinearEquiv.map_smulₛₗ, Finsupp.coe_smul, Finsupp.single_eq_same,
          RingHom.id_apply, smul_eq_mul, Pi.smul_apply, Equiv.finsuppUnique_apply]
        exact div_mul_cancel _ h
      right_inv := fun f => by
        ext
        simp only [LinearEquiv.map_smulₛₗ, Finsupp.coe_smul, Finsupp.single_eq_same,
          RingHom.id_apply, smul_eq_mul, Pi.smul_apply]
        

Proof state:
case h
K : Type u
V : Type v
inst✝⁵ : DivisionRing K
inst✝⁴ : AddCommGroup V
inst✝³ : Module K V
V₂ : Type v'
inst✝² : AddCommGroup V₂
inst✝¹ : Module K V₂
ι : Type u_1
inst✝ : Unique ι
h✝ : finrank K V = 1
v : V
hv : v ≠ 0
b : Basis ι K V := basisUnique ι h✝
h : (b.repr v) default ≠ 0 := mt basisUnique_repr_eq_zero_iff.mp hv
f : ι →₀ K
⊢ f default * ((basisUnique ι h✝).repr v) default / ((basisUnique ι h✝).repr v) default = f default

Next tactic:
exact mul_div_cancel _ h
@[simp]
theorem basisSingleton_apply (ι : Type*) [Unique ι] (h : finrank K V = 1) (v : V) (hv : v ≠ 0)
    (i : ι) : basisSingleton ι h v hv i = v := by
  

Proof state:
K : Type u
V : Type v
inst✝⁵ : DivisionRing K
inst✝⁴ : AddCommGroup V
inst✝³ : Module K V
V₂ : Type v'
inst✝² : AddCommGroup V₂
inst✝¹ : Module K V₂
ι : Type u_1
inst✝ : Unique ι
h : finrank K V = 1
v : V
hv : v ≠ 0
i : ι
⊢ (basisSingleton ι h v hv) i = v

Next tactic:
cases Unique.uniq ‹Unique ι› i
@[simp]
theorem basisSingleton_apply (ι : Type*) [Unique ι] (h : finrank K V = 1) (v : V) (hv : v ≠ 0)
    (i : ι) : basisSingleton ι h v hv i = v := by
  cases Unique.uniq ‹Unique ι› i
  

Proof state:
case refl
K : Type u
V : Type v
inst✝⁵ : DivisionRing K
inst✝⁴ : AddCommGroup V
inst✝³ : Module K V
V₂ : Type v'
inst✝² : AddCommGroup V₂
inst✝¹ : Module K V₂
ι : Type u_1
inst✝ : Unique ι
h : finrank K V = 1
v : V
hv : v ≠ 0
⊢ (basisSingleton ι h v hv) default = v

Next tactic:
simp [basisSingleton]
@[simp]
theorem range_basisSingleton (ι : Type*) [Unique ι] (h : finrank K V = 1) (v : V) (hv : v ≠ 0) :
    Set.range (basisSingleton ι h v hv) = {v} := by 

Proof state:
K : Type u
V : Type v
inst✝⁵ : DivisionRing K
inst✝⁴ : AddCommGroup V
inst✝³ : Module K V
V₂ : Type v'
inst✝² : AddCommGroup V₂
inst✝¹ : Module K V₂
ι : Type u_1
inst✝ : Unique ι
h : finrank K V = 1
v : V
hv : v ≠ 0
⊢ Set.range ⇑(basisSingleton ι h v hv) = {v}

Next tactic:
rw [Set.range_unique, basisSingleton_apply]
instance finiteDimensional_bot : FiniteDimensional K (⊥ : Submodule K V) :=
  finiteDimensional_of_rank_eq_zero <| by 

Proof state:
K : Type u
V : Type v
inst✝² : DivisionRing K
inst✝¹ : AddCommGroup V
inst✝ : Module K V
⊢ Module.rank K ↥⊥ = 0

Next tactic:
simp
/-- The sup of two finite-dimensional submodules is
finite-dimensional. -/
instance finiteDimensional_sup (S₁ S₂ : Submodule K V) [h₁ : FiniteDimensional K S₁]
    [h₂ : FiniteDimensional K S₂] : FiniteDimensional K (S₁ ⊔ S₂ : Submodule K V) := by
  

Proof state:
K : Type u
V : Type v
inst✝² : DivisionRing K
inst✝¹ : AddCommGroup V
inst✝ : Module K V
S₁ S₂ : Submodule K V
h₁ : FiniteDimensional K ↥S₁
h₂ : FiniteDimensional K ↥S₂
⊢ FiniteDimensional K ↥(S₁ ⊔ S₂)

Next tactic:
unfold FiniteDimensional at *
/-- The sup of two finite-dimensional submodules is
finite-dimensional. -/
instance finiteDimensional_sup (S₁ S₂ : Submodule K V) [h₁ : FiniteDimensional K S₁]
    [h₂ : FiniteDimensional K S₂] : FiniteDimensional K (S₁ ⊔ S₂ : Submodule K V) := by
  unfold FiniteDimensional at *
  

Proof state:
K : Type u
V : Type v
inst✝² : DivisionRing K
inst✝¹ : AddCommGroup V
inst✝ : Module K V
S₁ S₂ : Submodule K V
h₁ : Module.Finite K ↥S₁
h₂ : Module.Finite K ↥S₂
⊢ Module.Finite K ↥(S₁ ⊔ S₂)

Next tactic:
rw [finite_def] at *
/-- The sup of two finite-dimensional submodules is
finite-dimensional. -/
instance finiteDimensional_sup (S₁ S₂ : Submodule K V) [h₁ : FiniteDimensional K S₁]
    [h₂ : FiniteDimensional K S₂] : FiniteDimensional K (S₁ ⊔ S₂ : Submodule K V) := by
  unfold FiniteDimensional at *
  rw [finite_def] at *
  

Proof state:
K : Type u
V : Type v
inst✝² : DivisionRing K
inst✝¹ : AddCommGroup V
inst✝ : Module K V
S₁ S₂ : Submodule K V
h₁ : FG ⊤
h₂ : FG ⊤
⊢ FG ⊤

Next tactic:
exact (fg_top _).2 (((fg_top S₁).1 h₁).sup ((fg_top S₂).1 h₂))
/-- The submodule generated by a finite supremum of finite dimensional submodules is
finite-dimensional.

Note that strictly this only needs `∀ i ∈ s, FiniteDimensional K (S i)`, but that doesn't
work well with typeclass search. -/
instance finiteDimensional_finset_sup {ι : Type*} (s : Finset ι) (S : ι → Submodule K V)
    [∀ i, FiniteDimensional K (S i)] : FiniteDimensional K (s.sup S : Submodule K V) := by
  

Proof state:
K : Type u
V : Type v
inst✝³ : DivisionRing K
inst✝² : AddCommGroup V
inst✝¹ : Module K V
ι : Type u_1
s : Finset ι
S : ι → Submodule K V
inst✝ : ∀ (i : ι), FiniteDimensional K ↥(S i)
⊢ FiniteDimensional K ↥(Finset.sup s S)

Next tactic:
refine'
    @Finset.sup_induction _ _ _ _ s S (fun i => FiniteDimensional K ↑i) (finiteDimensional_bot K V)
      _ fun i _ => by infer_instance
/-- The submodule generated by a finite supremum of finite dimensional submodules is
finite-dimensional.

Note that strictly this only needs `∀ i ∈ s, FiniteDimensional K (S i)`, but that doesn't
work well with typeclass search. -/
instance finiteDimensional_finset_sup {ι : Type*} (s : Finset ι) (S : ι → Submodule K V)
    [∀ i, FiniteDimensional K (S i)] : FiniteDimensional K (s.sup S : Submodule K V) := by
  refine'
    @Finset.sup_induction _ _ _ _ s S (fun i => FiniteDimensional K ↑i) (finiteDimensional_bot K V)
      _ fun i _ => by 

Proof state:
K : Type u
V : Type v
inst✝³ : DivisionRing K
inst✝² : AddCommGroup V
inst✝¹ : Module K V
ι : Type u_1
s : Finset ι
S : ι → Submodule K V
inst✝ : ∀ (i : ι), FiniteDimensional K ↥(S i)
i : ι
x✝ : i ∈ s
⊢ (fun i => FiniteDimensional K ↥i) (S i)

Next tactic:
infer_instance
/-- The submodule generated by a finite supremum of finite dimensional submodules is
finite-dimensional.

Note that strictly this only needs `∀ i ∈ s, FiniteDimensional K (S i)`, but that doesn't
work well with typeclass search. -/
instance finiteDimensional_finset_sup {ι : Type*} (s : Finset ι) (S : ι → Submodule K V)
    [∀ i, FiniteDimensional K (S i)] : FiniteDimensional K (s.sup S : Submodule K V) := by
  refine'
    @Finset.sup_induction _ _ _ _ s S (fun i => FiniteDimensional K ↑i) (finiteDimensional_bot K V)
      _ fun i _ => by infer_instance
  · 

Proof state:
K : Type u
V : Type v
inst✝³ : DivisionRing K
inst✝² : AddCommGroup V
inst✝¹ : Module K V
ι : Type u_1
s : Finset ι
S : ι → Submodule K V
inst✝ : ∀ (i : ι), FiniteDimensional K ↥(S i)
⊢ ∀ (a₁ : Submodule K V),
    (fun i => FiniteDimensional K ↥i) a₁ →
      ∀ (a₂ : Submodule K V), (fun i => FiniteDimensional K ↥i) a₂ → (fun i => FiniteDimensional K ↥i) (a₁ ⊔ a₂)

Next tactic:
intro S₁ hS₁ S₂ hS₂
/-- The submodule generated by a finite supremum of finite dimensional submodules is
finite-dimensional.

Note that strictly this only needs `∀ i ∈ s, FiniteDimensional K (S i)`, but that doesn't
work well with typeclass search. -/
instance finiteDimensional_finset_sup {ι : Type*} (s : Finset ι) (S : ι → Submodule K V)
    [∀ i, FiniteDimensional K (S i)] : FiniteDimensional K (s.sup S : Submodule K V) := by
  refine'
    @Finset.sup_induction _ _ _ _ s S (fun i => FiniteDimensional K ↑i) (finiteDimensional_bot K V)
      _ fun i _ => by infer_instance
  · intro S₁ hS₁ S₂ hS₂
    

Proof state:
K : Type u
V : Type v
inst✝³ : DivisionRing K
inst✝² : AddCommGroup V
inst✝¹ : Module K V
ι : Type u_1
s : Finset ι
S : ι → Submodule K V
inst✝ : ∀ (i : ι), FiniteDimensional K ↥(S i)
S₁ : Submodule K V
hS₁ : FiniteDimensional K ↥S₁
S₂ : Submodule K V
hS₂ : FiniteDimensional K ↥S₂
⊢ FiniteDimensional K ↥(S₁ ⊔ S₂)

Next tactic:
exact Submodule.finiteDimensional_sup S₁ S₂
/-- The submodule generated by a supremum of finite dimensional submodules, indexed by a finite
sort is finite-dimensional. -/
instance finiteDimensional_iSup {ι : Sort*} [Finite ι] (S : ι → Submodule K V)
    [∀ i, FiniteDimensional K (S i)] : FiniteDimensional K ↑(⨆ i, S i) := by
  

Proof state:
K : Type u
V : Type v
inst✝⁴ : DivisionRing K
inst✝³ : AddCommGroup V
inst✝² : Module K V
ι : Sort u_1
inst✝¹ : _root_.Finite ι
S : ι → Submodule K V
inst✝ : ∀ (i : ι), FiniteDimensional K ↥(S i)
⊢ FiniteDimensional K ↥(⨆ i, S i)

Next tactic:
cases nonempty_fintype (PLift ι)
/-- The submodule generated by a supremum of finite dimensional submodules, indexed by a finite
sort is finite-dimensional. -/
instance finiteDimensional_iSup {ι : Sort*} [Finite ι] (S : ι → Submodule K V)
    [∀ i, FiniteDimensional K (S i)] : FiniteDimensional K ↑(⨆ i, S i) := by
  cases nonempty_fintype (PLift ι)
  

Proof state:
case intro
K : Type u
V : Type v
inst✝⁴ : DivisionRing K
inst✝³ : AddCommGroup V
inst✝² : Module K V
ι : Sort u_1
inst✝¹ : _root_.Finite ι
S : ι → Submodule K V
inst✝ : ∀ (i : ι), FiniteDimensional K ↥(S i)
val✝ : Fintype (PLift ι)
⊢ FiniteDimensional K ↥(⨆ i, S i)

Next tactic:
rw [← iSup_plift_down, ← Finset.sup_univ_eq_iSup]
/-- The submodule generated by a supremum of finite dimensional submodules, indexed by a finite
sort is finite-dimensional. -/
instance finiteDimensional_iSup {ι : Sort*} [Finite ι] (S : ι → Submodule K V)
    [∀ i, FiniteDimensional K (S i)] : FiniteDimensional K ↑(⨆ i, S i) := by
  cases nonempty_fintype (PLift ι)
  rw [← iSup_plift_down, ← Finset.sup_univ_eq_iSup]
  

Proof state:
case intro
K : Type u
V : Type v
inst✝⁴ : DivisionRing K
inst✝³ : AddCommGroup V
inst✝² : Module K V
ι : Sort u_1
inst✝¹ : _root_.Finite ι
S : ι → Submodule K V
inst✝ : ∀ (i : ι), FiniteDimensional K ↥(S i)
val✝ : Fintype (PLift ι)
⊢ FiniteDimensional K ↥(Finset.sup Finset.univ fun i => S i.down)

Next tactic:
exact Submodule.finiteDimensional_finset_sup _ _