awhecmu/canonical-drafter-extract-mathlib huggingface dataset:
-- Module: Mathlib.Algebra.Module.ZLattice.Basic
Goal:
K : Type u_1
inst : NormedField K
inst_1 : LinearOrder K
inst_2 : IsStrictOrderedRing K
inst_3 : HasSolidNorm K
inst_4 : FloorRing K
E : Type u_2
inst_5 : NormedAddCommGroup E
inst_6 : NormedSpace K E
inst_7 : FiniteDimensional K E
inst_8 : ProperSpace E
L : Submodule ℤ E
inst_9 : DiscreteTopology.{u_2} ↥L
hs : IsZLattice K L
this_1 : Module.Finite.{0, u_2} ℤ ↥L
this_2 : Module ℚ E
this_3 : IsAddTorsionFree E
b₀ : Basis (Free.ChooseBasisIndex ℤ ↥L) ℤ ↥L := Free.chooseBasis ℤ ↥L
b : Free.ChooseBasisIndex ℤ ↥L → E :=
  Function.comp (β := ↥L) (Subtype.val (p := fun (x : E) ↦ x ∈ L)) (⇑b₀ : (a : Free.ChooseBasisIndex ℤ ↥L) → ↥L)
this_4 : LinearIndependent ℤ b
h_spanL : span ℤ (Set.range b) = L
h_spanE : Eq (α := Submodule K E) (span K (Set.range b)) ⊤
h_card : Fintype.card.{u_2} (Free.ChooseBasisIndex ℤ ↥L) = (Set.range b).toFinset.card
t : Set E
ht_inc : t ⊆ Set.range b
ht_span : Eq (α := Submodule K E) (span K t) (span K (Set.range b))
ht_lin : LinearIndependent.{u_2, u_1, u_2} (ι := { x : E // x ∈ t }) K (Subtype.val (p := fun (x : E) ↦ x ∈ t))
e : Basis (↑t : Type u_2) K E := Basis.mk ht_lin ⋯
this_5 : Fintype (↑t : Type u_2)
h : finrank K E < Fintype.card.{u_2} (Free.ChooseBasisIndex ℤ ↥L)
v : E
hv : v ∈ Set.range b \ Set.range (ι := (↑t : Type u_2)) (⇑e : (a : (↑t : Type u_2)) → E)
h_1 : LinearIndepOn.{u_2, 0, u_2} (ι := E) ℚ id (Set.range (ι := (↑t : Type u_2)) (⇑e : (a : (↑t : Type u_2)) → E))
h_mapsto :
  Set.MapsTo (fun (n : ℤ) ↦ fract e (n • v)) Set.univ
    (Metric.closedBall 0 (∑ i : (↑t : Type u_2), norm (E := E) ((e : (a : (↑t : Type u_2)) → E) i : E)) ∩ (↑L : Set E))
this : DiscreteTopology.{u_2} ↥L.toAddSubgroup
⊢ (Metric.closedBall 0 (∑ i : (↑t : Type u_2), norm (E := E) ((e : (a : (↑t : Type u_2)) → E) i : E)) ∩
      (↑L.toAddSubgroup : Set E)).Finite

Tactic:
exact Metric.finite_isBounded_inter_isClosed DiscreteTopology.isDiscrete
        Metric.isBounded_closedBall inferInstance

Premises used: Metric.isBounded_closedBall, DiscreteTopology.isDiscrete, inferInstance, Metric.finite_isBounded_inter_isClosed
-- Module: Mathlib.Algebra.Module.ZLattice.Basic
Goal:
K : Type u_1
inst : NormedField K
inst_1 : LinearOrder K
inst_2 : IsStrictOrderedRing K
inst_3 : HasSolidNorm K
inst_4 : FloorRing K
E : Type u_2
inst_5 : NormedAddCommGroup E
inst_6 : NormedSpace K E
inst_7 : FiniteDimensional K E
inst_8 : ProperSpace E
L : Submodule ℤ E
inst_9 : DiscreteTopology.{u_2} ↥L
hs : IsZLattice K L
this_1 : Module.Finite.{0, u_2} ℤ ↥L
this_2 : Module ℚ E
this_3 : IsAddTorsionFree E
b₀ : Basis (Free.ChooseBasisIndex ℤ ↥L) ℤ ↥L := Free.chooseBasis ℤ ↥L
b : Free.ChooseBasisIndex ℤ ↥L → E :=
  Function.comp (β := ↥L) (Subtype.val (p := fun (x : E) ↦ x ∈ L)) (⇑b₀ : (a : Free.ChooseBasisIndex ℤ ↥L) → ↥L)
this_4 : LinearIndependent ℤ b
h_spanL : span ℤ (Set.range b) = L
h_spanE : Eq (α := Submodule K E) (span K (Set.range b)) ⊤
h_card : Fintype.card.{u_2} (Free.ChooseBasisIndex ℤ ↥L) = (Set.range b).toFinset.card
t : Set E
ht_inc : t ⊆ Set.range b
ht_span : Eq (α := Submodule K E) (span K t) (span K (Set.range b))
ht_lin : LinearIndependent.{u_2, u_1, u_2} (ι := { x : E // x ∈ t }) K (Subtype.val (p := fun (x : E) ↦ x ∈ t))
e : Basis (↑t : Type u_2) K E := Basis.mk ht_lin ⋯
this : Fintype (↑t : Type u_2)
h : finrank K E < Fintype.card.{u_2} (Free.ChooseBasisIndex ℤ ↥L)
v : E
hv : v ∈ Set.range b \ Set.range (ι := (↑t : Type u_2)) (⇑e : (a : (↑t : Type u_2)) → E)
h_1 : LinearIndepOn.{u_2, 0, u_2} (ι := E) ℚ id (Set.range (ι := (↑t : Type u_2)) (⇑e : (a : (↑t : Type u_2)) → E))
h_mapsto :
  Set.MapsTo (fun (n : ℤ) ↦ fract e (n • v)) Set.univ
    (Metric.closedBall 0 (∑ i : (↑t : Type u_2), norm (E := E) ((e : (a : (↑t : Type u_2)) → E) i : E)) ∩ (↑L : Set E))
⊢ (Metric.closedBall 0 (∑ i : (↑t : Type u_2), norm (E := E) ((e : (a : (↑t : Type u_2)) → E) i : E)) ∩
      (↑L : Set E)).Finite

Tactic:
have h_finite : Set.Finite (Metric.closedBall 0 (∑ i, ‖e i‖) ∩ (L : Set E)) := by
      change ((_ : Set E) ∩ L.toAddSubgroup).Finite
      have : DiscreteTopology L.toAddSubgroup := (inferInstance : DiscreteTopology L)
      exact Metric.finite_isBounded_inter_isClosed DiscreteTopology.isDiscrete
        Metric.isBounded_closedBall inferInstance
-- Module: Mathlib.Algebra.Module.ZLattice.Basic
Goal:
K : Type u_1
inst : NormedField K
inst_1 : LinearOrder K
inst_2 : IsStrictOrderedRing K
inst_3 : HasSolidNorm K
inst_4 : FloorRing K
E : Type u_2
inst_5 : NormedAddCommGroup E
inst_6 : NormedSpace K E
inst_7 : FiniteDimensional K E
inst_8 : ProperSpace E
L : Submodule ℤ E
inst_9 : DiscreteTopology.{u_2} ↥L
hs : IsZLattice K L
this_1 : Module.Finite.{0, u_2} ℤ ↥L
this_2 : Module ℚ E
this_3 : IsAddTorsionFree E
b₀ : Basis (Free.ChooseBasisIndex ℤ ↥L) ℤ ↥L := Free.chooseBasis ℤ ↥L
b : Free.ChooseBasisIndex ℤ ↥L → E :=
  Function.comp (β := ↥L) (Subtype.val (p := fun (x : E) ↦ x ∈ L)) (⇑b₀ : (a : Free.ChooseBasisIndex ℤ ↥L) → ↥L)
this_4 : LinearIndependent ℤ b
h_spanL : span ℤ (Set.range b) = L
h_spanE : Eq (α := Submodule K E) (span K (Set.range b)) ⊤
h_card : Fintype.card.{u_2} (Free.ChooseBasisIndex ℤ ↥L) = (Set.range b).toFinset.card
t : Set E
ht_inc : t ⊆ Set.range b
ht_span : Eq (α := Submodule K E) (span K t) (span K (Set.range b))
ht_lin : LinearIndependent.{u_2, u_1, u_2} (ι := { x : E // x ∈ t }) K (Subtype.val (p := fun (x : E) ↦ x ∈ t))
e : Basis (↑t : Type u_2) K E := Basis.mk ht_lin ⋯
this : Fintype (↑t : Type u_2)
h : finrank K E < Fintype.card.{u_2} (Free.ChooseBasisIndex ℤ ↥L)
v : E
hv : v ∈ Set.range b \ Set.range (ι := (↑t : Type u_2)) (⇑e : (a : (↑t : Type u_2)) → E)
h_1 : LinearIndepOn.{u_2, 0, u_2} (ι := E) ℚ id (Set.range (ι := (↑t : Type u_2)) (⇑e : (a : (↑t : Type u_2)) → E))
h_mapsto :
  Set.MapsTo (fun (n : ℤ) ↦ fract e (n • v)) Set.univ
    (Metric.closedBall 0 (∑ i : (↑t : Type u_2), norm (E := E) ((e : (a : (↑t : Type u_2)) → E) i : E)) ∩ (↑L : Set E))
h_finite :
  (Metric.closedBall 0 (∑ i : (↑t : Type u_2), norm (E := E) ((e : (a : (↑t : Type u_2)) → E) i : E)) ∩
      (↑L : Set E)).Finite
refine_1 :
  ∀ (n m : ℤ) (h_ne : n ≠ m) (h_eq : fract e (n • v) = fract e (m • v)),
    Membership.mem (γ := Submodule ℚ E) (span ℚ (Set.range (ι := (↑t : Type u_2)) (⇑e : (a : (↑t : Type u_2)) → E))) v
⊢ Membership.mem (γ := Submodule ℚ E) (span ℚ (Set.range (ι := (↑t : Type u_2)) (⇑e : (a : (↑t : Type u_2)) → E))) v

Tactic:
obtain ⟨n, -, m, -, h_ne, h_eq⟩ := Set.Infinite.exists_ne_map_eq_of_mapsTo
      Set.infinite_univ h_mapsto h_finite

Premises used: Set.infinite_univ, Set.Infinite.exists_ne_map_eq_of_mapsTo
-- Module: Mathlib.Algebra.Module.ZLattice.Basic
Goal:
K : Type u_1
inst : NormedField K
inst_1 : LinearOrder K
inst_2 : IsStrictOrderedRing K
inst_3 : HasSolidNorm K
inst_4 : FloorRing K
E : Type u_2
inst_5 : NormedAddCommGroup E
inst_6 : NormedSpace K E
inst_7 : FiniteDimensional K E
inst_8 : ProperSpace E
L : Submodule ℤ E
inst_9 : DiscreteTopology.{u_2} ↥L
hs : IsZLattice K L
this_1 : Module.Finite.{0, u_2} ℤ ↥L
this_2 : Module ℚ E
this_3 : IsAddTorsionFree E
b₀ : Basis (Free.ChooseBasisIndex ℤ ↥L) ℤ ↥L := Free.chooseBasis ℤ ↥L
b : Free.ChooseBasisIndex ℤ ↥L → E :=
  Function.comp (β := ↥L) (Subtype.val (p := fun (x : E) ↦ x ∈ L)) (⇑b₀ : (a : Free.ChooseBasisIndex ℤ ↥L) → ↥L)
this_4 : LinearIndependent ℤ b
h_spanL : span ℤ (Set.range b) = L
h_spanE : Eq (α := Submodule K E) (span K (Set.range b)) ⊤
h_card : Fintype.card.{u_2} (Free.ChooseBasisIndex ℤ ↥L) = (Set.range b).toFinset.card
t : Set E
ht_inc : t ⊆ Set.range b
ht_span : Eq (α := Submodule K E) (span K t) (span K (Set.range b))
ht_lin : LinearIndependent.{u_2, u_1, u_2} (ι := { x : E // x ∈ t }) K (Subtype.val (p := fun (x : E) ↦ x ∈ t))
e : Basis (↑t : Type u_2) K E := Basis.mk ht_lin ⋯
this : Fintype (↑t : Type u_2)
h : finrank K E < Fintype.card.{u_2} (Free.ChooseBasisIndex ℤ ↥L)
v : E
hv : v ∈ Set.range b \ Set.range (ι := (↑t : Type u_2)) (⇑e : (a : (↑t : Type u_2)) → E)
h_1 : LinearIndepOn.{u_2, 0, u_2} (ι := E) ℚ id (Set.range (ι := (↑t : Type u_2)) (⇑e : (a : (↑t : Type u_2)) → E))
h_mapsto :
  Set.MapsTo (fun (n : ℤ) ↦ fract e (n • v)) Set.univ
    (Metric.closedBall 0 (∑ i : (↑t : Type u_2), norm (E := E) ((e : (a : (↑t : Type u_2)) → E) i : E)) ∩ (↑L : Set E))
h_finite :
  (Metric.closedBall 0 (∑ i : (↑t : Type u_2), norm (E := E) ((e : (a : (↑t : Type u_2)) → E) i : E)) ∩
      (↑L : Set E)).Finite
n m : ℤ
h_ne : n ≠ m
h_eq : fract e (n • v) = fract e (m • v)
rwa : ¬HAdd.hAdd (α := ℚ) (-(↑n : ℚ)) (↑m : ℚ) = 0
rwa₁ : ¬Eq (α := ℚ) (-(↑n : ℚ)) (-(↑m : ℚ))
rwa₂ : ¬Eq (α := ℚ) (↑n : ℚ) (↑m : ℚ)
rwa₃ : ¬n = m
rwa₄ rwa₅ rwa₆ rwa₇ : n ≠ m
⊢ HAdd.hAdd (α := ℚ) (-(↑n : ℚ)) (↑m : ℚ) ≠ 0

Tactic:
rwa [Ne, add_eq_zero_iff_eq_neg.not, neg_inj, Rat.coe_int_inj, ← Ne]

Premises used: Rat.coe_int_inj, add_eq_zero_iff_eq_neg, Iff.not, Ne, neg_inj
-- Module: Mathlib.Algebra.Module.ZLattice.Basic
Goal:
K : Type u_1
inst : NormedField K
inst_1 : LinearOrder K
inst_2 : IsStrictOrderedRing K
inst_3 : HasSolidNorm K
inst_4 : FloorRing K
E : Type u_2
inst_5 : NormedAddCommGroup E
inst_6 : NormedSpace K E
inst_7 : FiniteDimensional K E
inst_8 : ProperSpace E
L : Submodule ℤ E
inst_9 : DiscreteTopology.{u_2} ↥L
hs : IsZLattice K L
this_1 : Module.Finite.{0, u_2} ℤ ↥L
this_2 : Module ℚ E
this_3 : IsAddTorsionFree E
b₀ : Basis (Free.ChooseBasisIndex ℤ ↥L) ℤ ↥L := Free.chooseBasis ℤ ↥L
b : Free.ChooseBasisIndex ℤ ↥L → E :=
  Function.comp (β := ↥L) (Subtype.val (p := fun (x : E) ↦ x ∈ L)) (⇑b₀ : (a : Free.ChooseBasisIndex ℤ ↥L) → ↥L)
this_4 : LinearIndependent ℤ b
h_spanL : span ℤ (Set.range b) = L
h_spanE : Eq (α := Submodule K E) (span K (Set.range b)) ⊤
h_card : Fintype.card.{u_2} (Free.ChooseBasisIndex ℤ ↥L) = (Set.range b).toFinset.card
t : Set E
ht_inc : t ⊆ Set.range b
ht_span : Eq (α := Submodule K E) (span K t) (span K (Set.range b))
ht_lin : LinearIndependent.{u_2, u_1, u_2} (ι := { x : E // x ∈ t }) K (Subtype.val (p := fun (x : E) ↦ x ∈ t))
e : Basis (↑t : Type u_2) K E := Basis.mk ht_lin ⋯
this : Fintype (↑t : Type u_2)
h : finrank K E < Fintype.card.{u_2} (Free.ChooseBasisIndex ℤ ↥L)
v : E
hv : v ∈ Set.range b \ Set.range (ι := (↑t : Type u_2)) (⇑e : (a : (↑t : Type u_2)) → E)
h_1 : LinearIndepOn.{u_2, 0, u_2} (ι := E) ℚ id (Set.range (ι := (↑t : Type u_2)) (⇑e : (a : (↑t : Type u_2)) → E))
h_mapsto :
  Set.MapsTo (fun (n : ℤ) ↦ fract e (n • v)) Set.univ
    (Metric.closedBall 0 (∑ i : (↑t : Type u_2), norm (E := E) ((e : (a : (↑t : Type u_2)) → E) i : E)) ∩ (↑L : Set E))
h_finite :
  (Metric.closedBall 0 (∑ i : (↑t : Type u_2), norm (E := E) ((e : (a : (↑t : Type u_2)) → E) i : E)) ∩
      (↑L : Set E)).Finite
n m : ℤ
h_ne : n ≠ m
h_eq : fract e (n • v) = fract e (m • v)
⊢ HAdd.hAdd (α := ℚ) (-(↑n : ℚ)) (↑m : ℚ) ≠ 0

Tactic:
have h_nz : (-n + m : ℚ) ≠ 0 := by
      rwa [Ne, add_eq_zero_iff_eq_neg.not, neg_inj, Rat.coe_int_inj, ← Ne]
-- Module: Mathlib.Algebra.Module.ZLattice.Basic
Goal:
K : Type u_1
inst : NormedField K
inst_1 : LinearOrder K
inst_2 : IsStrictOrderedRing K
inst_3 : HasSolidNorm K
inst_4 : FloorRing K
E : Type u_2
inst_5 : NormedAddCommGroup E
inst_6 : NormedSpace K E
inst_7 : FiniteDimensional K E
inst_8 : ProperSpace E
L : Submodule ℤ E
inst_9 : DiscreteTopology.{u_2} ↥L
hs : IsZLattice K L
this_1 : Module.Finite.{0, u_2} ℤ ↥L
this_2 : Module ℚ E
this_3 : IsAddTorsionFree E
b₀ : Basis (Free.ChooseBasisIndex ℤ ↥L) ℤ ↥L := Free.chooseBasis ℤ ↥L
b : Free.ChooseBasisIndex ℤ ↥L → E :=
  Function.comp (β := ↥L) (Subtype.val (p := fun (x : E) ↦ x ∈ L)) (⇑b₀ : (a : Free.ChooseBasisIndex ℤ ↥L) → ↥L)
this_4 : LinearIndependent ℤ b
h_spanL : span ℤ (Set.range b) = L
h_spanE : Eq (α := Submodule K E) (span K (Set.range b)) ⊤
h_card : Fintype.card.{u_2} (Free.ChooseBasisIndex ℤ ↥L) = (Set.range b).toFinset.card
t : Set E
ht_inc : t ⊆ Set.range b
ht_span : Eq (α := Submodule K E) (span K t) (span K (Set.range b))
ht_lin : LinearIndependent.{u_2, u_1, u_2} (ι := { x : E // x ∈ t }) K (Subtype.val (p := fun (x : E) ↦ x ∈ t))
e : Basis (↑t : Type u_2) K E := Basis.mk ht_lin ⋯
this : Fintype (↑t : Type u_2)
h : finrank K E < Fintype.card.{u_2} (Free.ChooseBasisIndex ℤ ↥L)
v : E
hv : v ∈ Set.range b \ Set.range (ι := (↑t : Type u_2)) (⇑e : (a : (↑t : Type u_2)) → E)
h_1 : LinearIndepOn.{u_2, 0, u_2} (ι := E) ℚ id (Set.range (ι := (↑t : Type u_2)) (⇑e : (a : (↑t : Type u_2)) → E))
h_mapsto :
  Set.MapsTo (fun (n : ℤ) ↦ fract e (n • v)) Set.univ
    (Metric.closedBall 0 (∑ i : (↑t : Type u_2), norm (E := E) ((e : (a : (↑t : Type u_2)) → E) i : E)) ∩ (↑L : Set E))
h_finite :
  (Metric.closedBall 0 (∑ i : (↑t : Type u_2), norm (E := E) ((e : (a : (↑t : Type u_2)) → E) i : E)) ∩
      (↑L : Set E)).Finite
n m : ℤ
h_ne : n ≠ m
h_eq : fract e (n • v) = fract e (m • v)
h_nz : HAdd.hAdd (α := ℚ) (-(↑n : ℚ)) (↑m : ℚ) ≠ 0
refine_1 :
  Membership.mem (γ := Submodule ℚ E) (span ℚ (Set.range (ι := (↑t : Type u_2)) (⇑e : (a : (↑t : Type u_2)) → E)))
    (HAdd.hAdd (α := ℚ) (-(↑n : ℚ)) (↑m : ℚ) • v)
⊢ Membership.mem (γ := Submodule ℚ E) (span ℚ (Set.range (ι := (↑t : Type u_2)) (⇑e : (a : (↑t : Type u_2)) → E))) v

Tactic:
apply (smul_mem_iff _ h_nz).mp

Premises used: Submodule.smul_mem_iff, Iff.mp
-- Module: Mathlib.Algebra.Module.ZLattice.Basic
Goal:
K : Type u_1
inst : NormedField K
inst_1 : LinearOrder K
inst_2 : IsStrictOrderedRing K
inst_3 : HasSolidNorm K
inst_4 : FloorRing K
E : Type u_2
inst_5 : NormedAddCommGroup E
inst_6 : NormedSpace K E
inst_7 : FiniteDimensional K E
inst_8 : ProperSpace E
L : Submodule ℤ E
inst_9 : DiscreteTopology.{u_2} ↥L
hs : IsZLattice K L
this_1 : Module.Finite.{0, u_2} ℤ ↥L
this_2 : Module ℚ E
this_3 : IsAddTorsionFree E
b₀ : Basis (Free.ChooseBasisIndex ℤ ↥L) ℤ ↥L := Free.chooseBasis ℤ ↥L
b : Free.ChooseBasisIndex ℤ ↥L → E :=
  Function.comp (β := ↥L) (Subtype.val (p := fun (x : E) ↦ x ∈ L)) (⇑b₀ : (a : Free.ChooseBasisIndex ℤ ↥L) → ↥L)
this_4 : LinearIndependent ℤ b
h_spanL : span ℤ (Set.range b) = L
h_spanE : Eq (α := Submodule K E) (span K (Set.range b)) ⊤
h_card : Fintype.card.{u_2} (Free.ChooseBasisIndex ℤ ↥L) = (Set.range b).toFinset.card
t : Set E
ht_inc : t ⊆ Set.range b
ht_span : Eq (α := Submodule K E) (span K t) (span K (Set.range b))
ht_lin : LinearIndependent.{u_2, u_1, u_2} (ι := { x : E // x ∈ t }) K (Subtype.val (p := fun (x : E) ↦ x ∈ t))
e : Basis (↑t : Type u_2) K E := Basis.mk ht_lin ⋯
this : Fintype (↑t : Type u_2)
h : finrank K E < Fintype.card.{u_2} (Free.ChooseBasisIndex ℤ ↥L)
v : E
hv : v ∈ Set.range b \ Set.range (ι := (↑t : Type u_2)) (⇑e : (a : (↑t : Type u_2)) → E)
h_1 : LinearIndepOn.{u_2, 0, u_2} (ι := E) ℚ id (Set.range (ι := (↑t : Type u_2)) (⇑e : (a : (↑t : Type u_2)) → E))
h_mapsto :
  Set.MapsTo (fun (n : ℤ) ↦ fract e (n • v)) Set.univ
    (Metric.closedBall 0 (∑ i : (↑t : Type u_2), norm (E := E) ((e : (a : (↑t : Type u_2)) → E) i : E)) ∩ (↑L : Set E))
h_finite :
  (Metric.closedBall 0 (∑ i : (↑t : Type u_2), norm (E := E) ((e : (a : (↑t : Type u_2)) → E) i : E)) ∩
      (↑L : Set E)).Finite
n m : ℤ
h_ne : n ≠ m
h_eq : fract e (n • v) = fract e (m • v)
h_nz : HAdd.hAdd (α := ℚ) (-(↑n : ℚ)) (↑m : ℚ) ≠ 0
⊢ Membership.mem (γ := Submodule ℚ E) (span ℚ (Set.range (ι := (↑t : Type u_2)) (⇑e : (a : (↑t : Type u_2)) → E)))
    (HAdd.hAdd (α := ℚ) (-(↑n : ℚ)) (↑m : ℚ) • v)

Tactic:
span_subset_span ℤ ℚ _ ?_

Premises used: Submodule.span_subset_span, Set.Mem, Rat, setOf, Int
-- Module: Mathlib.Algebra.Module.ZLattice.Basic
Goal:
K : Type u_1
inst : NormedField K
inst_1 : LinearOrder K
inst_2 : IsStrictOrderedRing K
inst_3 : HasSolidNorm K
inst_4 : FloorRing K
E : Type u_2
inst_5 : NormedAddCommGroup E
inst_6 : NormedSpace K E
inst_7 : FiniteDimensional K E
inst_8 : ProperSpace E
L : Submodule ℤ E
inst_9 : DiscreteTopology.{u_2} ↥L
hs : IsZLattice K L
this_1 : Module.Finite.{0, u_2} ℤ ↥L
this_2 : Module ℚ E
this_3 : IsAddTorsionFree E
b₀ : Basis (Free.ChooseBasisIndex ℤ ↥L) ℤ ↥L := Free.chooseBasis ℤ ↥L
b : Free.ChooseBasisIndex ℤ ↥L → E :=
  Function.comp (β := ↥L) (Subtype.val (p := fun (x : E) ↦ x ∈ L)) (⇑b₀ : (a : Free.ChooseBasisIndex ℤ ↥L) → ↥L)
this_4 : LinearIndependent ℤ b
h_spanL : span ℤ (Set.range b) = L
h_spanE : Eq (α := Submodule K E) (span K (Set.range b)) ⊤
h_card : Fintype.card.{u_2} (Free.ChooseBasisIndex ℤ ↥L) = (Set.range b).toFinset.card
t : Set E
ht_inc : t ⊆ Set.range b
ht_span : Eq (α := Submodule K E) (span K t) (span K (Set.range b))
ht_lin : LinearIndependent.{u_2, u_1, u_2} (ι := { x : E // x ∈ t }) K (Subtype.val (p := fun (x : E) ↦ x ∈ t))
e : Basis (↑t : Type u_2) K E := Basis.mk ht_lin ⋯
this : Fintype (↑t : Type u_2)
h : finrank K E < Fintype.card.{u_2} (Free.ChooseBasisIndex ℤ ↥L)
v : E
hv : v ∈ Set.range b \ Set.range (ι := (↑t : Type u_2)) (⇑e : (a : (↑t : Type u_2)) → E)
h_1 : LinearIndepOn.{u_2, 0, u_2} (ι := E) ℚ id (Set.range (ι := (↑t : Type u_2)) (⇑e : (a : (↑t : Type u_2)) → E))
h_mapsto :
  Set.MapsTo (fun (n : ℤ) ↦ fract e (n • v)) Set.univ
    (Metric.closedBall 0 (∑ i : (↑t : Type u_2), norm (E := E) ((e : (a : (↑t : Type u_2)) → E) i : E)) ∩ (↑L : Set E))
h_finite :
  (Metric.closedBall 0 (∑ i : (↑t : Type u_2), norm (E := E) ((e : (a : (↑t : Type u_2)) → E) i : E)) ∩
      (↑L : Set E)).Finite
n m : ℤ
h_ne : n ≠ m
h_eq : fract e (n • v) = fract e (m • v)
h_nz : HAdd.hAdd (α := ℚ) (-(↑n : ℚ)) (↑m : ℚ) ≠ 0
refine_1 :
  HAdd.hAdd (α := ℚ) (-(↑n : ℚ)) (↑m : ℚ) • v ∈
    (↑(span ℤ (Set.range (ι := (↑t : Type u_2)) (⇑e : (a : (↑t : Type u_2)) → E))) : Set E)
⊢ Membership.mem (γ := Submodule ℚ E) (span ℚ (Set.range (ι := (↑t : Type u_2)) (⇑e : (a : (↑t : Type u_2)) → E)))
    (HAdd.hAdd (α := ℚ) (-(↑n : ℚ)) (↑m : ℚ) • v)

Tactic:
refine span_subset_span ℤ ℚ _ ?_

Premises used: Submodule.span_subset_span, Rat, Int
-- Module: Mathlib.Algebra.Module.ZLattice.Basic
Goal:
K : Type u_1
inst : NormedField K
inst_1 : LinearOrder K
inst_2 : IsStrictOrderedRing K
inst_3 : HasSolidNorm K
inst_4 : FloorRing K
E : Type u_2
inst_5 : NormedAddCommGroup E
inst_6 : NormedSpace K E
inst_7 : FiniteDimensional K E
inst_8 : ProperSpace E
L : Submodule ℤ E
inst_9 : DiscreteTopology.{u_2} ↥L
hs : IsZLattice K L
this_1 : Module.Finite.{0, u_2} ℤ ↥L
this_2 : Module ℚ E
this_3 : IsAddTorsionFree E
b₀ : Basis (Free.ChooseBasisIndex ℤ ↥L) ℤ ↥L := Free.chooseBasis ℤ ↥L
b : Free.ChooseBasisIndex ℤ ↥L → E :=
  Function.comp (β := ↥L) (Subtype.val (p := fun (x : E) ↦ x ∈ L)) (⇑b₀ : (a : Free.ChooseBasisIndex ℤ ↥L) → ↥L)
this_4 : LinearIndependent ℤ b
h_spanL : span ℤ (Set.range b) = L
h_spanE : Eq (α := Submodule K E) (span K (Set.range b)) ⊤
h_card : Fintype.card.{u_2} (Free.ChooseBasisIndex ℤ ↥L) = (Set.range b).toFinset.card
t : Set E
ht_inc : t ⊆ Set.range b
ht_span : Eq (α := Submodule K E) (span K t) (span K (Set.range b))
ht_lin : LinearIndependent.{u_2, u_1, u_2} (ι := { x : E // x ∈ t }) K (Subtype.val (p := fun (x : E) ↦ x ∈ t))
e : Basis (↑t : Type u_2) K E := Basis.mk ht_lin ⋯
this : Fintype (↑t : Type u_2)
h : finrank K E < Fintype.card.{u_2} (Free.ChooseBasisIndex ℤ ↥L)
v : E
hv : v ∈ Set.range b \ Set.range (ι := (↑t : Type u_2)) (⇑e : (a : (↑t : Type u_2)) → E)
h_1 : LinearIndepOn.{u_2, 0, u_2} (ι := E) ℚ id (Set.range (ι := (↑t : Type u_2)) (⇑e : (a : (↑t : Type u_2)) → E))
h_mapsto :
  Set.MapsTo (fun (n : ℤ) ↦ fract e (n • v)) Set.univ
    (Metric.closedBall 0 (∑ i : (↑t : Type u_2), norm (E := E) ((e : (a : (↑t : Type u_2)) → E) i : E)) ∩ (↑L : Set E))
h_finite :
  (Metric.closedBall 0 (∑ i : (↑t : Type u_2), norm (E := E) ((e : (a : (↑t : Type u_2)) → E) i : E)) ∩
      (↑L : Set E)).Finite
n m : ℤ
h_ne : n ≠ m
h_eq : fract e (n • v) = fract e (m • v)
h_nz : HAdd.hAdd (α := ℚ) (-(↑n : ℚ)) (↑m : ℚ) ≠ 0
refine_1 :
  HSMul.hSMul (α := ℚ) (-(↑n : ℚ)) v + HSMul.hSMul (α := ℚ) (↑m : ℚ) v ∈
    (↑(span ℤ (Set.range (ι := (↑t : Type u_2)) (⇑e : (a : (↑t : Type u_2)) → E))) : Set E)
refine_1₁ :
  -HSMul.hSMul (α := ℚ) (↑n : ℚ) v + HSMul.hSMul (α := ℚ) (↑m : ℚ) v ∈
    (↑(span ℤ (Set.range (ι := (↑t : Type u_2)) (⇑e : (a : (↑t : Type u_2)) → E))) : Set E)
refine_1₂ :
  Membership.mem (γ := Submodule ℤ E) (span ℤ (Set.range (ι := (↑t : Type u_2)) (⇑e : (a : (↑t : Type u_2)) → E)))
    (-HSMul.hSMul (α := ℚ) (↑n : ℚ) v + HSMul.hSMul (α := ℚ) (↑m : ℚ) v)
refine_1₃ : fract e (HSMul.hSMul (α := ℚ) (↑n : ℚ) v) = fract e (HSMul.hSMul (α := ℚ) (↑m : ℚ) v)
refine_1₄ : fract e (n • v) = fract e (HSMul.hSMul (α := ℚ) (↑m : ℚ) v)
refine_1₅ refine_1₆ refine_1₇ refine_1₈ : fract e (n • v) = fract e (m • v)
⊢ HAdd.hAdd (α := ℚ) (-(↑n : ℚ)) (↑m : ℚ) • v ∈
    (↑(span ℤ (Set.range (ι := (↑t : Type u_2)) (⇑e : (a : (↑t : Type u_2)) → E))) : Set E)

Tactic:
rwa [add_smul, neg_smul, SetLike.mem_coe, ← fract_eq_fract, Int.cast_smul_eq_zsmul ℚ,
      Int.cast_smul_eq_zsmul ℚ]

Premises used: neg_smul, Rat, add_smul, SetLike.mem_coe, ZSpan.fract_eq_fract, Int.cast_smul_eq_zsmul
-- Module: Mathlib.Algebra.Module.ZLattice.Basic
Goal:
K : Type u_1
inst : NormedField K
inst_1 : LinearOrder K
inst_2 : IsStrictOrderedRing K
inst_3 : HasSolidNorm K
inst_4 : FloorRing K
E : Type u_2
inst_5 : NormedAddCommGroup E
inst_6 : NormedSpace K E
inst_7 : FiniteDimensional K E
inst_8 : ProperSpace E
L : Submodule ℤ E
inst_9 : DiscreteTopology.{u_2} ↥L
hs : IsZLattice K L
this_1 : Module.Finite.{0, u_2} ℤ ↥L
this_2 : Module ℚ E
this_3 : IsAddTorsionFree E
b₀ : Basis (Free.ChooseBasisIndex ℤ ↥L) ℤ ↥L := Free.chooseBasis ℤ ↥L
b : Free.ChooseBasisIndex ℤ ↥L → E :=
  Function.comp (β := ↥L) (Subtype.val (p := fun (x : E) ↦ x ∈ L)) (⇑b₀ : (a : Free.ChooseBasisIndex ℤ ↥L) → ↥L)
this : LinearIndependent ℤ b
h_spanL : span ℤ (Set.range b) = L
h_spanE : Eq (α := Submodule K E) (span K (Set.range b)) ⊤
h_card : Fintype.card.{u_2} (Free.ChooseBasisIndex ℤ ↥L) = (Set.range b).toFinset.card
refine_2 : finrank.{u_1, u_2} K ↥(span K (Set.range b)) ≤ Fintype.card.{u_2} (Free.ChooseBasisIndex ℤ ↥L)
⊢ finrank K E ≤ Fintype.card.{u_2} (Free.ChooseBasisIndex ℤ ↥L)

Tactic:
rw [← topEquiv.finrank_eq, ← h_spanE]

Premises used: Submodule.topEquiv, LinearEquiv.finrank_eq
-- Module: Mathlib.Algebra.Module.ZLattice.Basic
Goal:
K : Type u_1
inst : NormedField K
inst_1 : LinearOrder K
inst_2 : IsStrictOrderedRing K
inst_3 : HasSolidNorm K
inst_4 : FloorRing K
E : Type u_2
inst_5 : NormedAddCommGroup E
inst_6 : NormedSpace K E
inst_7 : FiniteDimensional K E
inst_8 : ProperSpace E
L : Submodule ℤ E
inst_9 : DiscreteTopology.{u_2} ↥L
hs : IsZLattice K L
this_1 : Module.Finite.{0, u_2} ℤ ↥L
this_2 : Module ℚ E
this_3 : IsAddTorsionFree E
b₀ : Basis (Free.ChooseBasisIndex ℤ ↥L) ℤ ↥L := Free.chooseBasis ℤ ↥L
b : Free.ChooseBasisIndex ℤ ↥L → E :=
  Function.comp (β := ↥L) (Subtype.val (p := fun (x : E) ↦ x ∈ L)) (⇑b₀ : (a : Free.ChooseBasisIndex ℤ ↥L) → ↥L)
this : LinearIndependent ℤ b
h_spanL : span ℤ (Set.range b) = L
h_spanE : Eq (α := Submodule K E) (span K (Set.range b)) ⊤
h_card : Fintype.card.{u_2} (Free.ChooseBasisIndex ℤ ↥L) = (Set.range b).toFinset.card
⊢ finrank.{u_1, u_2} K ↥(span K (Set.range b)) ≤ (Set.range b).toFinset.card

Tactic:
finrank_span_le_card (R := K) (Set.range b)

Premises used: finrank_span_le_card, Set.range
-- Module: Mathlib.Algebra.Module.ZLattice.Basic
Goal:
K : Type u_1
inst : NormedField K
inst_1 : LinearOrder K
inst_2 : IsStrictOrderedRing K
inst_3 : HasSolidNorm K
inst_4 : FloorRing K
E : Type u_2
inst_5 : NormedAddCommGroup E
inst_6 : NormedSpace K E
inst_7 : FiniteDimensional K E
inst_8 : ProperSpace E
L : Submodule ℤ E
inst_9 : DiscreteTopology.{u_2} ↥L
hs : IsZLattice K L
this_1 : Module.Finite.{0, u_2} ℤ ↥L
this_2 : Module ℚ E
this_3 : IsAddTorsionFree E
b₀ : Basis (Free.ChooseBasisIndex ℤ ↥L) ℤ ↥L := Free.chooseBasis ℤ ↥L
b : Free.ChooseBasisIndex ℤ ↥L → E :=
  Function.comp (β := ↥L) (Subtype.val (p := fun (x : E) ↦ x ∈ L)) (⇑b₀ : (a : Free.ChooseBasisIndex ℤ ↥L) → ↥L)
this : LinearIndependent ℤ b
h_spanL : span ℤ (Set.range b) = L
h_spanE : Eq (α := Submodule K E) (span K (Set.range b)) ⊤
h_card : Fintype.card.{u_2} (Free.ChooseBasisIndex ℤ ↥L) = (Set.range b).toFinset.card
⊢ finrank.{u_1, u_2} K ↥(span K (Set.range b)) ≤ Fintype.card.{u_2} (Free.ChooseBasisIndex ℤ ↥L)

Tactic:
convert! finrank_span_le_card (R := K) (Set.range b)

Premises used: finrank_span_le_card, Set.range