Theorem: AddEquiv.isWeaklyRegular_congr
File: Mathlib/RingTheory/Regular/RegularSequence.lean

Proof steps:
state_before: R : Type u_1
S : Type u_2
M : Type u_3
M₂ : Type u_4
M₃ : Type u_5
M₄ : Type u_6
inst✝⁸ : CommRing R
inst✝⁷ : CommRing S
inst✝⁶ : AddCommGroup M
inst✝⁵ : AddCommGroup M₂
inst✝⁴ : Module R M
inst✝³ : Module R M₂
inst✝² : Module S M₂
σ : R →+* S
σ' : S →+* R
inst✝¹ : RingHomInvPair σ σ'
inst✝ : RingHomInvPair σ' σ
e : M ≃+ M₂
as : List R
bs : List S
h : List.Forall₂ (fun r s => ∀ (x : M), e (r • x) = s • e x) as bs
⊢ IsWeaklyRegular M as ↔ IsWeaklyRegular M₂ bs
state_after: R : Type u_1
S : Type u_2
M : Type u_3
M₂ : Type u_4
M₃ : Type u_5
M₄ : Type u_6
inst✝⁸ : CommRing R
inst✝⁷ : CommRing S
inst✝⁶ : AddCommGroup M
inst✝⁵ : AddCommGroup M₂
inst✝⁴ : Module R M
inst✝³ : Module R M₂
inst✝² : Module S M₂
σ : R →+* S
σ' : S →+* R
inst✝¹ : RingHomInvPair σ σ'
inst✝ : RingHomInvPair σ' σ
e : M ≃+ M₂
as : List R
bs : List S
h : List.Forall₂ (fun r s => ∀ (x : M), e (r • x) = s • e x) as bs
⊢ (∀ (i : Fin as.length), IsSMulRegular (M ⧸ Ideal.ofList (List.take (↑i) as) • ⊤) (as.get i)) ↔
    ∀ (i : Fin bs.length), IsSMulRegular (M₂ ⧸ Ideal.ofList (List.take (↑i) bs) • ⊤) (bs.get i)
tactic: conv => congr <;> rw [isWeaklyRegular_iff_Fin]
state_before: R : Type u_1
S : Type u_2
M : Type u_3
M₂ : Type u_4
M₃ : Type u_5
M₄ : Type u_6
inst✝⁸ : CommRing R
inst✝⁷ : CommRing S
inst✝⁶ : AddCommGroup M
inst✝⁵ : AddCommGroup M₂
inst✝⁴ : Module R M
inst✝³ : Module R M₂
inst✝² : Module S M₂
σ : R →+* S
σ' : S →+* R
inst✝¹ : RingHomInvPair σ σ'
inst✝ : RingHomInvPair σ' σ
e : M ≃+ M₂
as : List R
bs : List S
h : List.Forall₂ (fun r s => ∀ (x : M), e (r • x) = s • e x) as bs
⊢ (∀ (i : Fin as.length), IsSMulRegular (M ⧸ Ideal.ofList (List.take (↑i) as) • ⊤) (as.get i)) ↔
    ∀ (i : Fin bs.length), IsSMulRegular (M₂ ⧸ Ideal.ofList (List.take (↑i) bs) • ⊤) (bs.get i)
state_after: R : Type u_1
S : Type u_2
M : Type u_3
M₂ : Type u_4
M₃ : Type u_5
M₄ : Type u_6
inst✝⁸ : CommRing R
inst✝⁷ : CommRing S
inst✝⁶ : AddCommGroup M
inst✝⁵ : AddCommGroup M₂
inst✝⁴ : Module R M
inst✝³ : Module R M₂
inst✝² : Module S M₂
σ : R →+* S
σ' : S →+* R
inst✝¹ : RingHomInvPair σ σ'
inst✝ : RingHomInvPair σ' σ
e : M ≃+ M₂
as : List R
bs : List S
h : List.Forall₂ (fun r s => ∀ (x : M), e (r • x) = s • e x) as bs
e' : (i : ℕ) → M ⧸ Ideal.ofList (List.take i as) • ⊤ ≃+ M₂ ⧸ Ideal.ofList (List.take i bs) • ⊤ :=
  fun i =>
    QuotientAddGroup.congr (Ideal.ofList (List.take i as) • ⊤).toAddSubgroup
      (Ideal.ofList (List.take i bs) • ⊤).toAddSubgroup e ⋯
⊢ (∀ (i : Fin as.length), IsSMulRegular (M ⧸ Ideal.ofList (List.take (↑i) as) • ⊤) (as.get i)) ↔
    ∀ (i : Fin bs.length), IsSMulRegular (M₂ ⧸ Ideal.ofList (List.take (↑i) bs) • ⊤) (bs.get i)
tactic: let e' i : (M ⧸ (Ideal.ofList (as.take i) • ⊤ : Submodule R M)) ≃+
      M₂ ⧸ (Ideal.ofList (bs.take i) • ⊤ : Submodule S M₂) :=
    QuotientAddGroup.congr _ _ e <|
      AddHom.map_smul_top_toAddSubgroup_of_surjective e.surjective <|
        List.forall₂_take i h
state_before: R : Type u_1
S : Type u_2
M : Type u_3
M₂ : Type u_4
M₃ : Type u_5
M₄ : Type u_6
inst✝⁸ : CommRing R
inst✝⁷ : CommRing S
inst✝⁶ : AddCommGroup M
inst✝⁵ : AddCommGroup M₂
inst✝⁴ : Module R M
inst✝³ : Module R M₂
inst✝² : Module S M₂
σ : R →+* S
σ' : S →+* R
inst✝¹ : RingHomInvPair σ σ'
inst✝ : RingHomInvPair σ' σ
e : M ≃+ M₂
as : List R
bs : List S
h : List.Forall₂ (fun r s => ∀ (x : M), e (r • x) = s • e x) as bs
e' : (i : ℕ) → M ⧸ Ideal.ofList (List.take i as) • ⊤ ≃+ M₂ ⧸ Ideal.ofList (List.take i bs) • ⊤ :=
  fun i =>
    QuotientAddGroup.congr (Ideal.ofList (List.take i as) • ⊤).toAddSubgroup
      (Ideal.ofList (List.take i bs) • ⊤).toAddSubgroup e ⋯
⊢ (∀ (i : Fin as.length), IsSMulRegular (M ⧸ Ideal.ofList (List.take (↑i) as) • ⊤) (as.get i)) ↔
    ∀ (i : Fin bs.length), IsSMulRegular (M₂ ⧸ Ideal.ofList (List.take (↑i) bs) • ⊤) (bs.get i)
state_after: R : Type u_1
S : Type u_2
M : Type u_3
M₂ : Type u_4
M₃ : Type u_5
M₄ : Type u_6
inst✝⁸ : CommRing R
inst✝⁷ : CommRing S
inst✝⁶ : AddCommGroup M
inst✝⁵ : AddCommGroup M₂
inst✝⁴ : Module R M
inst✝³ : Module R M₂
inst✝² : Module S M₂
σ : R →+* S
σ' : S →+* R
inst✝¹ : RingHomInvPair σ σ'
inst✝ : RingHomInvPair σ' σ
e : M ≃+ M₂
as : List R
bs : List S
h : List.Forall₂ (fun r s => ∀ (x : M), e (r • x) = s • e x) as bs
e' : (i : ℕ) → M ⧸ Ideal.ofList (List.take i as) • ⊤ ≃+ M₂ ⧸ Ideal.ofList (List.take i bs) • ⊤ :=
  fun i =>
    QuotientAddGroup.congr (Ideal.ofList (List.take i as) • ⊤).toAddSubgroup
      (Ideal.ofList (List.take i bs) • ⊤).toAddSubgroup e ⋯
x✝ : Fin as.length
⊢ ∀ (x : M ⧸ Ideal.ofList (List.take (↑x✝) as) • ⊤),
    (e' ↑x✝).toEquiv (as.get x✝ • x) = bs.get ((finCongr ⋯) x✝) • (e' ↑x✝).toEquiv x
tactic: refine (finCongr h.length_eq).forall_congr @fun _ => (e' _).isSMulRegular_congr ?_
state_before: R : Type u_1
S : Type u_2
M : Type u_3
M₂ : Type u_4
M₃ : Type u_5
M₄ : Type u_6
inst✝⁸ : CommRing R
inst✝⁷ : CommRing S
inst✝⁶ : AddCommGroup M
inst✝⁵ : AddCommGroup M₂
inst✝⁴ : Module R M
inst✝³ : Module R M₂
inst✝² : Module S M₂
σ : R →+* S
σ' : S →+* R
inst✝¹ : RingHomInvPair σ σ'
inst✝ : RingHomInvPair σ' σ
e : M ≃+ M₂
as : List R
bs : List S
h : List.Forall₂ (fun r s => ∀ (x : M), e (r • x) = s • e x) as bs
e' : (i : ℕ) → M ⧸ Ideal.ofList (List.take i as) • ⊤ ≃+ M₂ ⧸ Ideal.ofList (List.take i bs) • ⊤ :=
  fun i =>
    QuotientAddGroup.congr (Ideal.ofList (List.take i as) • ⊤).toAddSubgroup
      (Ideal.ofList (List.take i bs) • ⊤).toAddSubgroup e ⋯
x✝ : Fin as.length
⊢ ∀ (x : M ⧸ Ideal.ofList (List.take (↑x✝) as) • ⊤),
    (e' ↑x✝).toEquiv (as.get x✝ • x) = bs.get ((finCongr ⋯) x✝) • (e' ↑x✝).toEquiv x
state_after: no goals
tactic: exact (mkQ_surjective _).forall.mpr fun _ => congrArg (mkQ _) (h.get _ _ _)