@@ -1048,6 +1048,7 @@ open Subtype
1048
1048
/-- If `α` is equivalent to `β` and the predicates `p : α → Prop` and `q : β → Prop` are equivalent
1049
1049
at corresponding points, then `{a // p a}` is equivalent to `{b // q b}`.
1050
1050
For the statement where `α = β`, that is, `e : perm α`, see `Perm.subtypePerm`. -/
1051
+ @[simps apply]
1051
1052
def subtypeEquiv {p : α → Prop } {q : β → Prop } (e : α ≃ β) (h : ∀ a, p a ↔ q (e a)) :
1052
1053
{ a : α // p a } ≃ { b : β // q b } where
1053
1054
toFun a := ⟨e a, (h _).mp a.property⟩
@@ -1065,25 +1066,21 @@ theorem subtypeEquiv_refl {p : α → Prop} (h : ∀ a, p a ↔ p (Equiv.refl _
1065
1066
ext
1066
1067
rfl
1067
1068
1069
+ -- We use `as_aux_lemma` here to avoid creating large proof terms when using `simp`
1068
1070
@[simp]
1069
1071
theorem subtypeEquiv_symm {p : α → Prop } {q : β → Prop } (e : α ≃ β) (h : ∀ a : α, p a ↔ q (e a)) :
1070
1072
(e.subtypeEquiv h).symm =
1071
- e.symm.subtypeEquiv fun a => by
1073
+ e.symm.subtypeEquiv (by as_aux_lemma =>
1074
+ intro a
1072
1075
convert (h <| e.symm a).symm
1073
- exact (e.apply_symm_apply a).symm :=
1076
+ exact (e.apply_symm_apply a).symm) :=
1074
1077
rfl
1075
1078
1076
1079
@[simp]
1077
1080
theorem subtypeEquiv_trans {p : α → Prop } {q : β → Prop } {r : γ → Prop } (e : α ≃ β) (f : β ≃ γ)
1078
1081
(h : ∀ a : α, p a ↔ q (e a)) (h' : ∀ b : β, q b ↔ r (f b)) :
1079
1082
(e.subtypeEquiv h).trans (f.subtypeEquiv h')
1080
- = (e.trans f).subtypeEquiv fun a => (h a).trans (h' <| e a) :=
1081
- rfl
1082
-
1083
- @[simp]
1084
- theorem subtypeEquiv_apply {p : α → Prop } {q : β → Prop }
1085
- (e : α ≃ β) (h : ∀ a : α, p a ↔ q (e a)) (x : { x // p x }) :
1086
- e.subtypeEquiv h x = ⟨e x, (h _).1 x.2 ⟩ :=
1083
+ = (e.trans f).subtypeEquiv (by as_aux_lemma => exact fun a => (h a).trans (h' <| e a)) :=
1087
1084
rfl
1088
1085
1089
1086
/-- If two predicates `p` and `q` are pointwise equivalent, then `{x // p x}` is equivalent to
0 commit comments