Skip to content

Commit

Permalink
chore: cleanup Mathlib.Init.Data.Prod (#6972)
Browse files Browse the repository at this point in the history
Removing from `Mathlib.Init.Data.Prod` from the early parts of the import hierarchy.

While at it, remove unnecessary uses of `Prod.mk.eta` across the library.



Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
  • Loading branch information
semorrison and semorrison committed Sep 6, 2023
1 parent 55a12e0 commit b5528b3
Show file tree
Hide file tree
Showing 35 changed files with 48 additions and 56 deletions.
8 changes: 4 additions & 4 deletions Mathlib/Algebra/BigOperators/Basic.lean
Expand Up @@ -599,8 +599,8 @@ theorem prod_finset_product (r : Finset (γ × α)) (s : Finset γ) (t : γ →
refine' Eq.trans _ (prod_sigma s t fun p => f (p.1, p.2))
exact
prod_bij' (fun p _hp => ⟨p.1, p.2⟩) (fun p => mem_sigma.mpr ∘ (h p).mp)
(fun p hp => congr_arg f Prod.mk.eta.symm) (fun p _hp => (p.1, p.2))
(fun p => (h (p.1, p.2)).mpr ∘ mem_sigma.mp) (fun p _hp => Prod.mk.eta) fun p _hp => p.eta
(fun p _ => rfl) (fun p _hp => (p.1, p.2))
(fun p => (h (p.1, p.2)).mpr ∘ mem_sigma.mp) (fun p _ => rfl) fun p _hp => p.eta
#align finset.prod_finset_product Finset.prod_finset_product
#align finset.sum_finset_product Finset.sum_finset_product

Expand All @@ -619,8 +619,8 @@ theorem prod_finset_product_right (r : Finset (α × γ)) (s : Finset γ) (t :
refine' Eq.trans _ (prod_sigma s t fun p => f (p.2, p.1))
exact
prod_bij' (fun p _hp => ⟨p.2, p.1⟩) (fun p => mem_sigma.mpr ∘ (h p).mp)
(fun p hp => congr_arg f Prod.mk.eta.symm) (fun p _hp => (p.2, p.1))
(fun p => (h (p.2, p.1)).mpr ∘ mem_sigma.mp) (fun p _hp => Prod.mk.eta) fun p _hp => p.eta
(fun p _c => rfl) (fun p _hp => (p.2, p.1))
(fun p => (h (p.2, p.1)).mpr ∘ mem_sigma.mp) (fun p _ => rfl) fun p _hp => p.eta
#align finset.prod_finset_product_right Finset.prod_finset_product_right
#align finset.sum_finset_product_right Finset.sum_finset_product_right

Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Algebra/BigOperators/Finprod.lean
Expand Up @@ -1255,7 +1255,7 @@ theorem finprod_mem_finset_product' [DecidableEq α] [DecidableEq β] (s : Finse
(s.mulSupport_of_fiberwise_prod_subset_image f Prod.fst),
← Finset.prod_fiberwise_of_maps_to (t := Finset.image Prod.fst s) _ f]
-- `finish` could close the goal here
simp only [Finset.mem_image, Prod.mk.eta]
simp only [Finset.mem_image]
exact fun x hx => ⟨x, hx, rfl⟩
#align finprod_mem_finset_product' finprod_mem_finset_product'
#align finsum_mem_finset_product' finsum_mem_finset_product'
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Algebra/EuclideanDomain/Basic.lean
Expand Up @@ -205,7 +205,7 @@ theorem xgcdAux_fst (x y : R) : ∀ s t s' t', (xgcdAux x s t y s' t').1 = gcd x
#align euclidean_domain.xgcd_aux_fst EuclideanDomain.xgcdAux_fst

theorem xgcdAux_val (x y : R) : xgcdAux x 1 0 y 0 1 = (gcd x y, xgcd x y) := by
rw [xgcd, ← xgcdAux_fst x y 1 0 0 1, Prod.mk.eta]
rw [xgcd, ← xgcdAux_fst x y 1 0 0 1]
#align euclidean_domain.xgcd_aux_val EuclideanDomain.xgcdAux_val

private def P (a b : R) : R × R × R → Prop
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Algebra/EuclideanDomain/Defs.lean
Expand Up @@ -272,7 +272,7 @@ theorem gcdB_zero_left {s : R} : gcdB 0 s = 1 := by
#align euclidean_domain.gcd_b_zero_left EuclideanDomain.gcdB_zero_left

theorem xgcd_val (x y : R) : xgcd x y = (gcdA x y, gcdB x y) :=
Prod.mk.eta.symm
rfl
#align euclidean_domain.xgcd_val EuclideanDomain.xgcd_val

end GCD
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/Algebra/Group/Prod.lean
Expand Up @@ -366,7 +366,7 @@ theorem snd_comp_prod (f : M →ₙ* N) (g : M →ₙ* P) : (snd N P).comp (f.pr

@[to_additive (attr := simp) prod_unique]
theorem prod_unique (f : M →ₙ* N × P) : ((fst N P).comp f).prod ((snd N P).comp f) = f :=
ext fun x => by simp only [prod_apply, coe_fst, coe_snd, comp_apply, Prod.mk.eta]
ext fun x => by simp only [prod_apply, coe_fst, coe_snd, comp_apply]
#align mul_hom.prod_unique MulHom.prod_unique
#align add_hom.prod_unique AddHom.prod_unique

Expand Down Expand Up @@ -577,7 +577,7 @@ theorem snd_comp_prod (f : M →* N) (g : M →* P) : (snd N P).comp (f.prod g)

@[to_additive (attr := simp) prod_unique]
theorem prod_unique (f : M →* N × P) : ((fst N P).comp f).prod ((snd N P).comp f) = f :=
ext fun x => by simp only [prod_apply, coe_fst, coe_snd, comp_apply, Prod.mk.eta]
ext fun x => by simp only [prod_apply, coe_fst, coe_snd, comp_apply]
#align monoid_hom.prod_unique MonoidHom.prod_unique
#align add_monoid_hom.prod_unique AddMonoidHom.prod_unique

Expand Down
4 changes: 2 additions & 2 deletions Mathlib/Algebra/Ring/Prod.lean
Expand Up @@ -153,7 +153,7 @@ theorem snd_comp_prod : (snd S T).comp (f.prod g) = g :=
#align non_unital_ring_hom.snd_comp_prod NonUnitalRingHom.snd_comp_prod

theorem prod_unique (f : R →ₙ+* S × T) : ((fst S T).comp f).prod ((snd S T).comp f) = f :=
ext fun x => by simp only [prod_apply, coe_fst, coe_snd, comp_apply, Prod.mk.eta]
ext fun x => by simp only [prod_apply, coe_fst, coe_snd, comp_apply]
#align non_unital_ring_hom.prod_unique NonUnitalRingHom.prod_unique

end Prod
Expand Down Expand Up @@ -240,7 +240,7 @@ theorem snd_comp_prod : (snd S T).comp (f.prod g) = g :=
#align ring_hom.snd_comp_prod RingHom.snd_comp_prod

theorem prod_unique (f : R →+* S × T) : ((fst S T).comp f).prod ((snd S T).comp f) = f :=
ext fun x => by simp only [prod_apply, coe_fst, coe_snd, comp_apply, Prod.mk.eta]
ext fun x => by simp only [prod_apply, coe_fst, coe_snd, comp_apply]
#align ring_hom.prod_unique RingHom.prod_unique

end Prod
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Algebra/Support.lean
Expand Up @@ -238,7 +238,7 @@ theorem mulSupport_prod_mk (f : α → M) (g : α → N) :
@[to_additive support_prod_mk']
theorem mulSupport_prod_mk' (f : α → M × N) :
mulSupport f = (mulSupport fun x => (f x).1) ∪ mulSupport fun x => (f x).2 := by
simp only [← mulSupport_prod_mk, Prod.mk.eta]
simp only [← mulSupport_prod_mk]
#align function.mul_support_prod_mk' Function.mulSupport_prod_mk'
#align function.support_prod_mk' Function.support_prod_mk'

Expand Down
4 changes: 2 additions & 2 deletions Mathlib/Analysis/Convex/Extreme.lean
Expand Up @@ -199,12 +199,12 @@ theorem extremePoints_prod (s : Set E) (t : Set F) :
refine' (h (mk_mem_prod hx₁ hx.2) (mk_mem_prod hx₂ hx.2) _).imp (congr_arg Prod.fst)
(congr_arg Prod.fst)
rw [← Prod.image_mk_openSegment_left]
exact ⟨_, hx_fst, Prod.mk.eta
exact ⟨_, hx_fst, rfl
· rintro x₁ hx₁ x₂ hx₂ hx_snd
refine' (h (mk_mem_prod hx.1 hx₁) (mk_mem_prod hx.1 hx₂) _).imp (congr_arg Prod.snd)
(congr_arg Prod.snd)
rw [← Prod.image_mk_openSegment_right]
exact ⟨_, hx_snd, Prod.mk.eta
exact ⟨_, hx_snd, rfl
· rintro x₁ hx₁ x₂ hx₂ ⟨a, b, ha, hb, hab, hx'⟩
simp_rw [Prod.ext_iff]
exact and_and_and_comm.1
Expand Down
3 changes: 1 addition & 2 deletions Mathlib/Analysis/Convolution.lean
Expand Up @@ -653,7 +653,7 @@ theorem continuousOn_convolution_right_with_param' {g : P → G → E'} {s : Set
obtain ⟨V, V_mem, hV⟩ : ∃ V ∈ 𝓝 (0 : G), K' + V ⊆ U :=
compact_open_separated_add_right hK' U_open K'U
have : ((w ∩ s) ×ˢ ({q₀.2} + V) : Set (P × G)) ∈ 𝓝[s ×ˢ univ] q₀ := by
conv_rhs => rw [← @Prod.mk.eta _ _ q₀, nhdsWithin_prod_eq, nhdsWithin_univ]
conv_rhs => rw [nhdsWithin_prod_eq, nhdsWithin_univ]
refine' Filter.prod_mem_prod _ (singleton_add_mem_nhds_of_nhds_zero q₀.2 V_mem)
exact mem_nhdsWithin_iff_exists_mem_nhds_inter.2 ⟨w, w_open.mem_nhds q₀w, Subset.rfl⟩
filter_upwards [this]
Expand All @@ -679,7 +679,6 @@ theorem continuousOn_convolution_right_with_param' {g : P → G → E'} {s : Set
change ContinuousWithinAt (fun q : P × G => (↿g) (q.1, q.2 - a)) (s ×ˢ univ) q₀
have : ContinuousAt (fun q : P × G => (q.1, q.2 - a)) (q₀.1, q₀.2) :=
(continuous_fst.prod_mk (continuous_snd.sub continuous_const)).continuousAt
rw [← @Prod.mk.eta _ _ q₀]
have h'q₀ : (q₀.1, q₀.2 - a) ∈ (s ×ˢ univ : Set (P × G)) := ⟨hq₀, mem_univ _⟩
refine' ContinuousWithinAt.comp (hg _ h'q₀) this.continuousWithinAt _
rintro ⟨q, x⟩ ⟨hq, -⟩
Expand Down
1 change: 0 additions & 1 deletion Mathlib/Combinatorics/SimpleGraph/Prod.lean
Expand Up @@ -173,7 +173,6 @@ protected theorem Preconnected.boxProd (hG : G.Preconnected) (hH : H.Preconnecte
rintro x y
obtain ⟨w₁⟩ := hG x.1 y.1
obtain ⟨w₂⟩ := hH x.2 y.2
rw [← @Prod.mk.eta _ _ x, ← @Prod.mk.eta _ _ y]
exact ⟨(w₁.boxProdLeft _ _).append (w₂.boxProdRight _ _)⟩
#align simple_graph.preconnected.box_prod SimpleGraph.Preconnected.boxProd

Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Data/Fin/Tuple/NatAntidiagonal.lean
Expand Up @@ -91,7 +91,7 @@ theorem mem_antidiagonalTuple {n : ℕ} {k : ℕ} {x : Fin k → ℕ} :
simp_rw [List.mem_bind, List.mem_map,
List.Nat.mem_antidiagonal, Fin.cons_eq_cons, exists_eq_right_right, ih,
@eq_comm _ _ (Prod.snd _), and_comm (a := Prod.snd _ = _),
←Prod.mk.inj_iff (a₁ := Prod.fst _), Prod.mk.eta, exists_eq_right]
←Prod.mk.inj_iff (a₁ := Prod.fst _), exists_eq_right]
#align list.nat.mem_antidiagonal_tuple List.Nat.mem_antidiagonalTuple

/-- The antidiagonal of `n` does not contain duplicate entries. -/
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Data/Finsupp/Basic.lean
Expand Up @@ -1254,7 +1254,7 @@ def finsuppProdEquiv : (α × β →₀ M) ≃ (α →₀ β →₀ M)
right_inv f := by
simp only [Finsupp.curry, Finsupp.uncurry, sum_sum_index, sum_zero_index, sum_add_index,
sum_single_index, single_zero, single_add, eq_self_iff_true, forall_true_iff,
forall₃_true_iff, Prod.mk.eta, (single_sum _ _ _).symm, sum_single]
forall₃_true_iff, (single_sum _ _ _).symm, sum_single]
#align finsupp.finsupp_prod_equiv Finsupp.finsuppProdEquiv

theorem filter_curry (f : α × β →₀ M) (p : α → Prop) :
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Data/Pi/Algebra.lean
Expand Up @@ -339,7 +339,7 @@ protected def prod (f' : ∀ i, f i) (g' : ∀ i, g i) (i : I) : f i × g i :=
-- Porting note : simp now unfolds the lhs, so we are not marking these as simp.
-- @[simp]
theorem prod_fst_snd : Pi.prod (Prod.fst : α × β → α) (Prod.snd : α × β → β) = id :=
funext fun _ => Prod.mk.eta
rfl
#align pi.prod_fst_snd Pi.prod_fst_snd

-- Porting note : simp now unfolds the lhs, so we are not marking these as simp.
Expand Down
7 changes: 5 additions & 2 deletions Mathlib/Data/Prod/Basic.lean
Expand Up @@ -4,7 +4,6 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl
-/
import Mathlib.Init.Core
import Mathlib.Init.Data.Prod
import Mathlib.Init.Function
import Mathlib.Logic.Function.Basic
import Mathlib.Tactic.Common
Expand All @@ -28,6 +27,10 @@ theorem Prod_map (f : α → γ) (g : β → δ) (p : α × β) : Prod.map f g p

namespace Prod

@[simp]
theorem mk.eta : ∀ {p : α × β}, (p.1, p.2) = p
| (_, _) => rfl

@[simp]
theorem «forall» {p : α × β → Prop} : (∀ x, p x) ↔ ∀ a b, p (a, b) :=
fun h a b ↦ h (a, b), fun h ⟨a, b⟩ ↦ h a b⟩
Expand Down Expand Up @@ -118,7 +121,7 @@ lemma mk_inj_right : (a₁, b) = (a₂, b) ↔ a₁ = a₂ := (mk.inj_right _).e
#align prod.mk_inj_right Prod.mk_inj_right

theorem ext_iff {p q : α × β} : p = q ↔ p.1 = q.1 ∧ p.2 = q.2 := by
rw [← @mk.eta _ _ p, ← @mk.eta _ _ q, mk.inj_iff]
rw [mk.inj_iff]
#align prod.ext_iff Prod.ext_iff

@[ext]
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Data/Prod/PProd.lean
Expand Up @@ -20,7 +20,7 @@ namespace PProd

@[simp]
theorem mk.eta {p : PProd α β} : PProd.mk p.1 p.2 = p :=
PProd.casesOn p fun _ _ ↦ rfl
rfl
#align pprod.mk.eta PProd.mk.eta

@[simp]
Expand Down
1 change: 1 addition & 0 deletions Mathlib/Data/Seq/Parallel.lean
Expand Up @@ -3,6 +3,7 @@ Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Prod
import Mathlib.Data.Seq.WSeq

#align_import data.seq.parallel from "leanprover-community/mathlib"@"a7e36e48519ab281320c4d192da6a7b348ce40ad"
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/Data/Sym/Sym2.lean
Expand Up @@ -337,11 +337,11 @@ theorem mem_iff {a b c : α} : a ∈ (⟦(b, c)⟧ : Sym2 α) ↔ a = b ∨ a =
#align sym2.mem_iff Sym2.mem_iff

theorem out_fst_mem (e : Sym2 α) : e.out.1 ∈ e :=
⟨e.out.2, by rw [Prod.mk.eta, e.out_eq]⟩
⟨e.out.2, by rw [e.out_eq]⟩
#align sym2.out_fst_mem Sym2.out_fst_mem

theorem out_snd_mem (e : Sym2 α) : e.out.2 ∈ e :=
⟨e.out.1, by rw [eq_swap, Prod.mk.eta, e.out_eq]⟩
⟨e.out.1, by rw [eq_swap, e.out_eq]⟩
#align sym2.out_snd_mem Sym2.out_snd_mem

theorem ball {p : α → Prop} {a b : α} : (∀ c ∈ (⟦(a, b)⟧ : Sym2 α), p c) ↔ p a ∧ p b := by
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Geometry/Manifold/Algebra/Structures.lean
Expand Up @@ -53,7 +53,7 @@ instance (priority := 100) fieldSmoothRing {𝕜 : Type*} [NontriviallyNormedFie
smooth_mul := by
rw [smooth_iff]
refine' ⟨continuous_mul, fun x y => _⟩
simp only [Prod.mk.eta, mfld_simps]
simp only [mfld_simps]
rw [contDiffOn_univ]
exact contDiff_mul }
#align field_smooth_ring fieldSmoothRing
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Geometry/Manifold/ContMDiff.lean
Expand Up @@ -1642,7 +1642,7 @@ end Projections
theorem contMDiffWithinAt_prod_iff (f : M → M' × N') {s : Set M} {x : M} :
ContMDiffWithinAt I (I'.prod J') n f s x ↔
ContMDiffWithinAt I I' n (Prod.fst ∘ f) s x ∧ ContMDiffWithinAt I J' n (Prod.snd ∘ f) s x :=
by refine' fun h => ⟨h.fst, h.snd⟩, fun h => _⟩; simpa only [Prod.mk.eta] using h.1.prod_mk h.2
fun h => ⟨h.fst, h.snd⟩, fun h => h.1.prod_mk h.2
#align cont_mdiff_within_at_prod_iff contMDiffWithinAt_prod_iff

theorem contMDiffAt_prod_iff (f : M → M' × N') {x : M} :
Expand Down
1 change: 0 additions & 1 deletion Mathlib/Geometry/Manifold/MFDeriv.lean
Expand Up @@ -1559,7 +1559,6 @@ theorem mfderiv_prod_eq_add {f : M × M' → M''} {p : M × M'}
mfderiv (I.prod I') I'' (fun z : M × M' => f (z.1, p.2)) p +
mfderiv (I.prod I') I'' (fun z : M × M' => f (p.1, z.2)) p := by
dsimp only
rw [← @Prod.mk.eta _ _ p] at hf
erw [mfderiv_comp_of_eq hf ((mdifferentiableAt_fst I I').prod_mk (mdifferentiableAt_const _ _))
rfl,
mfderiv_comp_of_eq hf ((mdifferentiableAt_const _ _).prod_mk (mdifferentiableAt_snd I I')) rfl,
Expand Down
1 change: 1 addition & 0 deletions Mathlib/GroupTheory/MonoidLocalization.lean
Expand Up @@ -3,6 +3,7 @@ Copyright (c) 2019 Amelia Livingston. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Amelia Livingston
-/
import Mathlib.Init.Data.Prod
import Mathlib.GroupTheory.Congruence
import Mathlib.GroupTheory.Submonoid.Membership
import Mathlib.Algebra.Group.Units
Expand Down
5 changes: 0 additions & 5 deletions Mathlib/Init/Data/Prod.lean
Expand Up @@ -3,15 +3,10 @@ Copyright (c) 2014 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Leonardo de Moura, Jeremy Avigad
-/
import Mathlib.Init.Logic
import Mathlib.Util.CompileInductive

/-! ### alignments from lean 3 `init.data.prod` -/

set_option autoImplicit true

compile_inductive% Prod

@[simp]
theorem Prod.mk.eta : ∀ {p : α × β}, (p.1, p.2) = p
| (_, _) => rfl
1 change: 0 additions & 1 deletion Mathlib/Init/Function.lean
Expand Up @@ -3,7 +3,6 @@ Copyright (c) 2014 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Leonardo de Moura, Jeremy Avigad, Haitao Zhang
-/
import Mathlib.Init.Data.Prod
import Mathlib.Init.Logic
import Mathlib.Mathport.Rename
import Mathlib.Tactic.Attr.Register
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/LinearAlgebra/Finsupp.lean
Expand Up @@ -1025,7 +1025,7 @@ theorem finsuppProdLEquiv_apply {α β R M : Type*} [Semiring R] [AddCommMonoid
theorem finsuppProdLEquiv_symm_apply {α β R M : Type*} [Semiring R] [AddCommMonoid M] [Module R M]
(f : α →₀ β →₀ M) (xy) : (finsuppProdLEquiv R).symm f xy = f xy.1 xy.2 := by
conv_rhs =>
rw [← (finsuppProdLEquiv R).apply_symm_apply f, finsuppProdLEquiv_apply, Prod.mk.eta]
rw [← (finsuppProdLEquiv R).apply_symm_apply f, finsuppProdLEquiv_apply]
#align finsupp.finsupp_prod_lequiv_symm_apply Finsupp.finsuppProdLEquiv_symm_apply

end Prod
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/LinearAlgebra/Matrix/Determinant.lean
Expand Up @@ -638,7 +638,7 @@ theorem det_blockDiagonal {o : Type*} [Fintype o] [DecidableEq o] (M : o → Mat
rw [mem_preserving_snd] at hσ
obtain ⟨⟨k, x⟩, hkx⟩ := not_forall.mp hσ
rw [Finset.prod_eq_zero (Finset.mem_univ (k, x)), mul_zero]
rw [← @Prod.mk.eta _ _ (σ (k, x)), blockDiagonal_apply_ne]
rw [blockDiagonal_apply_ne]
exact hkx
#align matrix.det_block_diagonal Matrix.det_blockDiagonal

Expand Down
6 changes: 3 additions & 3 deletions Mathlib/LinearAlgebra/Prod.lean
Expand Up @@ -275,7 +275,7 @@ def coprodEquiv [Module S M₃] [SMulCommClass R S M₃] :
where
toFun f := f.1.coprod f.2
invFun f := (f.comp (inl _ _ _), f.comp (inr _ _ _))
left_inv f := by simp only [Prod.mk.eta, coprod_inl, coprod_inr]
left_inv f := by simp only [coprod_inl, coprod_inr]
right_inv f := by simp only [← comp_coprod, comp_id, coprod_inl_inr]
map_add' a b := by
ext
Expand Down Expand Up @@ -330,12 +330,12 @@ theorem ker_prodMap (f : M →ₗ[R] M₂) (g : M₃ →ₗ[R] M₄) :

@[simp]
theorem prodMap_id : (id : M →ₗ[R] M).prodMap (id : M₂ →ₗ[R] M₂) = id :=
LinearMap.ext fun _ => Prod.mk.eta
rfl
#align linear_map.prod_map_id LinearMap.prodMap_id

@[simp]
theorem prodMap_one : (1 : M →ₗ[R] M).prodMap (1 : M₂ →ₗ[R] M₂) = 1 :=
LinearMap.ext fun _ => Prod.mk.eta
rfl
#align linear_map.prod_map_one LinearMap.prodMap_one

theorem prodMap_comp (f₁₂ : M →ₗ[R] M₂) (f₂₃ : M₂ →ₗ[R] M₃) (g₁₂ : M₄ →ₗ[R] M₅)
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Logic/Equiv/Basic.lean
Expand Up @@ -908,7 +908,7 @@ section
def arrowProdEquivProdArrow (α β γ : Type*) : (γ → α × β) ≃ (γ → α) × (γ → β) where
toFun := fun f => (fun c => (f c).1, fun c => (f c).2)
invFun := fun p c => (p.1 c, p.2 c)
left_inv := fun f => funext fun c => Prod.mk.eta
left_inv := fun f => rfl
right_inv := fun p => by cases p; rfl
#align equiv.arrow_prod_equiv_prod_arrow Equiv.arrowProdEquivProdArrow

Expand Down
4 changes: 2 additions & 2 deletions Mathlib/Order/Filter/Prod.lean
Expand Up @@ -196,14 +196,14 @@ theorem Eventually.diag_of_prod_left {f : Filter α} {g : Filter γ} {p : (α ×
(∀ᶠ x in (f ×ˢ f) ×ˢ g, p x) → ∀ᶠ x : α × γ in f ×ˢ g, p ((x.1, x.1), x.2) := by
intro h
obtain ⟨t, ht, s, hs, hst⟩ := eventually_prod_iff.1 h
refine' (ht.diag_of_prod.prod_mk hs).mono fun x hx => by simp only [hst hx.1 hx.2, Prod.mk.eta]
refine' (ht.diag_of_prod.prod_mk hs).mono fun x hx => by simp only [hst hx.1 hx.2]
#align filter.eventually.diag_of_prod_left Filter.Eventually.diag_of_prod_left

theorem Eventually.diag_of_prod_right {f : Filter α} {g : Filter γ} {p : α × γ × γ → Prop} :
(∀ᶠ x in f ×ˢ (g ×ˢ g), p x) → ∀ᶠ x : α × γ in f ×ˢ g, p (x.1, x.2, x.2) := by
intro h
obtain ⟨t, ht, s, hs, hst⟩ := eventually_prod_iff.1 h
refine' (ht.prod_mk hs.diag_of_prod).mono fun x hx => by simp only [hst hx.1 hx.2, Prod.mk.eta]
refine' (ht.prod_mk hs.diag_of_prod).mono fun x hx => by simp only [hst hx.1 hx.2]
#align filter.eventually.diag_of_prod_right Filter.Eventually.diag_of_prod_right

theorem tendsto_diag : Tendsto (fun i => (i, i)) f (f ×ˢ f) :=
Expand Down
3 changes: 1 addition & 2 deletions Mathlib/Order/Interval.lean
Expand Up @@ -6,7 +6,6 @@ Authors: Yaël Dillies
import Mathlib.Data.Set.Intervals.Basic
import Mathlib.Data.Set.Lattice
import Mathlib.Data.SetLike.Basic
import Mathlib.Init.Data.Prod

#align_import order.interval from "leanprover-community/mathlib"@"6623e6af705e97002a9054c1c05a980180276fc1"

Expand Down Expand Up @@ -69,7 +68,7 @@ def toDualProd : NonemptyInterval α → αᵒᵈ × α :=

@[simp]
theorem toDualProd_apply (s : NonemptyInterval α) : s.toDualProd = (toDual s.fst, s.snd) :=
Prod.mk.eta.symm
rfl
#align nonempty_interval.to_dual_prod_apply NonemptyInterval.toDualProd_apply

theorem toDualProd_injective : Injective (toDualProd : NonemptyInterval α → αᵒᵈ × α) :=
Expand Down
8 changes: 3 additions & 5 deletions Mathlib/Probability/Kernel/Composition.lean
Expand Up @@ -163,8 +163,7 @@ theorem measurable_compProdFun_of_finite (κ : kernel α β) [IsFiniteKernel κ]
(Function.uncurry fun a b => η (a, b) {c : γ | (b, c) ∈ s}) = fun p =>
η p {c : γ | (p.2, c) ∈ s} := by
ext1 p
have hp_eq_mk : p = (p.fst, p.snd) := Prod.mk.eta.symm
rw [hp_eq_mk, Function.uncurry_apply_pair]
rw [Function.uncurry_apply_pair]
rw [this]
exact measurable_kernel_prod_mk_left (measurable_fst.snd.prod_mk measurable_snd hs)
exact h_meas.lintegral_kernel_prod_right
Expand All @@ -180,8 +179,7 @@ theorem measurable_compProdFun (κ : kernel α β) [IsSFiniteKernel κ] (η : ke
(Function.uncurry fun a b => seq η n (a, b) {c : γ | (b, c) ∈ s}) = fun p =>
seq η n p {c : γ | (p.2, c) ∈ s} := by
ext1 p
have hp_eq_mk : p = (p.fst, p.snd) := Prod.mk.eta.symm
rw [hp_eq_mk, Function.uncurry_apply_pair]
rw [Function.uncurry_apply_pair]
rw [this]
exact measurable_kernel_prod_mk_left (measurable_fst.snd.prod_mk measurable_snd hs)
exact h_meas.lintegral_kernel_prod_right
Expand Down Expand Up @@ -356,7 +354,7 @@ theorem lintegral_compProd' (κ : kernel α β) [IsSFiniteKernel κ] (η : kerne
have h : ∀ a, ⨆ n, F n a = Function.uncurry f a :=
SimpleFunc.iSup_eapprox_apply (Function.uncurry f) hf
simp only [Prod.forall, Function.uncurry_apply_pair] at h
simp_rw [← h, Prod.mk.eta]
simp_rw [← h]
have h_mono : Monotone F := fun i j hij b =>
SimpleFunc.monotone_eapprox (Function.uncurry f) hij _
rw [lintegral_iSup (fun n => (F n).measurable) h_mono]
Expand Down

0 comments on commit b5528b3

Please sign in to comment.