Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 659983c

Browse files
committed
feat(logic/equiv/basic): add Pi_comm aka function.swap as an equiv (#14561)
1 parent 18bf7af commit 659983c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/logic/equiv/basic.lean

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -917,6 +917,16 @@ def Pi_congr_right {α} {β₁ β₂ : α → Sort*} (F : Π a, β₁ a ≃ β
917917
⟨λ H a, F a (H a), λ H a, (F a).symm (H a),
918918
λ H, funext $ by simp, λ H, funext $ by simp⟩
919919

920+
/-- Given `φ : α → β → Sort*`, we have an equivalence between `Π a b, φ a b` and `Π b a, φ a b`.
921+
This is `function.swap` as an `equiv`. -/
922+
@[simps apply]
923+
def Pi_comm {α β} (φ : α → β → Sort*) : (Π a b, φ a b) ≃ (Π b a, φ a b) :=
924+
⟨swap, swap, λ x, rfl, λ y, rfl⟩
925+
926+
@[simp] lemma Pi_comm_symm {α β} {φ : α → β → Sort*} :
927+
(Pi_comm φ).symm = (Pi_comm $ swap φ) :=
928+
rfl
929+
920930
/-- Dependent `curry` equivalence: the type of dependent functions on `Σ i, β i` is equivalent
921931
to the type of dependent functions of two arguments (i.e., functions to the space of functions).
922932

0 commit comments

Comments
 (0)