l3lab/ntp-mathlib huggingface dataset:
/-- Even though the roots may not span, coroots are distinguished by their pairing with the
roots. The proof depends crucially on the fact that there are finitely-many roots.

Modulo trivial generalisations, this statement is exactly Lemma 1.1.4 on page 87 of SGA 3 XXI.
See also `RootPairing.injOn_dualMap_subtype_span_root_coroot` for a more useful restatement. -/
lemma eq_of_forall_coroot_root_eq [NoZeroSMulDivisors ℤ M] (i j : ι)
    (h : ∀ k, P.toLin (P.root k) (P.coroot i) = P.toLin (P.root k) (P.coroot j)) :
    i = j := by
  set α := P.root i
  set β := P.root j
  set sα : M ≃ₗ[R] M := P.reflection i
  set sβ : M ≃ₗ[R] M := P.reflection j
  set sαβ : M ≃ₗ[R] M := sβ.trans sα
  have hα : sα β = β - (2 : R) • α := by rw [P.reflection_apply, h j, P.root_coroot_two j]
  have hβ : sβ α = α - (2 : R) • β := by 

Proof state:
ι : Type u_1
R : Type u_2
M : Type u_3
N : Type u_4
inst✝⁶ : _root_.Finite ι
inst✝⁵ : CommRing R
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : AddCommGroup N
inst✝¹ : Module R N
P : RootPairing ι R M N
i✝ : ι
inst✝ : NoZeroSMulDivisors ℤ M
i j : ι
h : ∀ (k : ι), (P.toLin (P.root k)) (P.coroot i) = (P.toLin (P.root k)) (P.coroot j)
α : M := P.root i
β : M := P.root j
sα : M ≃ₗ[R] M := reflection P i
sβ : M ≃ₗ[R] M := reflection P j
sαβ : M ≃ₗ[R] M := sβ ≪≫ₗ sα
hα : sα β = β - 2 • α
⊢ sβ α = α - 2 • β

Next tactic:
rw [P.reflection_apply, ← h i, P.root_coroot_two i]
/-- Even though the roots may not span, coroots are distinguished by their pairing with the
roots. The proof depends crucially on the fact that there are finitely-many roots.

Modulo trivial generalisations, this statement is exactly Lemma 1.1.4 on page 87 of SGA 3 XXI.
See also `RootPairing.injOn_dualMap_subtype_span_root_coroot` for a more useful restatement. -/
lemma eq_of_forall_coroot_root_eq [NoZeroSMulDivisors ℤ M] (i j : ι)
    (h : ∀ k, P.toLin (P.root k) (P.coroot i) = P.toLin (P.root k) (P.coroot j)) :
    i = j := by
  set α := P.root i
  set β := P.root j
  set sα : M ≃ₗ[R] M := P.reflection i
  set sβ : M ≃ₗ[R] M := P.reflection j
  set sαβ : M ≃ₗ[R] M := sβ.trans sα
  have hα : sα β = β - (2 : R) • α := by rw [P.reflection_apply, h j, P.root_coroot_two j]
  have hβ : sβ α = α - (2 : R) • β := by rw [P.reflection_apply, ← h i, P.root_coroot_two i]
  

Proof state:
ι : Type u_1
R : Type u_2
M : Type u_3
N : Type u_4
inst✝⁶ : _root_.Finite ι
inst✝⁵ : CommRing R
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : AddCommGroup N
inst✝¹ : Module R N
P : RootPairing ι R M N
i✝ : ι
inst✝ : NoZeroSMulDivisors ℤ M
i j : ι
h : ∀ (k : ι), (P.toLin (P.root k)) (P.coroot i) = (P.toLin (P.root k)) (P.coroot j)
α : M := P.root i
β : M := P.root j
sα : M ≃ₗ[R] M := reflection P i
sβ : M ≃ₗ[R] M := reflection P j
sαβ : M ≃ₗ[R] M := sβ ≪≫ₗ sα
hα : sα β = β - 2 • α
hβ : sβ α = α - 2 • β
⊢ i = j

Next tactic:
have hb : BijOn sαβ (range P.root) (range P.root) :=
    (P.bijOn_reflection_root i).comp (P.bijOn_reflection_root j)
/-- Even though the roots may not span, coroots are distinguished by their pairing with the
roots. The proof depends crucially on the fact that there are finitely-many roots.

Modulo trivial generalisations, this statement is exactly Lemma 1.1.4 on page 87 of SGA 3 XXI.
See also `RootPairing.injOn_dualMap_subtype_span_root_coroot` for a more useful restatement. -/
lemma eq_of_forall_coroot_root_eq [NoZeroSMulDivisors ℤ M] (i j : ι)
    (h : ∀ k, P.toLin (P.root k) (P.coroot i) = P.toLin (P.root k) (P.coroot j)) :
    i = j := by
  set α := P.root i
  set β := P.root j
  set sα : M ≃ₗ[R] M := P.reflection i
  set sβ : M ≃ₗ[R] M := P.reflection j
  set sαβ : M ≃ₗ[R] M := sβ.trans sα
  have hα : sα β = β - (2 : R) • α := by rw [P.reflection_apply, h j, P.root_coroot_two j]
  have hβ : sβ α = α - (2 : R) • β := by rw [P.reflection_apply, ← h i, P.root_coroot_two i]
  have hb : BijOn sαβ (range P.root) (range P.root) :=
    (P.bijOn_reflection_root i).comp (P.bijOn_reflection_root j)
  

Proof state:
ι : Type u_1
R : Type u_2
M : Type u_3
N : Type u_4
inst✝⁶ : _root_.Finite ι
inst✝⁵ : CommRing R
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : AddCommGroup N
inst✝¹ : Module R N
P : RootPairing ι R M N
i✝ : ι
inst✝ : NoZeroSMulDivisors ℤ M
i j : ι
h : ∀ (k : ι), (P.toLin (P.root k)) (P.coroot i) = (P.toLin (P.root k)) (P.coroot j)
α : M := P.root i
β : M := P.root j
sα : M ≃ₗ[R] M := reflection P i
sβ : M ≃ₗ[R] M := reflection P j
sαβ : M ≃ₗ[R] M := sβ ≪≫ₗ sα
hα : sα β = β - 2 • α
hβ : sβ α = α - 2 • β
hb : BijOn (⇑sαβ) (range ⇑P.root) (range ⇑P.root)
⊢ i = j

Next tactic:
set f : ℕ → M := fun n ↦ β + (2 * n : ℤ) • (α - β)
/-- Even though the roots may not span, coroots are distinguished by their pairing with the
roots. The proof depends crucially on the fact that there are finitely-many roots.

Modulo trivial generalisations, this statement is exactly Lemma 1.1.4 on page 87 of SGA 3 XXI.
See also `RootPairing.injOn_dualMap_subtype_span_root_coroot` for a more useful restatement. -/
lemma eq_of_forall_coroot_root_eq [NoZeroSMulDivisors ℤ M] (i j : ι)
    (h : ∀ k, P.toLin (P.root k) (P.coroot i) = P.toLin (P.root k) (P.coroot j)) :
    i = j := by
  set α := P.root i
  set β := P.root j
  set sα : M ≃ₗ[R] M := P.reflection i
  set sβ : M ≃ₗ[R] M := P.reflection j
  set sαβ : M ≃ₗ[R] M := sβ.trans sα
  have hα : sα β = β - (2 : R) • α := by rw [P.reflection_apply, h j, P.root_coroot_two j]
  have hβ : sβ α = α - (2 : R) • β := by rw [P.reflection_apply, ← h i, P.root_coroot_two i]
  have hb : BijOn sαβ (range P.root) (range P.root) :=
    (P.bijOn_reflection_root i).comp (P.bijOn_reflection_root j)
  set f : ℕ → M := fun n ↦ β + (2 * n : ℤ) • (α - β)
  

Proof state:
ι : Type u_1
R : Type u_2
M : Type u_3
N : Type u_4
inst✝⁶ : _root_.Finite ι
inst✝⁵ : CommRing R
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : AddCommGroup N
inst✝¹ : Module R N
P : RootPairing ι R M N
i✝ : ι
inst✝ : NoZeroSMulDivisors ℤ M
i j : ι
h : ∀ (k : ι), (P.toLin (P.root k)) (P.coroot i) = (P.toLin (P.root k)) (P.coroot j)
α : M := P.root i
β : M := P.root j
sα : M ≃ₗ[R] M := reflection P i
sβ : M ≃ₗ[R] M := reflection P j
sαβ : M ≃ₗ[R] M := sβ ≪≫ₗ sα
hα : sα β = β - 2 • α
hβ : sβ α = α - 2 • β
hb : BijOn (⇑sαβ) (range ⇑P.root) (range ⇑P.root)
f : ℕ → M := fun n => β + (2 * ↑n) • (α - β)
⊢ i = j

Next tactic:
have hf : ∀ n : ℕ, (sαβ^[n]) β = f n := by
    intro n
    induction' n with n ih; simp
    simp only [iterate_succ', ih, hα, hβ, two_smul, smul_add, mul_add, add_smul, comp_apply,
      map_zsmul, zsmul_sub, map_add, neg_sub, map_neg, smul_neg, map_sub, Nat.cast_succ, mul_one,
      LinearEquiv.trans_apply, reflection_apply_self]
    abel
/-- Even though the roots may not span, coroots are distinguished by their pairing with the
roots. The proof depends crucially on the fact that there are finitely-many roots.

Modulo trivial generalisations, this statement is exactly Lemma 1.1.4 on page 87 of SGA 3 XXI.
See also `RootPairing.injOn_dualMap_subtype_span_root_coroot` for a more useful restatement. -/
lemma eq_of_forall_coroot_root_eq [NoZeroSMulDivisors ℤ M] (i j : ι)
    (h : ∀ k, P.toLin (P.root k) (P.coroot i) = P.toLin (P.root k) (P.coroot j)) :
    i = j := by
  set α := P.root i
  set β := P.root j
  set sα : M ≃ₗ[R] M := P.reflection i
  set sβ : M ≃ₗ[R] M := P.reflection j
  set sαβ : M ≃ₗ[R] M := sβ.trans sα
  have hα : sα β = β - (2 : R) • α := by rw [P.reflection_apply, h j, P.root_coroot_two j]
  have hβ : sβ α = α - (2 : R) • β := by rw [P.reflection_apply, ← h i, P.root_coroot_two i]
  have hb : BijOn sαβ (range P.root) (range P.root) :=
    (P.bijOn_reflection_root i).comp (P.bijOn_reflection_root j)
  set f : ℕ → M := fun n ↦ β + (2 * n : ℤ) • (α - β)
  have hf : ∀ n : ℕ, (sαβ^[n]) β = f n := by
    

Proof state:
ι : Type u_1
R : Type u_2
M : Type u_3
N : Type u_4
inst✝⁶ : _root_.Finite ι
inst✝⁵ : CommRing R
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : AddCommGroup N
inst✝¹ : Module R N
P : RootPairing ι R M N
i✝ : ι
inst✝ : NoZeroSMulDivisors ℤ M
i j : ι
h : ∀ (k : ι), (P.toLin (P.root k)) (P.coroot i) = (P.toLin (P.root k)) (P.coroot j)
α : M := P.root i
β : M := P.root j
sα : M ≃ₗ[R] M := reflection P i
sβ : M ≃ₗ[R] M := reflection P j
sαβ : M ≃ₗ[R] M := sβ ≪≫ₗ sα
hα : sα β = β - 2 • α
hβ : sβ α = α - 2 • β
hb : BijOn (⇑sαβ) (range ⇑P.root) (range ⇑P.root)
f : ℕ → M := fun n => β + (2 * ↑n) • (α - β)
⊢ ∀ (n : ℕ), (⇑sαβ)^[n] β = f n

Next tactic:
intro n
/-- Even though the roots may not span, coroots are distinguished by their pairing with the
roots. The proof depends crucially on the fact that there are finitely-many roots.

Modulo trivial generalisations, this statement is exactly Lemma 1.1.4 on page 87 of SGA 3 XXI.
See also `RootPairing.injOn_dualMap_subtype_span_root_coroot` for a more useful restatement. -/
lemma eq_of_forall_coroot_root_eq [NoZeroSMulDivisors ℤ M] (i j : ι)
    (h : ∀ k, P.toLin (P.root k) (P.coroot i) = P.toLin (P.root k) (P.coroot j)) :
    i = j := by
  set α := P.root i
  set β := P.root j
  set sα : M ≃ₗ[R] M := P.reflection i
  set sβ : M ≃ₗ[R] M := P.reflection j
  set sαβ : M ≃ₗ[R] M := sβ.trans sα
  have hα : sα β = β - (2 : R) • α := by rw [P.reflection_apply, h j, P.root_coroot_two j]
  have hβ : sβ α = α - (2 : R) • β := by rw [P.reflection_apply, ← h i, P.root_coroot_two i]
  have hb : BijOn sαβ (range P.root) (range P.root) :=
    (P.bijOn_reflection_root i).comp (P.bijOn_reflection_root j)
  set f : ℕ → M := fun n ↦ β + (2 * n : ℤ) • (α - β)
  have hf : ∀ n : ℕ, (sαβ^[n]) β = f n := by
    intro n
    

Proof state:
ι : Type u_1
R : Type u_2
M : Type u_3
N : Type u_4
inst✝⁶ : _root_.Finite ι
inst✝⁵ : CommRing R
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : AddCommGroup N
inst✝¹ : Module R N
P : RootPairing ι R M N
i✝ : ι
inst✝ : NoZeroSMulDivisors ℤ M
i j : ι
h : ∀ (k : ι), (P.toLin (P.root k)) (P.coroot i) = (P.toLin (P.root k)) (P.coroot j)
α : M := P.root i
β : M := P.root j
sα : M ≃ₗ[R] M := reflection P i
sβ : M ≃ₗ[R] M := reflection P j
sαβ : M ≃ₗ[R] M := sβ ≪≫ₗ sα
hα : sα β = β - 2 • α
hβ : sβ α = α - 2 • β
hb : BijOn (⇑sαβ) (range ⇑P.root) (range ⇑P.root)
f : ℕ → M := fun n => β + (2 * ↑n) • (α - β)
n : ℕ
⊢ (⇑sαβ)^[n] β = f n

Next tactic:
induction' n with n ih
/-- Even though the roots may not span, coroots are distinguished by their pairing with the
roots. The proof depends crucially on the fact that there are finitely-many roots.

Modulo trivial generalisations, this statement is exactly Lemma 1.1.4 on page 87 of SGA 3 XXI.
See also `RootPairing.injOn_dualMap_subtype_span_root_coroot` for a more useful restatement. -/
lemma eq_of_forall_coroot_root_eq [NoZeroSMulDivisors ℤ M] (i j : ι)
    (h : ∀ k, P.toLin (P.root k) (P.coroot i) = P.toLin (P.root k) (P.coroot j)) :
    i = j := by
  set α := P.root i
  set β := P.root j
  set sα : M ≃ₗ[R] M := P.reflection i
  set sβ : M ≃ₗ[R] M := P.reflection j
  set sαβ : M ≃ₗ[R] M := sβ.trans sα
  have hα : sα β = β - (2 : R) • α := by rw [P.reflection_apply, h j, P.root_coroot_two j]
  have hβ : sβ α = α - (2 : R) • β := by rw [P.reflection_apply, ← h i, P.root_coroot_two i]
  have hb : BijOn sαβ (range P.root) (range P.root) :=
    (P.bijOn_reflection_root i).comp (P.bijOn_reflection_root j)
  set f : ℕ → M := fun n ↦ β + (2 * n : ℤ) • (α - β)
  have hf : ∀ n : ℕ, (sαβ^[n]) β = f n := by
    intro n
    induction' n with n ih; 

Proof state:
case zero
ι : Type u_1
R : Type u_2
M : Type u_3
N : Type u_4
inst✝⁶ : _root_.Finite ι
inst✝⁵ : CommRing R
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : AddCommGroup N
inst✝¹ : Module R N
P : RootPairing ι R M N
i✝ : ι
inst✝ : NoZeroSMulDivisors ℤ M
i j : ι
h : ∀ (k : ι), (P.toLin (P.root k)) (P.coroot i) = (P.toLin (P.root k)) (P.coroot j)
α : M := P.root i
β : M := P.root j
sα : M ≃ₗ[R] M := reflection P i
sβ : M ≃ₗ[R] M := reflection P j
sαβ : M ≃ₗ[R] M := sβ ≪≫ₗ sα
hα : sα β = β - 2 • α
hβ : sβ α = α - 2 • β
hb : BijOn (⇑sαβ) (range ⇑P.root) (range ⇑P.root)
f : ℕ → M := fun n => β + (2 * ↑n) • (α - β)
⊢ (⇑sαβ)^[Nat.zero] β = f Nat.zero
case succ
ι : Type u_1
R : Type u_2
M : Type u_3
N : Type u_4
inst✝⁶ : _root_.Finite ι
inst✝⁵ : CommRing R
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : AddCommGroup N
inst✝¹ : Module R N
P : RootPairing ι R M N
i✝ : ι
inst✝ : NoZeroSMulDivisors ℤ M
i j : ι
h : ∀ (k : ι), (P.toLin (P.root k)) (P.coroot i) = (P.toLin (P.root k)) (P.coroot j)
α : M := P.root i
β : M := P.root j
sα : M ≃ₗ[R] M := reflection P i
sβ : M ≃ₗ[R] M := reflection P j
sαβ : M ≃ₗ[R] M := sβ ≪≫ₗ sα
hα : sα β = β - 2 • α
hβ : sβ α = α - 2 • β
hb : BijOn (⇑sαβ) (range ⇑P.root) (range ⇑P.root)
f : ℕ → M := fun n => β + (2 * ↑n) • (α - β)
n : ℕ
ih : (⇑sαβ)^[n] β = f n
⊢ (⇑sαβ)^[Nat.succ n] β = f (Nat.succ n)

Next tactic:
simp
/-- Even though the roots may not span, coroots are distinguished by their pairing with the
roots. The proof depends crucially on the fact that there are finitely-many roots.

Modulo trivial generalisations, this statement is exactly Lemma 1.1.4 on page 87 of SGA 3 XXI.
See also `RootPairing.injOn_dualMap_subtype_span_root_coroot` for a more useful restatement. -/
lemma eq_of_forall_coroot_root_eq [NoZeroSMulDivisors ℤ M] (i j : ι)
    (h : ∀ k, P.toLin (P.root k) (P.coroot i) = P.toLin (P.root k) (P.coroot j)) :
    i = j := by
  set α := P.root i
  set β := P.root j
  set sα : M ≃ₗ[R] M := P.reflection i
  set sβ : M ≃ₗ[R] M := P.reflection j
  set sαβ : M ≃ₗ[R] M := sβ.trans sα
  have hα : sα β = β - (2 : R) • α := by rw [P.reflection_apply, h j, P.root_coroot_two j]
  have hβ : sβ α = α - (2 : R) • β := by rw [P.reflection_apply, ← h i, P.root_coroot_two i]
  have hb : BijOn sαβ (range P.root) (range P.root) :=
    (P.bijOn_reflection_root i).comp (P.bijOn_reflection_root j)
  set f : ℕ → M := fun n ↦ β + (2 * n : ℤ) • (α - β)
  have hf : ∀ n : ℕ, (sαβ^[n]) β = f n := by
    intro n
    induction' n with n ih; simp
    

Proof state:
case succ
ι : Type u_1
R : Type u_2
M : Type u_3
N : Type u_4
inst✝⁶ : _root_.Finite ι
inst✝⁵ : CommRing R
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : AddCommGroup N
inst✝¹ : Module R N
P : RootPairing ι R M N
i✝ : ι
inst✝ : NoZeroSMulDivisors ℤ M
i j : ι
h : ∀ (k : ι), (P.toLin (P.root k)) (P.coroot i) = (P.toLin (P.root k)) (P.coroot j)
α : M := P.root i
β : M := P.root j
sα : M ≃ₗ[R] M := reflection P i
sβ : M ≃ₗ[R] M := reflection P j
sαβ : M ≃ₗ[R] M := sβ ≪≫ₗ sα
hα : sα β = β - 2 • α
hβ : sβ α = α - 2 • β
hb : BijOn (⇑sαβ) (range ⇑P.root) (range ⇑P.root)
f : ℕ → M := fun n => β + (2 * ↑n) • (α - β)
n : ℕ
ih : (⇑sαβ)^[n] β = f n
⊢ (⇑sαβ)^[Nat.succ n] β = f (Nat.succ n)

Next tactic:
simp only [iterate_succ', ih, hα, hβ, two_smul, smul_add, mul_add, add_smul, comp_apply,
      map_zsmul, zsmul_sub, map_add, neg_sub, map_neg, smul_neg, map_sub, Nat.cast_succ, mul_one,
      LinearEquiv.trans_apply, reflection_apply_self]
/-- Even though the roots may not span, coroots are distinguished by their pairing with the
roots. The proof depends crucially on the fact that there are finitely-many roots.

Modulo trivial generalisations, this statement is exactly Lemma 1.1.4 on page 87 of SGA 3 XXI.
See also `RootPairing.injOn_dualMap_subtype_span_root_coroot` for a more useful restatement. -/
lemma eq_of_forall_coroot_root_eq [NoZeroSMulDivisors ℤ M] (i j : ι)
    (h : ∀ k, P.toLin (P.root k) (P.coroot i) = P.toLin (P.root k) (P.coroot j)) :
    i = j := by
  set α := P.root i
  set β := P.root j
  set sα : M ≃ₗ[R] M := P.reflection i
  set sβ : M ≃ₗ[R] M := P.reflection j
  set sαβ : M ≃ₗ[R] M := sβ.trans sα
  have hα : sα β = β - (2 : R) • α := by rw [P.reflection_apply, h j, P.root_coroot_two j]
  have hβ : sβ α = α - (2 : R) • β := by rw [P.reflection_apply, ← h i, P.root_coroot_two i]
  have hb : BijOn sαβ (range P.root) (range P.root) :=
    (P.bijOn_reflection_root i).comp (P.bijOn_reflection_root j)
  set f : ℕ → M := fun n ↦ β + (2 * n : ℤ) • (α - β)
  have hf : ∀ n : ℕ, (sαβ^[n]) β = f n := by
    intro n
    induction' n with n ih; simp
    simp only [iterate_succ', ih, hα, hβ, two_smul, smul_add, mul_add, add_smul, comp_apply,
      map_zsmul, zsmul_sub, map_add, neg_sub, map_neg, smul_neg, map_sub, Nat.cast_succ, mul_one,
      LinearEquiv.trans_apply, reflection_apply_self]
    

Proof state:
case succ
ι : Type u_1
R : Type u_2
M : Type u_3
N : Type u_4
inst✝⁶ : _root_.Finite ι
inst✝⁵ : CommRing R
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : AddCommGroup N
inst✝¹ : Module R N
P : RootPairing ι R M N
i✝ : ι
inst✝ : NoZeroSMulDivisors ℤ M
i j : ι
h : ∀ (k : ι), (P.toLin (P.root k)) (P.coroot i) = (P.toLin (P.root k)) (P.coroot j)
α : M := P.root i
β : M := P.root j
sα : M ≃ₗ[R] M := reflection P i
sβ : M ≃ₗ[R] M := reflection P j
sαβ : M ≃ₗ[R] M := sβ ≪≫ₗ sα
hα : sα β = β - 2 • α
hβ : sβ α = α - 2 • β
hb : BijOn (⇑sαβ) (range ⇑P.root) (range ⇑P.root)
f : ℕ → M := fun n => β + (2 * ↑n) • (α - β)
n : ℕ
ih : (⇑sαβ)^[n] β = f n
⊢ P.root i + P.root i - P.root j +
      (-((2 * ↑n) • P.root i) -
          ((2 * ↑n) • P.root j - ((2 * ↑n) • P.root i + (2 * ↑n) • P.root i) +
            ((2 * ↑n) • P.root j - ((2 * ↑n) • P.root i + (2 * ↑n) • P.root i))) -
        ((2 * ↑n) • P.root i + (2 * ↑n) • P.root i - (2 * ↑n) • P.root j)) =
    P.root j + ((2 * ↑n) • P.root i + (P.root i + P.root i) - ((2 * ↑n) • P.root j + (P.root j + P.root j)))

Next tactic:
abel
/-- Even though the roots may not span, coroots are distinguished by their pairing with the
roots. The proof depends crucially on the fact that there are finitely-many roots.

Modulo trivial generalisations, this statement is exactly Lemma 1.1.4 on page 87 of SGA 3 XXI.
See also `RootPairing.injOn_dualMap_subtype_span_root_coroot` for a more useful restatement. -/
lemma eq_of_forall_coroot_root_eq [NoZeroSMulDivisors ℤ M] (i j : ι)
    (h : ∀ k, P.toLin (P.root k) (P.coroot i) = P.toLin (P.root k) (P.coroot j)) :
    i = j := by
  set α := P.root i
  set β := P.root j
  set sα : M ≃ₗ[R] M := P.reflection i
  set sβ : M ≃ₗ[R] M := P.reflection j
  set sαβ : M ≃ₗ[R] M := sβ.trans sα
  have hα : sα β = β - (2 : R) • α := by rw [P.reflection_apply, h j, P.root_coroot_two j]
  have hβ : sβ α = α - (2 : R) • β := by rw [P.reflection_apply, ← h i, P.root_coroot_two i]
  have hb : BijOn sαβ (range P.root) (range P.root) :=
    (P.bijOn_reflection_root i).comp (P.bijOn_reflection_root j)
  set f : ℕ → M := fun n ↦ β + (2 * n : ℤ) • (α - β)
  have hf : ∀ n : ℕ, (sαβ^[n]) β = f n := by
    intro n
    induction' n with n ih; simp
    simp only [iterate_succ', ih, hα, hβ, two_smul, smul_add, mul_add, add_smul, comp_apply,
      map_zsmul, zsmul_sub, map_add, neg_sub, map_neg, smul_neg, map_sub, Nat.cast_succ, mul_one,
      LinearEquiv.trans_apply, reflection_apply_self]
    abel
  

Proof state:
ι : Type u_1
R : Type u_2
M : Type u_3
N : Type u_4
inst✝⁶ : _root_.Finite ι
inst✝⁵ : CommRing R
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : AddCommGroup N
inst✝¹ : Module R N
P : RootPairing ι R M N
i✝ : ι
inst✝ : NoZeroSMulDivisors ℤ M
i j : ι
h : ∀ (k : ι), (P.toLin (P.root k)) (P.coroot i) = (P.toLin (P.root k)) (P.coroot j)
α : M := P.root i
β : M := P.root j
sα : M ≃ₗ[R] M := reflection P i
sβ : M ≃ₗ[R] M := reflection P j
sαβ : M ≃ₗ[R] M := sβ ≪≫ₗ sα
hα : sα β = β - 2 • α
hβ : sβ α = α - 2 • β
hb : BijOn (⇑sαβ) (range ⇑P.root) (range ⇑P.root)
f : ℕ → M := fun n => β + (2 * ↑n) • (α - β)
hf : ∀ (n : ℕ), (⇑sαβ)^[n] β = f n
⊢ i = j

Next tactic:
set f' : ℕ → range P.root := fun n ↦ ⟨f n, by
    rw [← IsFixedPt.image_iterate hb.image_eq n, ← hf]; exact mem_image_of_mem _ (mem_range_self j)⟩
/-- Even though the roots may not span, coroots are distinguished by their pairing with the
roots. The proof depends crucially on the fact that there are finitely-many roots.

Modulo trivial generalisations, this statement is exactly Lemma 1.1.4 on page 87 of SGA 3 XXI.
See also `RootPairing.injOn_dualMap_subtype_span_root_coroot` for a more useful restatement. -/
lemma eq_of_forall_coroot_root_eq [NoZeroSMulDivisors ℤ M] (i j : ι)
    (h : ∀ k, P.toLin (P.root k) (P.coroot i) = P.toLin (P.root k) (P.coroot j)) :
    i = j := by
  set α := P.root i
  set β := P.root j
  set sα : M ≃ₗ[R] M := P.reflection i
  set sβ : M ≃ₗ[R] M := P.reflection j
  set sαβ : M ≃ₗ[R] M := sβ.trans sα
  have hα : sα β = β - (2 : R) • α := by rw [P.reflection_apply, h j, P.root_coroot_two j]
  have hβ : sβ α = α - (2 : R) • β := by rw [P.reflection_apply, ← h i, P.root_coroot_two i]
  have hb : BijOn sαβ (range P.root) (range P.root) :=
    (P.bijOn_reflection_root i).comp (P.bijOn_reflection_root j)
  set f : ℕ → M := fun n ↦ β + (2 * n : ℤ) • (α - β)
  have hf : ∀ n : ℕ, (sαβ^[n]) β = f n := by
    intro n
    induction' n with n ih; simp
    simp only [iterate_succ', ih, hα, hβ, two_smul, smul_add, mul_add, add_smul, comp_apply,
      map_zsmul, zsmul_sub, map_add, neg_sub, map_neg, smul_neg, map_sub, Nat.cast_succ, mul_one,
      LinearEquiv.trans_apply, reflection_apply_self]
    abel
  set f' : ℕ → range P.root := fun n ↦ ⟨f n, by
    

Proof state:
ι : Type u_1
R : Type u_2
M : Type u_3
N : Type u_4
inst✝⁶ : _root_.Finite ι
inst✝⁵ : CommRing R
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : AddCommGroup N
inst✝¹ : Module R N
P : RootPairing ι R M N
i✝ : ι
inst✝ : NoZeroSMulDivisors ℤ M
i j : ι
h : ∀ (k : ι), (P.toLin (P.root k)) (P.coroot i) = (P.toLin (P.root k)) (P.coroot j)
α : M := P.root i
β : M := P.root j
sα : M ≃ₗ[R] M := reflection P i
sβ : M ≃ₗ[R] M := reflection P j
sαβ : M ≃ₗ[R] M := sβ ≪≫ₗ sα
hα : sα β = β - 2 • α
hβ : sβ α = α - 2 • β
hb : BijOn (⇑sαβ) (range ⇑P.root) (range ⇑P.root)
f : ℕ → M := fun n => β + (2 * ↑n) • (α - β)
hf : ∀ (n : ℕ), (⇑sαβ)^[n] β = f n
n : ℕ
⊢ f n ∈ range ⇑P.root

Next tactic:
rw [← IsFixedPt.image_iterate hb.image_eq n, ← hf]
/-- Even though the roots may not span, coroots are distinguished by their pairing with the
roots. The proof depends crucially on the fact that there are finitely-many roots.

Modulo trivial generalisations, this statement is exactly Lemma 1.1.4 on page 87 of SGA 3 XXI.
See also `RootPairing.injOn_dualMap_subtype_span_root_coroot` for a more useful restatement. -/
lemma eq_of_forall_coroot_root_eq [NoZeroSMulDivisors ℤ M] (i j : ι)
    (h : ∀ k, P.toLin (P.root k) (P.coroot i) = P.toLin (P.root k) (P.coroot j)) :
    i = j := by
  set α := P.root i
  set β := P.root j
  set sα : M ≃ₗ[R] M := P.reflection i
  set sβ : M ≃ₗ[R] M := P.reflection j
  set sαβ : M ≃ₗ[R] M := sβ.trans sα
  have hα : sα β = β - (2 : R) • α := by rw [P.reflection_apply, h j, P.root_coroot_two j]
  have hβ : sβ α = α - (2 : R) • β := by rw [P.reflection_apply, ← h i, P.root_coroot_two i]
  have hb : BijOn sαβ (range P.root) (range P.root) :=
    (P.bijOn_reflection_root i).comp (P.bijOn_reflection_root j)
  set f : ℕ → M := fun n ↦ β + (2 * n : ℤ) • (α - β)
  have hf : ∀ n : ℕ, (sαβ^[n]) β = f n := by
    intro n
    induction' n with n ih; simp
    simp only [iterate_succ', ih, hα, hβ, two_smul, smul_add, mul_add, add_smul, comp_apply,
      map_zsmul, zsmul_sub, map_add, neg_sub, map_neg, smul_neg, map_sub, Nat.cast_succ, mul_one,
      LinearEquiv.trans_apply, reflection_apply_self]
    abel
  set f' : ℕ → range P.root := fun n ↦ ⟨f n, by
    rw [← IsFixedPt.image_iterate hb.image_eq n, ← hf]; 

Proof state:
ι : Type u_1
R : Type u_2
M : Type u_3
N : Type u_4
inst✝⁶ : _root_.Finite ι
inst✝⁵ : CommRing R
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : AddCommGroup N
inst✝¹ : Module R N
P : RootPairing ι R M N
i✝ : ι
inst✝ : NoZeroSMulDivisors ℤ M
i j : ι
h : ∀ (k : ι), (P.toLin (P.root k)) (P.coroot i) = (P.toLin (P.root k)) (P.coroot j)
α : M := P.root i
β : M := P.root j
sα : M ≃ₗ[R] M := reflection P i
sβ : M ≃ₗ[R] M := reflection P j
sαβ : M ≃ₗ[R] M := sβ ≪≫ₗ sα
hα : sα β = β - 2 • α
hβ : sβ α = α - 2 • β
hb : BijOn (⇑sαβ) (range ⇑P.root) (range ⇑P.root)
f : ℕ → M := fun n => β + (2 * ↑n) • (α - β)
hf : ∀ (n : ℕ), (⇑sαβ)^[n] β = f n
n : ℕ
⊢ (⇑sαβ)^[n] β ∈ (⇑sαβ)^[n] '' range ⇑P.root

Next tactic:
exact mem_image_of_mem _ (mem_range_self j)