l3lab/ntp-mathlib huggingface dataset:
@[to_additive (attr := simp)]
theorem noncommPiCoprod_mulSingle (i : ι) (y : N i) :
    noncommPiCoprod ϕ hcomm (Pi.mulSingle i y) = ϕ i y := by
  change Finset.univ.noncommProd (fun j => ϕ j (Pi.mulSingle i y j)) (fun _ _ _ _ h => hcomm h _ _)
    = ϕ i y
  simp (config := { singlePass := true }) only [← Finset.insert_erase (Finset.mem_univ i)]
  rw [Finset.noncommProd_insert_of_not_mem _ _ _ _ (Finset.not_mem_erase i _)]
  rw [Pi.mulSingle_eq_same]
  rw [Finset.noncommProd_eq_pow_card]
  · rw [one_pow]
    exact mul_one _
  · intro j hj
    simp only [Finset.mem_erase] at hj
    

Proof state:
case h
M : Type u_1
inst✝² : Monoid M
ι : Type u_2
hdec : DecidableEq ι
inst✝¹ : Fintype ι
N : ι → Type u_3
inst✝ : (i : ι) → Monoid (N i)
ϕ : (i : ι) → N i →* M
hcomm : Pairwise fun i j => ∀ (x : N i) (y : N j), Commute ((ϕ i) x) ((ϕ j) y)
f g : (i : ι) → N i
i : ι
y : N i
j : ι
hj : j ≠ i ∧ j ∈ Finset.univ
⊢ (ϕ j) (Pi.mulSingle i y j) = 1

Next tactic:
simp [hj]
/-- The universal property of `MonoidHom.noncommPiCoprod` -/
@[to_additive "The universal property of `AddMonoidHom.noncommPiCoprod`"]
def noncommPiCoprodEquiv :
    { ϕ : ∀ i, N i →* M // Pairwise fun i j => ∀ x y, Commute (ϕ i x) (ϕ j y) } ≃ ((∀ i, N i) →* M)
    where
  toFun ϕ := noncommPiCoprod ϕ.1 ϕ.2
  invFun f :=
    ⟨fun i => f.comp (MonoidHom.single N i), fun i j hij x y =>
      Commute.map (Pi.mulSingle_commute hij x y) f⟩
  left_inv ϕ := by
    

Proof state:
M : Type u_1
inst✝² : Monoid M
ι : Type u_2
hdec : DecidableEq ι
inst✝¹ : Fintype ι
N : ι → Type u_3
inst✝ : (i : ι) → Monoid (N i)
ϕ✝ : (i : ι) → N i →* M
hcomm : Pairwise fun i j => ∀ (x : N i) (y : N j), Commute ((ϕ✝ i) x) ((ϕ✝ j) y)
f g : (i : ι) → N i
ϕ : { ϕ // Pairwise fun i j => ∀ (x : N i) (y : N j), Commute ((ϕ i) x) ((ϕ j) y) }
⊢ (fun f =>
        { val := fun i => comp f (single N i),
          property :=
            (_ : ∀ (i j : ι), i ≠ j → ∀ (x : N i) (y : N j), Commute (f (Pi.mulSingle i x)) (f (Pi.mulSingle j y))) })
      ((fun ϕ => noncommPiCoprod ↑ϕ (_ : Pairwise fun i j => ∀ (x : N i) (y : N j), Commute ((↑ϕ i) x) ((↑ϕ j) y))) ϕ) =
    ϕ

Next tactic:
ext
/-- The universal property of `MonoidHom.noncommPiCoprod` -/
@[to_additive "The universal property of `AddMonoidHom.noncommPiCoprod`"]
def noncommPiCoprodEquiv :
    { ϕ : ∀ i, N i →* M // Pairwise fun i j => ∀ x y, Commute (ϕ i x) (ϕ j y) } ≃ ((∀ i, N i) →* M)
    where
  toFun ϕ := noncommPiCoprod ϕ.1 ϕ.2
  invFun f :=
    ⟨fun i => f.comp (MonoidHom.single N i), fun i j hij x y =>
      Commute.map (Pi.mulSingle_commute hij x y) f⟩
  left_inv ϕ := by
    ext
    

Proof state:
case a.h.h
M : Type u_1
inst✝² : Monoid M
ι : Type u_2
hdec : DecidableEq ι
inst✝¹ : Fintype ι
N : ι → Type u_3
inst✝ : (i : ι) → Monoid (N i)
ϕ✝ : (i : ι) → N i →* M
hcomm : Pairwise fun i j => ∀ (x : N i) (y : N j), Commute ((ϕ✝ i) x) ((ϕ✝ j) y)
f g : (i : ι) → N i
ϕ : { ϕ // Pairwise fun i j => ∀ (x : N i) (y : N j), Commute ((ϕ i) x) ((ϕ j) y) }
x✝¹ : ι
x✝ : N x✝¹
⊢ (↑((fun f =>
              { val := fun i => comp f (single N i),
                property :=
                  (_ :
                    ∀ (i j : ι),
                      i ≠ j → ∀ (x : N i) (y : N j), Commute (f (Pi.mulSingle i x)) (f (Pi.mulSingle j y))) })
            ((fun ϕ =>
                noncommPiCoprod ↑ϕ (_ : Pairwise fun i j => ∀ (x : N i) (y : N j), Commute ((↑ϕ i) x) ((↑ϕ j) y)))
              ϕ))
        x✝¹)
      x✝ =
    (↑ϕ x✝¹) x✝

Next tactic:
simp
/-- The universal property of `MonoidHom.noncommPiCoprod` -/
@[to_additive "The universal property of `AddMonoidHom.noncommPiCoprod`"]
def noncommPiCoprodEquiv :
    { ϕ : ∀ i, N i →* M // Pairwise fun i j => ∀ x y, Commute (ϕ i x) (ϕ j y) } ≃ ((∀ i, N i) →* M)
    where
  toFun ϕ := noncommPiCoprod ϕ.1 ϕ.2
  invFun f :=
    ⟨fun i => f.comp (MonoidHom.single N i), fun i j hij x y =>
      Commute.map (Pi.mulSingle_commute hij x y) f⟩
  left_inv ϕ := by
    ext
    simp
  right_inv f := pi_ext fun i x => by 

Proof state:
M : Type u_1
inst✝² : Monoid M
ι : Type u_2
hdec : DecidableEq ι
inst✝¹ : Fintype ι
N : ι → Type u_3
inst✝ : (i : ι) → Monoid (N i)
ϕ : (i : ι) → N i →* M
hcomm : Pairwise fun i j => ∀ (x : N i) (y : N j), Commute ((ϕ i) x) ((ϕ j) y)
f✝ g : (i : ι) → N i
f : ((i : ι) → N i) →* M
i : ι
x : N i
⊢ ((fun ϕ => noncommPiCoprod ↑ϕ (_ : Pairwise fun i j => ∀ (x : N i) (y : N j), Commute ((↑ϕ i) x) ((↑ϕ j) y)))
        ((fun f =>
            { val := fun i => comp f (single N i),
              property :=
                (_ :
                  ∀ (i j : ι), i ≠ j → ∀ (x : N i) (y : N j), Commute (f (Pi.mulSingle i x)) (f (Pi.mulSingle j y))) })
          f))
      (Pi.mulSingle i x) =
    f (Pi.mulSingle i x)

Next tactic:
simp
@[to_additive]
theorem noncommPiCoprod_mrange :
    MonoidHom.mrange (noncommPiCoprod ϕ hcomm) = ⨆ i : ι, MonoidHom.mrange (ϕ i) := by
  

Proof state:
M : Type u_1
inst✝² : Monoid M
ι : Type u_2
hdec : DecidableEq ι
inst✝¹ : Fintype ι
N : ι → Type u_3
inst✝ : (i : ι) → Monoid (N i)
ϕ : (i : ι) → N i →* M
hcomm : Pairwise fun i j => ∀ (x : N i) (y : N j), Commute ((ϕ i) x) ((ϕ j) y)
f g : (i : ι) → N i
⊢ mrange (noncommPiCoprod ϕ hcomm) = ⨆ i, mrange (ϕ i)

Next tactic:
classical
    apply le_antisymm
    · rintro x ⟨f, rfl⟩
      refine Submonoid.noncommProd_mem _ _ _ (fun _ _ _ _ h => hcomm h _ _) (fun i _ => ?_)
      apply Submonoid.mem_sSup_of_mem
      · use i
      simp
    · refine' iSup_le _
      rintro i x ⟨y, rfl⟩
      refine' ⟨Pi.mulSingle i y, noncommPiCoprod_mulSingle _ _ _⟩
@[to_additive]
theorem noncommPiCoprod_mrange :
    MonoidHom.mrange (noncommPiCoprod ϕ hcomm) = ⨆ i : ι, MonoidHom.mrange (ϕ i) := by
  classical
    

Proof state:
M : Type u_1
inst✝² : Monoid M
ι : Type u_2
hdec : DecidableEq ι
inst✝¹ : Fintype ι
N : ι → Type u_3
inst✝ : (i : ι) → Monoid (N i)
ϕ : (i : ι) → N i →* M
hcomm : Pairwise fun i j => ∀ (x : N i) (y : N j), Commute ((ϕ i) x) ((ϕ j) y)
f g : (i : ι) → N i
⊢ mrange (noncommPiCoprod ϕ hcomm) = ⨆ i, mrange (ϕ i)

Next tactic:
apply le_antisymm
@[to_additive]
theorem noncommPiCoprod_mrange :
    MonoidHom.mrange (noncommPiCoprod ϕ hcomm) = ⨆ i : ι, MonoidHom.mrange (ϕ i) := by
  classical
    apply le_antisymm
    · 

Proof state:
case a
M : Type u_1
inst✝² : Monoid M
ι : Type u_2
hdec : DecidableEq ι
inst✝¹ : Fintype ι
N : ι → Type u_3
inst✝ : (i : ι) → Monoid (N i)
ϕ : (i : ι) → N i →* M
hcomm : Pairwise fun i j => ∀ (x : N i) (y : N j), Commute ((ϕ i) x) ((ϕ j) y)
f g : (i : ι) → N i
⊢ mrange (noncommPiCoprod ϕ hcomm) ≤ ⨆ i, mrange (ϕ i)

Next tactic:
rintro x ⟨f, rfl⟩
@[to_additive]
theorem noncommPiCoprod_mrange :
    MonoidHom.mrange (noncommPiCoprod ϕ hcomm) = ⨆ i : ι, MonoidHom.mrange (ϕ i) := by
  classical
    apply le_antisymm
    · rintro x ⟨f, rfl⟩
      

Proof state:
case a.intro
M : Type u_1
inst✝² : Monoid M
ι : Type u_2
hdec : DecidableEq ι
inst✝¹ : Fintype ι
N : ι → Type u_3
inst✝ : (i : ι) → Monoid (N i)
ϕ : (i : ι) → N i →* M
hcomm : Pairwise fun i j => ∀ (x : N i) (y : N j), Commute ((ϕ i) x) ((ϕ j) y)
f✝ g f : (i : ι) → N i
⊢ (noncommPiCoprod ϕ hcomm) f ∈ ⨆ i, mrange (ϕ i)

Next tactic:
refine Submonoid.noncommProd_mem _ _ _ (fun _ _ _ _ h => hcomm h _ _) (fun i _ => ?_)
@[to_additive]
theorem noncommPiCoprod_mrange :
    MonoidHom.mrange (noncommPiCoprod ϕ hcomm) = ⨆ i : ι, MonoidHom.mrange (ϕ i) := by
  classical
    apply le_antisymm
    · rintro x ⟨f, rfl⟩
      refine Submonoid.noncommProd_mem _ _ _ (fun _ _ _ _ h => hcomm h _ _) (fun i _ => ?_)
      

Proof state:
case a.intro
M : Type u_1
inst✝² : Monoid M
ι : Type u_2
hdec : DecidableEq ι
inst✝¹ : Fintype ι
N : ι → Type u_3
inst✝ : (i : ι) → Monoid (N i)
ϕ : (i : ι) → N i →* M
hcomm : Pairwise fun i j => ∀ (x : N i) (y : N j), Commute ((ϕ i) x) ((ϕ j) y)
f✝ g f : (i : ι) → N i
i : ι
x✝ : i ∈ Finset.univ
⊢ (ϕ i) (f i) ∈ ⨆ i, mrange (ϕ i)

Next tactic:
apply Submonoid.mem_sSup_of_mem
@[to_additive]
theorem noncommPiCoprod_mrange :
    MonoidHom.mrange (noncommPiCoprod ϕ hcomm) = ⨆ i : ι, MonoidHom.mrange (ϕ i) := by
  classical
    apply le_antisymm
    · rintro x ⟨f, rfl⟩
      refine Submonoid.noncommProd_mem _ _ _ (fun _ _ _ _ h => hcomm h _ _) (fun i _ => ?_)
      apply Submonoid.mem_sSup_of_mem
      · 

Proof state:
case a.intro.hs
M : Type u_1
inst✝² : Monoid M
ι : Type u_2
hdec : DecidableEq ι
inst✝¹ : Fintype ι
N : ι → Type u_3
inst✝ : (i : ι) → Monoid (N i)
ϕ : (i : ι) → N i →* M
hcomm : Pairwise fun i j => ∀ (x : N i) (y : N j), Commute ((ϕ i) x) ((ϕ j) y)
f✝ g f : (i : ι) → N i
i : ι
x✝ : i ∈ Finset.univ
⊢ ?a.intro.s✝ ∈ Set.range fun i => mrange (ϕ i)

Next tactic:
use i
@[to_additive]
theorem noncommPiCoprod_mrange :
    MonoidHom.mrange (noncommPiCoprod ϕ hcomm) = ⨆ i : ι, MonoidHom.mrange (ϕ i) := by
  classical
    apply le_antisymm
    · rintro x ⟨f, rfl⟩
      refine Submonoid.noncommProd_mem _ _ _ (fun _ _ _ _ h => hcomm h _ _) (fun i _ => ?_)
      apply Submonoid.mem_sSup_of_mem
      · use i
      

Proof state:
case a.intro.a
M : Type u_1
inst✝² : Monoid M
ι : Type u_2
hdec : DecidableEq ι
inst✝¹ : Fintype ι
N : ι → Type u_3
inst✝ : (i : ι) → Monoid (N i)
ϕ : (i : ι) → N i →* M
hcomm : Pairwise fun i j => ∀ (x : N i) (y : N j), Commute ((ϕ i) x) ((ϕ j) y)
f✝ g f : (i : ι) → N i
i : ι
x✝ : i ∈ Finset.univ
⊢ (ϕ i) (f i) ∈ (fun i => mrange (ϕ i)) i

Next tactic:
simp
@[to_additive]
theorem noncommPiCoprod_mrange :
    MonoidHom.mrange (noncommPiCoprod ϕ hcomm) = ⨆ i : ι, MonoidHom.mrange (ϕ i) := by
  classical
    apply le_antisymm
    · rintro x ⟨f, rfl⟩
      refine Submonoid.noncommProd_mem _ _ _ (fun _ _ _ _ h => hcomm h _ _) (fun i _ => ?_)
      apply Submonoid.mem_sSup_of_mem
      · use i
      simp
    · 

Proof state:
case a
M : Type u_1
inst✝² : Monoid M
ι : Type u_2
hdec : DecidableEq ι
inst✝¹ : Fintype ι
N : ι → Type u_3
inst✝ : (i : ι) → Monoid (N i)
ϕ : (i : ι) → N i →* M
hcomm : Pairwise fun i j => ∀ (x : N i) (y : N j), Commute ((ϕ i) x) ((ϕ j) y)
f g : (i : ι) → N i
⊢ ⨆ i, mrange (ϕ i) ≤ mrange (noncommPiCoprod ϕ hcomm)

Next tactic:
refine' iSup_le _
@[to_additive]
theorem noncommPiCoprod_mrange :
    MonoidHom.mrange (noncommPiCoprod ϕ hcomm) = ⨆ i : ι, MonoidHom.mrange (ϕ i) := by
  classical
    apply le_antisymm
    · rintro x ⟨f, rfl⟩
      refine Submonoid.noncommProd_mem _ _ _ (fun _ _ _ _ h => hcomm h _ _) (fun i _ => ?_)
      apply Submonoid.mem_sSup_of_mem
      · use i
      simp
    · refine' iSup_le _
      

Proof state:
case a
M : Type u_1
inst✝² : Monoid M
ι : Type u_2
hdec : DecidableEq ι
inst✝¹ : Fintype ι
N : ι → Type u_3
inst✝ : (i : ι) → Monoid (N i)
ϕ : (i : ι) → N i →* M
hcomm : Pairwise fun i j => ∀ (x : N i) (y : N j), Commute ((ϕ i) x) ((ϕ j) y)
f g : (i : ι) → N i
⊢ ∀ (i : ι), mrange (ϕ i) ≤ mrange (noncommPiCoprod ϕ hcomm)

Next tactic:
rintro i x ⟨y, rfl⟩
@[to_additive]
theorem noncommPiCoprod_mrange :
    MonoidHom.mrange (noncommPiCoprod ϕ hcomm) = ⨆ i : ι, MonoidHom.mrange (ϕ i) := by
  classical
    apply le_antisymm
    · rintro x ⟨f, rfl⟩
      refine Submonoid.noncommProd_mem _ _ _ (fun _ _ _ _ h => hcomm h _ _) (fun i _ => ?_)
      apply Submonoid.mem_sSup_of_mem
      · use i
      simp
    · refine' iSup_le _
      rintro i x ⟨y, rfl⟩
      

Proof state:
case a.intro
M : Type u_1
inst✝² : Monoid M
ι : Type u_2
hdec : DecidableEq ι
inst✝¹ : Fintype ι
N : ι → Type u_3
inst✝ : (i : ι) → Monoid (N i)
ϕ : (i : ι) → N i →* M
hcomm : Pairwise fun i j => ∀ (x : N i) (y : N j), Commute ((ϕ i) x) ((ϕ j) y)
f g : (i : ι) → N i
i : ι
y : N i
⊢ (ϕ i) y ∈ mrange (noncommPiCoprod ϕ hcomm)

Next tactic:
refine' ⟨Pi.mulSingle i y, noncommPiCoprod_mulSingle _ _ _⟩
@[to_additive]
theorem noncommPiCoprod_range : (noncommPiCoprod ϕ hcomm).range = ⨆ i : ι, (ϕ i).range := by
  

Proof state:
G : Type u_1
inst✝¹ : Group G
ι : Type u_2
hdec : DecidableEq ι
hfin : Fintype ι
H : ι → Type u_3
inst✝ : (i : ι) → Group (H i)
ϕ : (i : ι) → H i →* G
hcomm : ∀ (i j : ι), i ≠ j → ∀ (x : H i) (y : H j), Commute ((ϕ i) x) ((ϕ j) y)
f g : (i : ι) → H i
⊢ range (noncommPiCoprod ϕ hcomm) = ⨆ i, range (ϕ i)

Next tactic:
classical
    apply le_antisymm
    · rintro x ⟨f, rfl⟩
      refine Subgroup.noncommProd_mem _ (fun _ _ _ _ h => hcomm _ _ h _ _) ?_
      intro i _hi
      apply Subgroup.mem_sSup_of_mem
      · use i
      simp
    · refine' iSup_le _
      rintro i x ⟨y, rfl⟩
      refine' ⟨Pi.mulSingle i y, noncommPiCoprod_mulSingle _ _ _⟩
@[to_additive]
theorem noncommPiCoprod_range : (noncommPiCoprod ϕ hcomm).range = ⨆ i : ι, (ϕ i).range := by
  classical
    

Proof state:
G : Type u_1
inst✝¹ : Group G
ι : Type u_2
hdec : DecidableEq ι
hfin : Fintype ι
H : ι → Type u_3
inst✝ : (i : ι) → Group (H i)
ϕ : (i : ι) → H i →* G
hcomm : ∀ (i j : ι), i ≠ j → ∀ (x : H i) (y : H j), Commute ((ϕ i) x) ((ϕ j) y)
f g : (i : ι) → H i
⊢ range (noncommPiCoprod ϕ hcomm) = ⨆ i, range (ϕ i)

Next tactic:
apply le_antisymm
@[to_additive]
theorem noncommPiCoprod_range : (noncommPiCoprod ϕ hcomm).range = ⨆ i : ι, (ϕ i).range := by
  classical
    apply le_antisymm
    · 

Proof state:
case a
G : Type u_1
inst✝¹ : Group G
ι : Type u_2
hdec : DecidableEq ι
hfin : Fintype ι
H : ι → Type u_3
inst✝ : (i : ι) → Group (H i)
ϕ : (i : ι) → H i →* G
hcomm : ∀ (i j : ι), i ≠ j → ∀ (x : H i) (y : H j), Commute ((ϕ i) x) ((ϕ j) y)
f g : (i : ι) → H i
⊢ range (noncommPiCoprod ϕ hcomm) ≤ ⨆ i, range (ϕ i)

Next tactic:
rintro x ⟨f, rfl⟩
@[to_additive]
theorem noncommPiCoprod_range : (noncommPiCoprod ϕ hcomm).range = ⨆ i : ι, (ϕ i).range := by
  classical
    apply le_antisymm
    · rintro x ⟨f, rfl⟩
      

Proof state:
case a.intro
G : Type u_1
inst✝¹ : Group G
ι : Type u_2
hdec : DecidableEq ι
hfin : Fintype ι
H : ι → Type u_3
inst✝ : (i : ι) → Group (H i)
ϕ : (i : ι) → H i →* G
hcomm : ∀ (i j : ι), i ≠ j → ∀ (x : H i) (y : H j), Commute ((ϕ i) x) ((ϕ j) y)
f✝ g f : (i : ι) → H i
⊢ (noncommPiCoprod ϕ hcomm) f ∈ ⨆ i, range (ϕ i)

Next tactic:
refine Subgroup.noncommProd_mem _ (fun _ _ _ _ h => hcomm _ _ h _ _) ?_
@[to_additive]
theorem noncommPiCoprod_range : (noncommPiCoprod ϕ hcomm).range = ⨆ i : ι, (ϕ i).range := by
  classical
    apply le_antisymm
    · rintro x ⟨f, rfl⟩
      refine Subgroup.noncommProd_mem _ (fun _ _ _ _ h => hcomm _ _ h _ _) ?_
      

Proof state:
case a.intro
G : Type u_1
inst✝¹ : Group G
ι : Type u_2
hdec : DecidableEq ι
hfin : Fintype ι
H : ι → Type u_3
inst✝ : (i : ι) → Group (H i)
ϕ : (i : ι) → H i →* G
hcomm : ∀ (i j : ι), i ≠ j → ∀ (x : H i) (y : H j), Commute ((ϕ i) x) ((ϕ j) y)
f✝ g f : (i : ι) → H i
⊢ ∀ c ∈ Finset.univ, (ϕ c) (f c) ∈ ⨆ i, range (ϕ i)

Next tactic:
intro i _hi
@[to_additive]
theorem noncommPiCoprod_range : (noncommPiCoprod ϕ hcomm).range = ⨆ i : ι, (ϕ i).range := by
  classical
    apply le_antisymm
    · rintro x ⟨f, rfl⟩
      refine Subgroup.noncommProd_mem _ (fun _ _ _ _ h => hcomm _ _ h _ _) ?_
      intro i _hi
      

Proof state:
case a.intro
G : Type u_1
inst✝¹ : Group G
ι : Type u_2
hdec : DecidableEq ι
hfin : Fintype ι
H : ι → Type u_3
inst✝ : (i : ι) → Group (H i)
ϕ : (i : ι) → H i →* G
hcomm : ∀ (i j : ι), i ≠ j → ∀ (x : H i) (y : H j), Commute ((ϕ i) x) ((ϕ j) y)
f✝ g f : (i : ι) → H i
i : ι
_hi : i ∈ Finset.univ
⊢ (ϕ i) (f i) ∈ ⨆ i, range (ϕ i)

Next tactic:
apply Subgroup.mem_sSup_of_mem
@[to_additive]
theorem noncommPiCoprod_range : (noncommPiCoprod ϕ hcomm).range = ⨆ i : ι, (ϕ i).range := by
  classical
    apply le_antisymm
    · rintro x ⟨f, rfl⟩
      refine Subgroup.noncommProd_mem _ (fun _ _ _ _ h => hcomm _ _ h _ _) ?_
      intro i _hi
      apply Subgroup.mem_sSup_of_mem
      · 

Proof state:
case a.intro.hs
G : Type u_1
inst✝¹ : Group G
ι : Type u_2
hdec : DecidableEq ι
hfin : Fintype ι
H : ι → Type u_3
inst✝ : (i : ι) → Group (H i)
ϕ : (i : ι) → H i →* G
hcomm : ∀ (i j : ι), i ≠ j → ∀ (x : H i) (y : H j), Commute ((ϕ i) x) ((ϕ j) y)
f✝ g f : (i : ι) → H i
i : ι
_hi : i ∈ Finset.univ
⊢ ?a.intro.s✝ ∈ Set.range fun i => range (ϕ i)

Next tactic:
use i
@[to_additive]
theorem noncommPiCoprod_range : (noncommPiCoprod ϕ hcomm).range = ⨆ i : ι, (ϕ i).range := by
  classical
    apply le_antisymm
    · rintro x ⟨f, rfl⟩
      refine Subgroup.noncommProd_mem _ (fun _ _ _ _ h => hcomm _ _ h _ _) ?_
      intro i _hi
      apply Subgroup.mem_sSup_of_mem
      · use i
      

Proof state:
case a.intro.a
G : Type u_1
inst✝¹ : Group G
ι : Type u_2
hdec : DecidableEq ι
hfin : Fintype ι
H : ι → Type u_3
inst✝ : (i : ι) → Group (H i)
ϕ : (i : ι) → H i →* G
hcomm : ∀ (i j : ι), i ≠ j → ∀ (x : H i) (y : H j), Commute ((ϕ i) x) ((ϕ j) y)
f✝ g f : (i : ι) → H i
i : ι
_hi : i ∈ Finset.univ
⊢ (ϕ i) (f i) ∈ (fun i => range (ϕ i)) i

Next tactic:
simp
@[to_additive]
theorem noncommPiCoprod_range : (noncommPiCoprod ϕ hcomm).range = ⨆ i : ι, (ϕ i).range := by
  classical
    apply le_antisymm
    · rintro x ⟨f, rfl⟩
      refine Subgroup.noncommProd_mem _ (fun _ _ _ _ h => hcomm _ _ h _ _) ?_
      intro i _hi
      apply Subgroup.mem_sSup_of_mem
      · use i
      simp
    · 

Proof state:
case a
G : Type u_1
inst✝¹ : Group G
ι : Type u_2
hdec : DecidableEq ι
hfin : Fintype ι
H : ι → Type u_3
inst✝ : (i : ι) → Group (H i)
ϕ : (i : ι) → H i →* G
hcomm : ∀ (i j : ι), i ≠ j → ∀ (x : H i) (y : H j), Commute ((ϕ i) x) ((ϕ j) y)
f g : (i : ι) → H i
⊢ ⨆ i, range (ϕ i) ≤ range (noncommPiCoprod ϕ hcomm)

Next tactic:
refine' iSup_le _
@[to_additive]
theorem noncommPiCoprod_range : (noncommPiCoprod ϕ hcomm).range = ⨆ i : ι, (ϕ i).range := by
  classical
    apply le_antisymm
    · rintro x ⟨f, rfl⟩
      refine Subgroup.noncommProd_mem _ (fun _ _ _ _ h => hcomm _ _ h _ _) ?_
      intro i _hi
      apply Subgroup.mem_sSup_of_mem
      · use i
      simp
    · refine' iSup_le _
      

Proof state:
case a
G : Type u_1
inst✝¹ : Group G
ι : Type u_2
hdec : DecidableEq ι
hfin : Fintype ι
H : ι → Type u_3
inst✝ : (i : ι) → Group (H i)
ϕ : (i : ι) → H i →* G
hcomm : ∀ (i j : ι), i ≠ j → ∀ (x : H i) (y : H j), Commute ((ϕ i) x) ((ϕ j) y)
f g : (i : ι) → H i
⊢ ∀ (i : ι), range (ϕ i) ≤ range (noncommPiCoprod ϕ hcomm)

Next tactic:
rintro i x ⟨y, rfl⟩
@[to_additive]
theorem noncommPiCoprod_range : (noncommPiCoprod ϕ hcomm).range = ⨆ i : ι, (ϕ i).range := by
  classical
    apply le_antisymm
    · rintro x ⟨f, rfl⟩
      refine Subgroup.noncommProd_mem _ (fun _ _ _ _ h => hcomm _ _ h _ _) ?_
      intro i _hi
      apply Subgroup.mem_sSup_of_mem
      · use i
      simp
    · refine' iSup_le _
      rintro i x ⟨y, rfl⟩
      

Proof state:
case a.intro
G : Type u_1
inst✝¹ : Group G
ι : Type u_2
hdec : DecidableEq ι
hfin : Fintype ι
H : ι → Type u_3
inst✝ : (i : ι) → Group (H i)
ϕ : (i : ι) → H i →* G
hcomm : ∀ (i j : ι), i ≠ j → ∀ (x : H i) (y : H j), Commute ((ϕ i) x) ((ϕ j) y)
f g : (i : ι) → H i
i : ι
y : H i
⊢ (ϕ i) y ∈ range (noncommPiCoprod ϕ hcomm)

Next tactic:
refine' ⟨Pi.mulSingle i y, noncommPiCoprod_mulSingle _ _ _⟩
@[to_additive]
theorem injective_noncommPiCoprod_of_independent
    (hind : CompleteLattice.Independent fun i => (ϕ i).range)
    (hinj : ∀ i, Function.Injective (ϕ i)) : Function.Injective (noncommPiCoprod ϕ hcomm) := by
  

Proof state:
G : Type u_1
inst✝¹ : Group G
ι : Type u_2
hdec : DecidableEq ι
hfin : Fintype ι
H : ι → Type u_3
inst✝ : (i : ι) → Group (H i)
ϕ : (i : ι) → H i →* G
hcomm : ∀ (i j : ι), i ≠ j → ∀ (x : H i) (y : H j), Commute ((ϕ i) x) ((ϕ j) y)
f g : (i : ι) → H i
hind : CompleteLattice.Independent fun i => range (ϕ i)
hinj : ∀ (i : ι), Function.Injective ⇑(ϕ i)
⊢ Function.Injective ⇑(noncommPiCoprod ϕ hcomm)

Next tactic:
classical
    apply (MonoidHom.ker_eq_bot_iff _).mp
    apply eq_bot_iff.mpr
    intro f heq1
    have : ∀ i, i ∈ Finset.univ → ϕ i (f i) = 1 :=
      Subgroup.eq_one_of_noncommProd_eq_one_of_independent _ _ (fun _ _ _ _ h => hcomm _ _ h _ _)
        _ hind (by simp) heq1
    ext i
    apply hinj
    simp [this i (Finset.mem_univ i)]
@[to_additive]
theorem injective_noncommPiCoprod_of_independent
    (hind : CompleteLattice.Independent fun i => (ϕ i).range)
    (hinj : ∀ i, Function.Injective (ϕ i)) : Function.Injective (noncommPiCoprod ϕ hcomm) := by
  classical
    

Proof state:
G : Type u_1
inst✝¹ : Group G
ι : Type u_2
hdec : DecidableEq ι
hfin : Fintype ι
H : ι → Type u_3
inst✝ : (i : ι) → Group (H i)
ϕ : (i : ι) → H i →* G
hcomm : ∀ (i j : ι), i ≠ j → ∀ (x : H i) (y : H j), Commute ((ϕ i) x) ((ϕ j) y)
f g : (i : ι) → H i
hind : CompleteLattice.Independent fun i => range (ϕ i)
hinj : ∀ (i : ι), Function.Injective ⇑(ϕ i)
⊢ Function.Injective ⇑(noncommPiCoprod ϕ hcomm)

Next tactic:
apply (MonoidHom.ker_eq_bot_iff _).mp
@[to_additive]
theorem injective_noncommPiCoprod_of_independent
    (hind : CompleteLattice.Independent fun i => (ϕ i).range)
    (hinj : ∀ i, Function.Injective (ϕ i)) : Function.Injective (noncommPiCoprod ϕ hcomm) := by
  classical
    apply (MonoidHom.ker_eq_bot_iff _).mp
    

Proof state:
G : Type u_1
inst✝¹ : Group G
ι : Type u_2
hdec : DecidableEq ι
hfin : Fintype ι
H : ι → Type u_3
inst✝ : (i : ι) → Group (H i)
ϕ : (i : ι) → H i →* G
hcomm : ∀ (i j : ι), i ≠ j → ∀ (x : H i) (y : H j), Commute ((ϕ i) x) ((ϕ j) y)
f g : (i : ι) → H i
hind : CompleteLattice.Independent fun i => range (ϕ i)
hinj : ∀ (i : ι), Function.Injective ⇑(ϕ i)
⊢ ker (noncommPiCoprod ϕ hcomm) = ⊥

Next tactic:
apply eq_bot_iff.mpr
@[to_additive]
theorem injective_noncommPiCoprod_of_independent
    (hind : CompleteLattice.Independent fun i => (ϕ i).range)
    (hinj : ∀ i, Function.Injective (ϕ i)) : Function.Injective (noncommPiCoprod ϕ hcomm) := by
  classical
    apply (MonoidHom.ker_eq_bot_iff _).mp
    apply eq_bot_iff.mpr
    

Proof state:
G : Type u_1
inst✝¹ : Group G
ι : Type u_2
hdec : DecidableEq ι
hfin : Fintype ι
H : ι → Type u_3
inst✝ : (i : ι) → Group (H i)
ϕ : (i : ι) → H i →* G
hcomm : ∀ (i j : ι), i ≠ j → ∀ (x : H i) (y : H j), Commute ((ϕ i) x) ((ϕ j) y)
f g : (i : ι) → H i
hind : CompleteLattice.Independent fun i => range (ϕ i)
hinj : ∀ (i : ι), Function.Injective ⇑(ϕ i)
⊢ ker (noncommPiCoprod ϕ hcomm) ≤ ⊥

Next tactic:
intro f heq1
@[to_additive]
theorem injective_noncommPiCoprod_of_independent
    (hind : CompleteLattice.Independent fun i => (ϕ i).range)
    (hinj : ∀ i, Function.Injective (ϕ i)) : Function.Injective (noncommPiCoprod ϕ hcomm) := by
  classical
    apply (MonoidHom.ker_eq_bot_iff _).mp
    apply eq_bot_iff.mpr
    intro f heq1
    

Proof state:
G : Type u_1
inst✝¹ : Group G
ι : Type u_2
hdec : DecidableEq ι
hfin : Fintype ι
H : ι → Type u_3
inst✝ : (i : ι) → Group (H i)
ϕ : (i : ι) → H i →* G
hcomm : ∀ (i j : ι), i ≠ j → ∀ (x : H i) (y : H j), Commute ((ϕ i) x) ((ϕ j) y)
f✝ g : (i : ι) → H i
hind : CompleteLattice.Independent fun i => range (ϕ i)
hinj : ∀ (i : ι), Function.Injective ⇑(ϕ i)
f : (i : ι) → H i
heq1 : f ∈ ker (noncommPiCoprod ϕ hcomm)
⊢ f ∈ ⊥

Next tactic:
have : ∀ i, i ∈ Finset.univ → ϕ i (f i) = 1 :=
      Subgroup.eq_one_of_noncommProd_eq_one_of_independent _ _ (fun _ _ _ _ h => hcomm _ _ h _ _)
        _ hind (by simp) heq1
@[to_additive]
theorem injective_noncommPiCoprod_of_independent
    (hind : CompleteLattice.Independent fun i => (ϕ i).range)
    (hinj : ∀ i, Function.Injective (ϕ i)) : Function.Injective (noncommPiCoprod ϕ hcomm) := by
  classical
    apply (MonoidHom.ker_eq_bot_iff _).mp
    apply eq_bot_iff.mpr
    intro f heq1
    have : ∀ i, i ∈ Finset.univ → ϕ i (f i) = 1 :=
      Subgroup.eq_one_of_noncommProd_eq_one_of_independent _ _ (fun _ _ _ _ h => hcomm _ _ h _ _)
        _ hind (by 

Proof state:
G : Type u_1
inst✝¹ : Group G
ι : Type u_2
hdec : DecidableEq ι
hfin : Fintype ι
H : ι → Type u_3
inst✝ : (i : ι) → Group (H i)
ϕ : (i : ι) → H i →* G
hcomm : ∀ (i j : ι), i ≠ j → ∀ (x : H i) (y : H j), Commute ((ϕ i) x) ((ϕ j) y)
f✝ g : (i : ι) → H i
hind : CompleteLattice.Independent fun i => range (ϕ i)
hinj : ∀ (i : ι), Function.Injective ⇑(ϕ i)
f : (i : ι) → H i
heq1 : f ∈ ker (noncommPiCoprod ϕ hcomm)
⊢ ∀ x ∈ Finset.univ, (ϕ x) (f x) ∈ range (ϕ x)

Next tactic:
simp