l3lab/ntp-mathlib huggingface dataset:
@[simp]
theorem support_extend_domain (f : α ≃ Subtype p) {g : Perm α} :
    support (g.extendDomain f) = g.support.map f.asEmbedding := by
  ext b
  

Proof state:
case a
α : Type u_1
inst✝⁴ : DecidableEq α
inst✝³ : Fintype α
f✝ g✝ : Perm α
β : Type u_2
inst✝² : DecidableEq β
inst✝¹ : Fintype β
p : β → Prop
inst✝ : DecidablePred p
f : α ≃ Subtype p
g : Perm α
b : β
⊢ b ∈ support (extendDomain g f) ↔ b ∈ map (asEmbedding f) (support g)

Next tactic:
simp only [exists_prop, Function.Embedding.coeFn_mk, toEmbedding_apply, mem_map, Ne.def,
    Function.Embedding.trans_apply, mem_support]
@[simp]
theorem support_extend_domain (f : α ≃ Subtype p) {g : Perm α} :
    support (g.extendDomain f) = g.support.map f.asEmbedding := by
  ext b
  simp only [exists_prop, Function.Embedding.coeFn_mk, toEmbedding_apply, mem_map, Ne.def,
    Function.Embedding.trans_apply, mem_support]
  

Proof state:
case a
α : Type u_1
inst✝⁴ : DecidableEq α
inst✝³ : Fintype α
f✝ g✝ : Perm α
β : Type u_2
inst✝² : DecidableEq β
inst✝¹ : Fintype β
p : β → Prop
inst✝ : DecidablePred p
f : α ≃ Subtype p
g : Perm α
b : β
⊢ ¬(extendDomain g f) b = b ↔ ∃ a, ¬g a = a ∧ (asEmbedding f) a = b

Next tactic:
by_cases pb : p b
@[simp]
theorem support_extend_domain (f : α ≃ Subtype p) {g : Perm α} :
    support (g.extendDomain f) = g.support.map f.asEmbedding := by
  ext b
  simp only [exists_prop, Function.Embedding.coeFn_mk, toEmbedding_apply, mem_map, Ne.def,
    Function.Embedding.trans_apply, mem_support]
  by_cases pb : p b
  · 

Proof state:
case pos
α : Type u_1
inst✝⁴ : DecidableEq α
inst✝³ : Fintype α
f✝ g✝ : Perm α
β : Type u_2
inst✝² : DecidableEq β
inst✝¹ : Fintype β
p : β → Prop
inst✝ : DecidablePred p
f : α ≃ Subtype p
g : Perm α
b : β
pb : p b
⊢ ¬(extendDomain g f) b = b ↔ ∃ a, ¬g a = a ∧ (asEmbedding f) a = b

Next tactic:
rw [extendDomain_apply_subtype _ _ pb]
@[simp]
theorem support_extend_domain (f : α ≃ Subtype p) {g : Perm α} :
    support (g.extendDomain f) = g.support.map f.asEmbedding := by
  ext b
  simp only [exists_prop, Function.Embedding.coeFn_mk, toEmbedding_apply, mem_map, Ne.def,
    Function.Embedding.trans_apply, mem_support]
  by_cases pb : p b
  · rw [extendDomain_apply_subtype _ _ pb]
    

Proof state:
case pos
α : Type u_1
inst✝⁴ : DecidableEq α
inst✝³ : Fintype α
f✝ g✝ : Perm α
β : Type u_2
inst✝² : DecidableEq β
inst✝¹ : Fintype β
p : β → Prop
inst✝ : DecidablePred p
f : α ≃ Subtype p
g : Perm α
b : β
pb : p b
⊢ ¬↑(f (g (f.symm { val := b, property := pb }))) = b ↔ ∃ a, ¬g a = a ∧ (asEmbedding f) a = b

Next tactic:
constructor
@[simp]
theorem support_extend_domain (f : α ≃ Subtype p) {g : Perm α} :
    support (g.extendDomain f) = g.support.map f.asEmbedding := by
  ext b
  simp only [exists_prop, Function.Embedding.coeFn_mk, toEmbedding_apply, mem_map, Ne.def,
    Function.Embedding.trans_apply, mem_support]
  by_cases pb : p b
  · rw [extendDomain_apply_subtype _ _ pb]
    constructor
    · 

Proof state:
case pos.mp
α : Type u_1
inst✝⁴ : DecidableEq α
inst✝³ : Fintype α
f✝ g✝ : Perm α
β : Type u_2
inst✝² : DecidableEq β
inst✝¹ : Fintype β
p : β → Prop
inst✝ : DecidablePred p
f : α ≃ Subtype p
g : Perm α
b : β
pb : p b
⊢ ¬↑(f (g (f.symm { val := b, property := pb }))) = b → ∃ a, ¬g a = a ∧ (asEmbedding f) a = b

Next tactic:
rintro h
@[simp]
theorem support_extend_domain (f : α ≃ Subtype p) {g : Perm α} :
    support (g.extendDomain f) = g.support.map f.asEmbedding := by
  ext b
  simp only [exists_prop, Function.Embedding.coeFn_mk, toEmbedding_apply, mem_map, Ne.def,
    Function.Embedding.trans_apply, mem_support]
  by_cases pb : p b
  · rw [extendDomain_apply_subtype _ _ pb]
    constructor
    · rintro h
      

Proof state:
case pos.mp
α : Type u_1
inst✝⁴ : DecidableEq α
inst✝³ : Fintype α
f✝ g✝ : Perm α
β : Type u_2
inst✝² : DecidableEq β
inst✝¹ : Fintype β
p : β → Prop
inst✝ : DecidablePred p
f : α ≃ Subtype p
g : Perm α
b : β
pb : p b
h : ¬↑(f (g (f.symm { val := b, property := pb }))) = b
⊢ ∃ a, ¬g a = a ∧ (asEmbedding f) a = b

Next tactic:
refine' ⟨f.symm ⟨b, pb⟩, _, by simp⟩
@[simp]
theorem support_extend_domain (f : α ≃ Subtype p) {g : Perm α} :
    support (g.extendDomain f) = g.support.map f.asEmbedding := by
  ext b
  simp only [exists_prop, Function.Embedding.coeFn_mk, toEmbedding_apply, mem_map, Ne.def,
    Function.Embedding.trans_apply, mem_support]
  by_cases pb : p b
  · rw [extendDomain_apply_subtype _ _ pb]
    constructor
    · rintro h
      refine' ⟨f.symm ⟨b, pb⟩, _, by 

Proof state:
α : Type u_1
inst✝⁴ : DecidableEq α
inst✝³ : Fintype α
f✝ g✝ : Perm α
β : Type u_2
inst✝² : DecidableEq β
inst✝¹ : Fintype β
p : β → Prop
inst✝ : DecidablePred p
f : α ≃ Subtype p
g : Perm α
b : β
pb : p b
h : ¬↑(f (g (f.symm { val := b, property := pb }))) = b
⊢ (asEmbedding f) (f.symm { val := b, property := pb }) = b

Next tactic:
simp
@[simp]
theorem support_extend_domain (f : α ≃ Subtype p) {g : Perm α} :
    support (g.extendDomain f) = g.support.map f.asEmbedding := by
  ext b
  simp only [exists_prop, Function.Embedding.coeFn_mk, toEmbedding_apply, mem_map, Ne.def,
    Function.Embedding.trans_apply, mem_support]
  by_cases pb : p b
  · rw [extendDomain_apply_subtype _ _ pb]
    constructor
    · rintro h
      refine' ⟨f.symm ⟨b, pb⟩, _, by simp⟩
      

Proof state:
case pos.mp
α : Type u_1
inst✝⁴ : DecidableEq α
inst✝³ : Fintype α
f✝ g✝ : Perm α
β : Type u_2
inst✝² : DecidableEq β
inst✝¹ : Fintype β
p : β → Prop
inst✝ : DecidablePred p
f : α ≃ Subtype p
g : Perm α
b : β
pb : p b
h : ¬↑(f (g (f.symm { val := b, property := pb }))) = b
⊢ ¬g (f.symm { val := b, property := pb }) = f.symm { val := b, property := pb }

Next tactic:
contrapose! h
@[simp]
theorem support_extend_domain (f : α ≃ Subtype p) {g : Perm α} :
    support (g.extendDomain f) = g.support.map f.asEmbedding := by
  ext b
  simp only [exists_prop, Function.Embedding.coeFn_mk, toEmbedding_apply, mem_map, Ne.def,
    Function.Embedding.trans_apply, mem_support]
  by_cases pb : p b
  · rw [extendDomain_apply_subtype _ _ pb]
    constructor
    · rintro h
      refine' ⟨f.symm ⟨b, pb⟩, _, by simp⟩
      contrapose! h
      

Proof state:
case pos.mp
α : Type u_1
inst✝⁴ : DecidableEq α
inst✝³ : Fintype α
f✝ g✝ : Perm α
β : Type u_2
inst✝² : DecidableEq β
inst✝¹ : Fintype β
p : β → Prop
inst✝ : DecidablePred p
f : α ≃ Subtype p
g : Perm α
b : β
pb : p b
h : g (f.symm { val := b, property := pb }) = f.symm { val := b, property := pb }
⊢ ↑(f (g (f.symm { val := b, property := pb }))) = b

Next tactic:
simp [h]
@[simp]
theorem support_extend_domain (f : α ≃ Subtype p) {g : Perm α} :
    support (g.extendDomain f) = g.support.map f.asEmbedding := by
  ext b
  simp only [exists_prop, Function.Embedding.coeFn_mk, toEmbedding_apply, mem_map, Ne.def,
    Function.Embedding.trans_apply, mem_support]
  by_cases pb : p b
  · rw [extendDomain_apply_subtype _ _ pb]
    constructor
    · rintro h
      refine' ⟨f.symm ⟨b, pb⟩, _, by simp⟩
      contrapose! h
      simp [h]
    · 

Proof state:
case pos.mpr
α : Type u_1
inst✝⁴ : DecidableEq α
inst✝³ : Fintype α
f✝ g✝ : Perm α
β : Type u_2
inst✝² : DecidableEq β
inst✝¹ : Fintype β
p : β → Prop
inst✝ : DecidablePred p
f : α ≃ Subtype p
g : Perm α
b : β
pb : p b
⊢ (∃ a, ¬g a = a ∧ (asEmbedding f) a = b) → ¬↑(f (g (f.symm { val := b, property := pb }))) = b

Next tactic:
rintro ⟨a, ha, hb⟩
@[simp]
theorem support_extend_domain (f : α ≃ Subtype p) {g : Perm α} :
    support (g.extendDomain f) = g.support.map f.asEmbedding := by
  ext b
  simp only [exists_prop, Function.Embedding.coeFn_mk, toEmbedding_apply, mem_map, Ne.def,
    Function.Embedding.trans_apply, mem_support]
  by_cases pb : p b
  · rw [extendDomain_apply_subtype _ _ pb]
    constructor
    · rintro h
      refine' ⟨f.symm ⟨b, pb⟩, _, by simp⟩
      contrapose! h
      simp [h]
    · rintro ⟨a, ha, hb⟩
      

Proof state:
case pos.mpr.intro.intro
α : Type u_1
inst✝⁴ : DecidableEq α
inst✝³ : Fintype α
f✝ g✝ : Perm α
β : Type u_2
inst✝² : DecidableEq β
inst✝¹ : Fintype β
p : β → Prop
inst✝ : DecidablePred p
f : α ≃ Subtype p
g : Perm α
b : β
pb : p b
a : α
ha : ¬g a = a
hb : (asEmbedding f) a = b
⊢ ¬↑(f (g (f.symm { val := b, property := pb }))) = b

Next tactic:
contrapose! ha
@[simp]
theorem support_extend_domain (f : α ≃ Subtype p) {g : Perm α} :
    support (g.extendDomain f) = g.support.map f.asEmbedding := by
  ext b
  simp only [exists_prop, Function.Embedding.coeFn_mk, toEmbedding_apply, mem_map, Ne.def,
    Function.Embedding.trans_apply, mem_support]
  by_cases pb : p b
  · rw [extendDomain_apply_subtype _ _ pb]
    constructor
    · rintro h
      refine' ⟨f.symm ⟨b, pb⟩, _, by simp⟩
      contrapose! h
      simp [h]
    · rintro ⟨a, ha, hb⟩
      contrapose! ha
      

Proof state:
case pos.mpr.intro.intro
α : Type u_1
inst✝⁴ : DecidableEq α
inst✝³ : Fintype α
f✝ g✝ : Perm α
β : Type u_2
inst✝² : DecidableEq β
inst✝¹ : Fintype β
p : β → Prop
inst✝ : DecidablePred p
f : α ≃ Subtype p
g : Perm α
b : β
pb : p b
a : α
hb : (asEmbedding f) a = b
ha : ↑(f (g (f.symm { val := b, property := pb }))) = b
⊢ g a = a

Next tactic:
obtain rfl : a = f.symm ⟨b, pb⟩ := by
        rw [eq_symm_apply]
        exact Subtype.coe_injective hb
@[simp]
theorem support_extend_domain (f : α ≃ Subtype p) {g : Perm α} :
    support (g.extendDomain f) = g.support.map f.asEmbedding := by
  ext b
  simp only [exists_prop, Function.Embedding.coeFn_mk, toEmbedding_apply, mem_map, Ne.def,
    Function.Embedding.trans_apply, mem_support]
  by_cases pb : p b
  · rw [extendDomain_apply_subtype _ _ pb]
    constructor
    · rintro h
      refine' ⟨f.symm ⟨b, pb⟩, _, by simp⟩
      contrapose! h
      simp [h]
    · rintro ⟨a, ha, hb⟩
      contrapose! ha
      obtain rfl : a = f.symm ⟨b, pb⟩ := by
        

Proof state:
α : Type u_1
inst✝⁴ : DecidableEq α
inst✝³ : Fintype α
f✝ g✝ : Perm α
β : Type u_2
inst✝² : DecidableEq β
inst✝¹ : Fintype β
p : β → Prop
inst✝ : DecidablePred p
f : α ≃ Subtype p
g : Perm α
b : β
pb : p b
a : α
hb : (asEmbedding f) a = b
ha : ↑(f (g (f.symm { val := b, property := pb }))) = b
⊢ a = f.symm { val := b, property := pb }

Next tactic:
rw [eq_symm_apply]
@[simp]
theorem support_extend_domain (f : α ≃ Subtype p) {g : Perm α} :
    support (g.extendDomain f) = g.support.map f.asEmbedding := by
  ext b
  simp only [exists_prop, Function.Embedding.coeFn_mk, toEmbedding_apply, mem_map, Ne.def,
    Function.Embedding.trans_apply, mem_support]
  by_cases pb : p b
  · rw [extendDomain_apply_subtype _ _ pb]
    constructor
    · rintro h
      refine' ⟨f.symm ⟨b, pb⟩, _, by simp⟩
      contrapose! h
      simp [h]
    · rintro ⟨a, ha, hb⟩
      contrapose! ha
      obtain rfl : a = f.symm ⟨b, pb⟩ := by
        rw [eq_symm_apply]
        

Proof state:
α : Type u_1
inst✝⁴ : DecidableEq α
inst✝³ : Fintype α
f✝ g✝ : Perm α
β : Type u_2
inst✝² : DecidableEq β
inst✝¹ : Fintype β
p : β → Prop
inst✝ : DecidablePred p
f : α ≃ Subtype p
g : Perm α
b : β
pb : p b
a : α
hb : (asEmbedding f) a = b
ha : ↑(f (g (f.symm { val := b, property := pb }))) = b
⊢ f a = { val := b, property := pb }

Next tactic:
exact Subtype.coe_injective hb
@[simp]
theorem support_extend_domain (f : α ≃ Subtype p) {g : Perm α} :
    support (g.extendDomain f) = g.support.map f.asEmbedding := by
  ext b
  simp only [exists_prop, Function.Embedding.coeFn_mk, toEmbedding_apply, mem_map, Ne.def,
    Function.Embedding.trans_apply, mem_support]
  by_cases pb : p b
  · rw [extendDomain_apply_subtype _ _ pb]
    constructor
    · rintro h
      refine' ⟨f.symm ⟨b, pb⟩, _, by simp⟩
      contrapose! h
      simp [h]
    · rintro ⟨a, ha, hb⟩
      contrapose! ha
      obtain rfl : a = f.symm ⟨b, pb⟩ := by
        rw [eq_symm_apply]
        exact Subtype.coe_injective hb
      

Proof state:
case pos.mpr.intro.intro
α : Type u_1
inst✝⁴ : DecidableEq α
inst✝³ : Fintype α
f✝ g✝ : Perm α
β : Type u_2
inst✝² : DecidableEq β
inst✝¹ : Fintype β
p : β → Prop
inst✝ : DecidablePred p
f : α ≃ Subtype p
g : Perm α
b : β
pb : p b
ha : ↑(f (g (f.symm { val := b, property := pb }))) = b
hb : (asEmbedding f) (f.symm { val := b, property := pb }) = b
⊢ g (f.symm { val := b, property := pb }) = f.symm { val := b, property := pb }

Next tactic:
rw [eq_symm_apply]
@[simp]
theorem support_extend_domain (f : α ≃ Subtype p) {g : Perm α} :
    support (g.extendDomain f) = g.support.map f.asEmbedding := by
  ext b
  simp only [exists_prop, Function.Embedding.coeFn_mk, toEmbedding_apply, mem_map, Ne.def,
    Function.Embedding.trans_apply, mem_support]
  by_cases pb : p b
  · rw [extendDomain_apply_subtype _ _ pb]
    constructor
    · rintro h
      refine' ⟨f.symm ⟨b, pb⟩, _, by simp⟩
      contrapose! h
      simp [h]
    · rintro ⟨a, ha, hb⟩
      contrapose! ha
      obtain rfl : a = f.symm ⟨b, pb⟩ := by
        rw [eq_symm_apply]
        exact Subtype.coe_injective hb
      rw [eq_symm_apply]
      

Proof state:
case pos.mpr.intro.intro
α : Type u_1
inst✝⁴ : DecidableEq α
inst✝³ : Fintype α
f✝ g✝ : Perm α
β : Type u_2
inst✝² : DecidableEq β
inst✝¹ : Fintype β
p : β → Prop
inst✝ : DecidablePred p
f : α ≃ Subtype p
g : Perm α
b : β
pb : p b
ha : ↑(f (g (f.symm { val := b, property := pb }))) = b
hb : (asEmbedding f) (f.symm { val := b, property := pb }) = b
⊢ f (g (f.symm { val := b, property := pb })) = { val := b, property := pb }

Next tactic:
exact Subtype.coe_injective ha
@[simp]
theorem support_extend_domain (f : α ≃ Subtype p) {g : Perm α} :
    support (g.extendDomain f) = g.support.map f.asEmbedding := by
  ext b
  simp only [exists_prop, Function.Embedding.coeFn_mk, toEmbedding_apply, mem_map, Ne.def,
    Function.Embedding.trans_apply, mem_support]
  by_cases pb : p b
  · rw [extendDomain_apply_subtype _ _ pb]
    constructor
    · rintro h
      refine' ⟨f.symm ⟨b, pb⟩, _, by simp⟩
      contrapose! h
      simp [h]
    · rintro ⟨a, ha, hb⟩
      contrapose! ha
      obtain rfl : a = f.symm ⟨b, pb⟩ := by
        rw [eq_symm_apply]
        exact Subtype.coe_injective hb
      rw [eq_symm_apply]
      exact Subtype.coe_injective ha
  · 

Proof state:
case neg
α : Type u_1
inst✝⁴ : DecidableEq α
inst✝³ : Fintype α
f✝ g✝ : Perm α
β : Type u_2
inst✝² : DecidableEq β
inst✝¹ : Fintype β
p : β → Prop
inst✝ : DecidablePred p
f : α ≃ Subtype p
g : Perm α
b : β
pb : ¬p b
⊢ ¬(extendDomain g f) b = b ↔ ∃ a, ¬g a = a ∧ (asEmbedding f) a = b

Next tactic:
rw [extendDomain_apply_not_subtype _ _ pb]
@[simp]
theorem support_extend_domain (f : α ≃ Subtype p) {g : Perm α} :
    support (g.extendDomain f) = g.support.map f.asEmbedding := by
  ext b
  simp only [exists_prop, Function.Embedding.coeFn_mk, toEmbedding_apply, mem_map, Ne.def,
    Function.Embedding.trans_apply, mem_support]
  by_cases pb : p b
  · rw [extendDomain_apply_subtype _ _ pb]
    constructor
    · rintro h
      refine' ⟨f.symm ⟨b, pb⟩, _, by simp⟩
      contrapose! h
      simp [h]
    · rintro ⟨a, ha, hb⟩
      contrapose! ha
      obtain rfl : a = f.symm ⟨b, pb⟩ := by
        rw [eq_symm_apply]
        exact Subtype.coe_injective hb
      rw [eq_symm_apply]
      exact Subtype.coe_injective ha
  · rw [extendDomain_apply_not_subtype _ _ pb]
    

Proof state:
case neg
α : Type u_1
inst✝⁴ : DecidableEq α
inst✝³ : Fintype α
f✝ g✝ : Perm α
β : Type u_2
inst✝² : DecidableEq β
inst✝¹ : Fintype β
p : β → Prop
inst✝ : DecidablePred p
f : α ≃ Subtype p
g : Perm α
b : β
pb : ¬p b
⊢ ¬b = b ↔ ∃ a, ¬g a = a ∧ (asEmbedding f) a = b

Next tactic:
simp only [not_exists, false_iff_iff, not_and, eq_self_iff_true, not_true]
@[simp]
theorem support_extend_domain (f : α ≃ Subtype p) {g : Perm α} :
    support (g.extendDomain f) = g.support.map f.asEmbedding := by
  ext b
  simp only [exists_prop, Function.Embedding.coeFn_mk, toEmbedding_apply, mem_map, Ne.def,
    Function.Embedding.trans_apply, mem_support]
  by_cases pb : p b
  · rw [extendDomain_apply_subtype _ _ pb]
    constructor
    · rintro h
      refine' ⟨f.symm ⟨b, pb⟩, _, by simp⟩
      contrapose! h
      simp [h]
    · rintro ⟨a, ha, hb⟩
      contrapose! ha
      obtain rfl : a = f.symm ⟨b, pb⟩ := by
        rw [eq_symm_apply]
        exact Subtype.coe_injective hb
      rw [eq_symm_apply]
      exact Subtype.coe_injective ha
  · rw [extendDomain_apply_not_subtype _ _ pb]
    simp only [not_exists, false_iff_iff, not_and, eq_self_iff_true, not_true]
    

Proof state:
case neg
α : Type u_1
inst✝⁴ : DecidableEq α
inst✝³ : Fintype α
f✝ g✝ : Perm α
β : Type u_2
inst✝² : DecidableEq β
inst✝¹ : Fintype β
p : β → Prop
inst✝ : DecidablePred p
f : α ≃ Subtype p
g : Perm α
b : β
pb : ¬p b
⊢ ∀ (x : α), ¬g x = x → ¬(asEmbedding f) x = b

Next tactic:
rintro a _ rfl
@[simp]
theorem support_extend_domain (f : α ≃ Subtype p) {g : Perm α} :
    support (g.extendDomain f) = g.support.map f.asEmbedding := by
  ext b
  simp only [exists_prop, Function.Embedding.coeFn_mk, toEmbedding_apply, mem_map, Ne.def,
    Function.Embedding.trans_apply, mem_support]
  by_cases pb : p b
  · rw [extendDomain_apply_subtype _ _ pb]
    constructor
    · rintro h
      refine' ⟨f.symm ⟨b, pb⟩, _, by simp⟩
      contrapose! h
      simp [h]
    · rintro ⟨a, ha, hb⟩
      contrapose! ha
      obtain rfl : a = f.symm ⟨b, pb⟩ := by
        rw [eq_symm_apply]
        exact Subtype.coe_injective hb
      rw [eq_symm_apply]
      exact Subtype.coe_injective ha
  · rw [extendDomain_apply_not_subtype _ _ pb]
    simp only [not_exists, false_iff_iff, not_and, eq_self_iff_true, not_true]
    rintro a _ rfl
    

Proof state:
case neg
α : Type u_1
inst✝⁴ : DecidableEq α
inst✝³ : Fintype α
f✝ g✝ : Perm α
β : Type u_2
inst✝² : DecidableEq β
inst✝¹ : Fintype β
p : β → Prop
inst✝ : DecidablePred p
f : α ≃ Subtype p
g : Perm α
a : α
a✝ : ¬g a = a
pb : ¬p ((asEmbedding f) a)
⊢ False

Next tactic:
exact pb (Subtype.prop _)
theorem card_support_extend_domain (f : α ≃ Subtype p) {g : Perm α} :
    (g.extendDomain f).support.card = g.support.card := by 

Proof state:
α : Type u_1
inst✝⁴ : DecidableEq α
inst✝³ : Fintype α
f✝ g✝ : Perm α
β : Type u_2
inst✝² : DecidableEq β
inst✝¹ : Fintype β
p : β → Prop
inst✝ : DecidablePred p
f : α ≃ Subtype p
g : Perm α
⊢ card (support (extendDomain g f)) = card (support g)

Next tactic:
simp
theorem card_support_eq_zero {f : Perm α} : f.support.card = 0 ↔ f = 1 := by
  

Proof state:
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
f✝ g f : Perm α
⊢ card (support f) = 0 ↔ f = 1

Next tactic:
rw [Finset.card_eq_zero, support_eq_empty_iff]
theorem one_lt_card_support_of_ne_one {f : Perm α} (h : f ≠ 1) : 1 < f.support.card := by
  

Proof state:
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
f✝ g f : Perm α
h : f ≠ 1
⊢ 1 < card (support f)

Next tactic:
simp_rw [one_lt_card_iff, mem_support, ← not_or]
theorem one_lt_card_support_of_ne_one {f : Perm α} (h : f ≠ 1) : 1 < f.support.card := by
  simp_rw [one_lt_card_iff, mem_support, ← not_or]
  

Proof state:
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
f✝ g f : Perm α
h : f ≠ 1
⊢ ∃ a b, ¬(f a = a ∨ f b = b ∨ a = b)

Next tactic:
contrapose! h
theorem one_lt_card_support_of_ne_one {f : Perm α} (h : f ≠ 1) : 1 < f.support.card := by
  simp_rw [one_lt_card_iff, mem_support, ← not_or]
  contrapose! h
  

Proof state:
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
f✝ g f : Perm α
h : ∀ (a b : α), f a = a ∨ f b = b ∨ a = b
⊢ f = 1

Next tactic:
ext a
theorem one_lt_card_support_of_ne_one {f : Perm α} (h : f ≠ 1) : 1 < f.support.card := by
  simp_rw [one_lt_card_iff, mem_support, ← not_or]
  contrapose! h
  ext a
  

Proof state:
case H
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
f✝ g f : Perm α
h : ∀ (a b : α), f a = a ∨ f b = b ∨ a = b
a : α
⊢ f a = 1 a

Next tactic:
specialize h (f a) a
theorem one_lt_card_support_of_ne_one {f : Perm α} (h : f ≠ 1) : 1 < f.support.card := by
  simp_rw [one_lt_card_iff, mem_support, ← not_or]
  contrapose! h
  ext a
  specialize h (f a) a
  

Proof state:
case H
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
f✝ g f : Perm α
a : α
h : f (f a) = f a ∨ f a = a ∨ f a = a
⊢ f a = 1 a

Next tactic:
rwa [apply_eq_iff_eq, or_self_iff, or_self_iff] at h
theorem card_support_ne_one (f : Perm α) : f.support.card ≠ 1 := by
  

Proof state:
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
f✝ g f : Perm α
⊢ card (support f) ≠ 1

Next tactic:
by_cases h : f = 1
theorem card_support_ne_one (f : Perm α) : f.support.card ≠ 1 := by
  by_cases h : f = 1
  · 

Proof state:
case pos
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
f✝ g f : Perm α
h : f = 1
⊢ card (support f) ≠ 1

Next tactic:
exact ne_of_eq_of_ne (card_support_eq_zero.mpr h) zero_ne_one
theorem card_support_ne_one (f : Perm α) : f.support.card ≠ 1 := by
  by_cases h : f = 1
  · exact ne_of_eq_of_ne (card_support_eq_zero.mpr h) zero_ne_one
  · 

Proof state:
case neg
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
f✝ g f : Perm α
h : ¬f = 1
⊢ card (support f) ≠ 1

Next tactic:
exact ne_of_gt (one_lt_card_support_of_ne_one h)
@[simp]
theorem card_support_le_one {f : Perm α} : f.support.card ≤ 1 ↔ f = 1 := by
  

Proof state:
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
f✝ g f : Perm α
⊢ card (support f) ≤ 1 ↔ f = 1

Next tactic:
rw [le_iff_lt_or_eq, Nat.lt_succ_iff, le_zero_iff, card_support_eq_zero, or_iff_not_imp_right,
    imp_iff_right f.card_support_ne_one]
theorem card_support_swap_mul {f : Perm α} {x : α} (hx : f x ≠ x) :
    (swap x (f x) * f).support.card < f.support.card :=
  Finset.card_lt_card
    ⟨fun z hz => (mem_support_swap_mul_imp_mem_support_ne hz).left, fun h =>
      absurd (h (mem_support.2 hx)) (mt mem_support.1 (by 

Proof state:
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
f✝ g f : Perm α
x : α
hx : f x ≠ x
h : support f ⊆ support (swap x (f x) * f)
⊢ ¬(swap x (f x) * f) x ≠ x

Next tactic:
simp
theorem card_support_swap {x y : α} (hxy : x ≠ y) : (swap x y).support.card = 2 :=
  show (swap x y).support.card = Finset.card ⟨x ::ₘ y ::ₘ 0, by 

Proof state:
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
f g : Perm α
x y : α
hxy : x ≠ y
⊢ Multiset.Nodup (x ::ₘ y ::ₘ 0)

Next tactic:
simp [hxy]
theorem card_support_swap {x y : α} (hxy : x ≠ y) : (swap x y).support.card = 2 :=
  show (swap x y).support.card = Finset.card ⟨x ::ₘ y ::ₘ 0, by simp [hxy]⟩ from
    congr_arg card <| by 

Proof state:
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
f g : Perm α
x y : α
hxy : x ≠ y
⊢ support (swap x y) = { val := x ::ₘ y ::ₘ 0, nodup := (_ : Multiset.Nodup (x ::ₘ {y})) }

Next tactic:
simp [support_swap hxy, *, Finset.ext_iff]
@[simp]
theorem card_support_eq_two {f : Perm α} : f.support.card = 2 ↔ IsSwap f := by
  

Proof state:
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
f✝ g f : Perm α
⊢ card (support f) = 2 ↔ IsSwap f

Next tactic:
constructor
@[simp]
theorem card_support_eq_two {f : Perm α} : f.support.card = 2 ↔ IsSwap f := by
  constructor <;> 

Proof state:
case mp
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
f✝ g f : Perm α
⊢ card (support f) = 2 → IsSwap f

Next tactic:
intro h
@[simp]
theorem card_support_eq_two {f : Perm α} : f.support.card = 2 ↔ IsSwap f := by
  constructor <;> 

Proof state:
case mpr
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
f✝ g f : Perm α
⊢ IsSwap f → card (support f) = 2

Next tactic:
intro h
@[simp]
theorem card_support_eq_two {f : Perm α} : f.support.card = 2 ↔ IsSwap f := by
  constructor <;> intro h
  · 

Proof state:
case mp
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
f✝ g f : Perm α
h : card (support f) = 2
⊢ IsSwap f

Next tactic:
obtain ⟨x, t, hmem, hins, ht⟩ := card_eq_succ.1 h
@[simp]
theorem card_support_eq_two {f : Perm α} : f.support.card = 2 ↔ IsSwap f := by
  constructor <;> intro h
  · obtain ⟨x, t, hmem, hins, ht⟩ := card_eq_succ.1 h
    

Proof state:
case mp.intro.intro.intro.intro
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
f✝ g f : Perm α
h : card (support f) = 2
x : α
t : Finset α
hmem : x ∉ t
hins : insert x t = support f
ht : card t = 1
⊢ IsSwap f

Next tactic:
obtain ⟨y, rfl⟩ := card_eq_one.1 ht
@[simp]
theorem card_support_eq_two {f : Perm α} : f.support.card = 2 ↔ IsSwap f := by
  constructor <;> intro h
  · obtain ⟨x, t, hmem, hins, ht⟩ := card_eq_succ.1 h
    obtain ⟨y, rfl⟩ := card_eq_one.1 ht
    

Proof state:
case mp.intro.intro.intro.intro.intro
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
f✝ g f : Perm α
h : card (support f) = 2
x y : α
hmem : x ∉ {y}
hins : {x, y} = support f
ht : card {y} = 1
⊢ IsSwap f

Next tactic:
rw [mem_singleton] at hmem