l3lab/ntp-mathlib huggingface dataset:
instance (priority := 100) : NormalizedGCDMonoid G₀ where
  normUnit x := if h : x = 0 then 1 else (Units.mk0 x h)⁻¹
  normUnit_zero := dif_pos rfl
  normUnit_mul := fun {x y} x0 y0 => Units.eq_iff.1 (by
    -- Porting note: need `dsimp only`, also `simp` reaches maximum heartbeat
    -- by Units.eq_iff.mp (by simp only [x0, y0, mul_comm])
    dsimp only
    split_ifs with h
    · rw [mul_eq_zero] at h
      cases h
      · exact absurd ‹x = 0› x0
      · exact absurd ‹y = 0› y0
    · rw [Units.mk0_mul, mul_inv_rev, mul_comm] )
  normUnit_coe_units u := by
    -- Porting note: need `dsimp only`
    dsimp only
    rw [dif_neg (Units.ne_zero _), Units.mk0_val]
  gcd a b := if a = 0 ∧ b = 0 then 0 else 1
  lcm a b := if a = 0 ∨ b = 0 then 0 else 1
  gcd_dvd_left a b := by
    -- Porting note: need `dsimp only`
    dsimp only
    split_ifs with h
    · rw [h.1]
    · exact one_dvd _
  gcd_dvd_right a b := by
    -- Porting note: need `dsimp only`
    dsimp only
    split_ifs with h
    · rw [h.2]
    · exact one_dvd _
  dvd_gcd := fun {a b c} hac hab => by
    -- Porting note: need `dsimp only`
    dsimp only
    split_ifs with h
    · apply dvd_zero
    · rw [not_and_or] at h
      cases h
      · refine' isUnit_iff_dvd_one.mp (isUnit_of_dvd_unit _ (IsUnit.mk0 _ ‹c ≠ 0›))
        exact hac
      · refine' isUnit_iff_dvd_one.mp (isUnit_of_dvd_unit _ (IsUnit.mk0 _ ‹b ≠ 0›))
        exact hab
  gcd_mul_lcm a b := by
    by_cases ha : a = 0
    · simp only [ha, true_and, true_or, ite_true, mul_zero, zero_mul]
      exact Associated.refl _
    · by_cases hb : b = 0
      · simp only [hb, and_true, or_true, ite_true, mul_zero]
        

Proof state:
case pos
α : Type u_1
G₀ : Type u_2
inst✝¹ : CommGroupWithZero G₀
inst✝ : DecidableEq G₀
a b : G₀
ha : ¬a = 0
hb : b = 0
⊢ Associated 0 0

Next tactic:
exact Associated.refl _
instance (priority := 100) : NormalizedGCDMonoid G₀ where
  normUnit x := if h : x = 0 then 1 else (Units.mk0 x h)⁻¹
  normUnit_zero := dif_pos rfl
  normUnit_mul := fun {x y} x0 y0 => Units.eq_iff.1 (by
    -- Porting note: need `dsimp only`, also `simp` reaches maximum heartbeat
    -- by Units.eq_iff.mp (by simp only [x0, y0, mul_comm])
    dsimp only
    split_ifs with h
    · rw [mul_eq_zero] at h
      cases h
      · exact absurd ‹x = 0› x0
      · exact absurd ‹y = 0› y0
    · rw [Units.mk0_mul, mul_inv_rev, mul_comm] )
  normUnit_coe_units u := by
    -- Porting note: need `dsimp only`
    dsimp only
    rw [dif_neg (Units.ne_zero _), Units.mk0_val]
  gcd a b := if a = 0 ∧ b = 0 then 0 else 1
  lcm a b := if a = 0 ∨ b = 0 then 0 else 1
  gcd_dvd_left a b := by
    -- Porting note: need `dsimp only`
    dsimp only
    split_ifs with h
    · rw [h.1]
    · exact one_dvd _
  gcd_dvd_right a b := by
    -- Porting note: need `dsimp only`
    dsimp only
    split_ifs with h
    · rw [h.2]
    · exact one_dvd _
  dvd_gcd := fun {a b c} hac hab => by
    -- Porting note: need `dsimp only`
    dsimp only
    split_ifs with h
    · apply dvd_zero
    · rw [not_and_or] at h
      cases h
      · refine' isUnit_iff_dvd_one.mp (isUnit_of_dvd_unit _ (IsUnit.mk0 _ ‹c ≠ 0›))
        exact hac
      · refine' isUnit_iff_dvd_one.mp (isUnit_of_dvd_unit _ (IsUnit.mk0 _ ‹b ≠ 0›))
        exact hab
  gcd_mul_lcm a b := by
    by_cases ha : a = 0
    · simp only [ha, true_and, true_or, ite_true, mul_zero, zero_mul]
      exact Associated.refl _
    · by_cases hb : b = 0
      · simp only [hb, and_true, or_true, ite_true, mul_zero]
        exact Associated.refl _
      -- Porting note: need `dsimp only`
      · 

Proof state:
case neg
α : Type u_1
G₀ : Type u_2
inst✝¹ : CommGroupWithZero G₀
inst✝ : DecidableEq G₀
a b : G₀
ha : ¬a = 0
hb : ¬b = 0
⊢ Associated ((fun a b => if a = 0 ∧ b = 0 then 0 else 1) a b * (fun a b => if a = 0 ∨ b = 0 then 0 else 1) a b) (a * b)

Next tactic:
dsimp only
instance (priority := 100) : NormalizedGCDMonoid G₀ where
  normUnit x := if h : x = 0 then 1 else (Units.mk0 x h)⁻¹
  normUnit_zero := dif_pos rfl
  normUnit_mul := fun {x y} x0 y0 => Units.eq_iff.1 (by
    -- Porting note: need `dsimp only`, also `simp` reaches maximum heartbeat
    -- by Units.eq_iff.mp (by simp only [x0, y0, mul_comm])
    dsimp only
    split_ifs with h
    · rw [mul_eq_zero] at h
      cases h
      · exact absurd ‹x = 0› x0
      · exact absurd ‹y = 0› y0
    · rw [Units.mk0_mul, mul_inv_rev, mul_comm] )
  normUnit_coe_units u := by
    -- Porting note: need `dsimp only`
    dsimp only
    rw [dif_neg (Units.ne_zero _), Units.mk0_val]
  gcd a b := if a = 0 ∧ b = 0 then 0 else 1
  lcm a b := if a = 0 ∨ b = 0 then 0 else 1
  gcd_dvd_left a b := by
    -- Porting note: need `dsimp only`
    dsimp only
    split_ifs with h
    · rw [h.1]
    · exact one_dvd _
  gcd_dvd_right a b := by
    -- Porting note: need `dsimp only`
    dsimp only
    split_ifs with h
    · rw [h.2]
    · exact one_dvd _
  dvd_gcd := fun {a b c} hac hab => by
    -- Porting note: need `dsimp only`
    dsimp only
    split_ifs with h
    · apply dvd_zero
    · rw [not_and_or] at h
      cases h
      · refine' isUnit_iff_dvd_one.mp (isUnit_of_dvd_unit _ (IsUnit.mk0 _ ‹c ≠ 0›))
        exact hac
      · refine' isUnit_iff_dvd_one.mp (isUnit_of_dvd_unit _ (IsUnit.mk0 _ ‹b ≠ 0›))
        exact hab
  gcd_mul_lcm a b := by
    by_cases ha : a = 0
    · simp only [ha, true_and, true_or, ite_true, mul_zero, zero_mul]
      exact Associated.refl _
    · by_cases hb : b = 0
      · simp only [hb, and_true, or_true, ite_true, mul_zero]
        exact Associated.refl _
      -- Porting note: need `dsimp only`
      · dsimp only
        

Proof state:
case neg
α : Type u_1
G₀ : Type u_2
inst✝¹ : CommGroupWithZero G₀
inst✝ : DecidableEq G₀
a b : G₀
ha : ¬a = 0
hb : ¬b = 0
⊢ Associated ((if a = 0 ∧ b = 0 then 0 else 1) * if a = 0 ∨ b = 0 then 0 else 1) (a * b)

Next tactic:
rw [if_neg (not_and_of_not_left _ ha), one_mul, if_neg (not_or_of_not ha hb)]
instance (priority := 100) : NormalizedGCDMonoid G₀ where
  normUnit x := if h : x = 0 then 1 else (Units.mk0 x h)⁻¹
  normUnit_zero := dif_pos rfl
  normUnit_mul := fun {x y} x0 y0 => Units.eq_iff.1 (by
    -- Porting note: need `dsimp only`, also `simp` reaches maximum heartbeat
    -- by Units.eq_iff.mp (by simp only [x0, y0, mul_comm])
    dsimp only
    split_ifs with h
    · rw [mul_eq_zero] at h
      cases h
      · exact absurd ‹x = 0› x0
      · exact absurd ‹y = 0› y0
    · rw [Units.mk0_mul, mul_inv_rev, mul_comm] )
  normUnit_coe_units u := by
    -- Porting note: need `dsimp only`
    dsimp only
    rw [dif_neg (Units.ne_zero _), Units.mk0_val]
  gcd a b := if a = 0 ∧ b = 0 then 0 else 1
  lcm a b := if a = 0 ∨ b = 0 then 0 else 1
  gcd_dvd_left a b := by
    -- Porting note: need `dsimp only`
    dsimp only
    split_ifs with h
    · rw [h.1]
    · exact one_dvd _
  gcd_dvd_right a b := by
    -- Porting note: need `dsimp only`
    dsimp only
    split_ifs with h
    · rw [h.2]
    · exact one_dvd _
  dvd_gcd := fun {a b c} hac hab => by
    -- Porting note: need `dsimp only`
    dsimp only
    split_ifs with h
    · apply dvd_zero
    · rw [not_and_or] at h
      cases h
      · refine' isUnit_iff_dvd_one.mp (isUnit_of_dvd_unit _ (IsUnit.mk0 _ ‹c ≠ 0›))
        exact hac
      · refine' isUnit_iff_dvd_one.mp (isUnit_of_dvd_unit _ (IsUnit.mk0 _ ‹b ≠ 0›))
        exact hab
  gcd_mul_lcm a b := by
    by_cases ha : a = 0
    · simp only [ha, true_and, true_or, ite_true, mul_zero, zero_mul]
      exact Associated.refl _
    · by_cases hb : b = 0
      · simp only [hb, and_true, or_true, ite_true, mul_zero]
        exact Associated.refl _
      -- Porting note: need `dsimp only`
      · dsimp only
        rw [if_neg (not_and_of_not_left _ ha), one_mul, if_neg (not_or_of_not ha hb)]
        

Proof state:
case neg
α : Type u_1
G₀ : Type u_2
inst✝¹ : CommGroupWithZero G₀
inst✝ : DecidableEq G₀
a b : G₀
ha : ¬a = 0
hb : ¬b = 0
⊢ Associated 1 (a * b)

Next tactic:
exact (associated_one_iff_isUnit.mpr ((IsUnit.mk0 _ ha).mul (IsUnit.mk0 _ hb))).symm
instance (priority := 100) : NormalizedGCDMonoid G₀ where
  normUnit x := if h : x = 0 then 1 else (Units.mk0 x h)⁻¹
  normUnit_zero := dif_pos rfl
  normUnit_mul := fun {x y} x0 y0 => Units.eq_iff.1 (by
    -- Porting note: need `dsimp only`, also `simp` reaches maximum heartbeat
    -- by Units.eq_iff.mp (by simp only [x0, y0, mul_comm])
    dsimp only
    split_ifs with h
    · rw [mul_eq_zero] at h
      cases h
      · exact absurd ‹x = 0› x0
      · exact absurd ‹y = 0› y0
    · rw [Units.mk0_mul, mul_inv_rev, mul_comm] )
  normUnit_coe_units u := by
    -- Porting note: need `dsimp only`
    dsimp only
    rw [dif_neg (Units.ne_zero _), Units.mk0_val]
  gcd a b := if a = 0 ∧ b = 0 then 0 else 1
  lcm a b := if a = 0 ∨ b = 0 then 0 else 1
  gcd_dvd_left a b := by
    -- Porting note: need `dsimp only`
    dsimp only
    split_ifs with h
    · rw [h.1]
    · exact one_dvd _
  gcd_dvd_right a b := by
    -- Porting note: need `dsimp only`
    dsimp only
    split_ifs with h
    · rw [h.2]
    · exact one_dvd _
  dvd_gcd := fun {a b c} hac hab => by
    -- Porting note: need `dsimp only`
    dsimp only
    split_ifs with h
    · apply dvd_zero
    · rw [not_and_or] at h
      cases h
      · refine' isUnit_iff_dvd_one.mp (isUnit_of_dvd_unit _ (IsUnit.mk0 _ ‹c ≠ 0›))
        exact hac
      · refine' isUnit_iff_dvd_one.mp (isUnit_of_dvd_unit _ (IsUnit.mk0 _ ‹b ≠ 0›))
        exact hab
  gcd_mul_lcm a b := by
    by_cases ha : a = 0
    · simp only [ha, true_and, true_or, ite_true, mul_zero, zero_mul]
      exact Associated.refl _
    · by_cases hb : b = 0
      · simp only [hb, and_true, or_true, ite_true, mul_zero]
        exact Associated.refl _
      -- Porting note: need `dsimp only`
      · dsimp only
        rw [if_neg (not_and_of_not_left _ ha), one_mul, if_neg (not_or_of_not ha hb)]
        exact (associated_one_iff_isUnit.mpr ((IsUnit.mk0 _ ha).mul (IsUnit.mk0 _ hb))).symm
  lcm_zero_left b := if_pos (Or.inl rfl)
  lcm_zero_right a := if_pos (Or.inr rfl)
  -- `split_ifs` wants to split `normalize`, so handle the cases manually
  normalize_gcd a b := if h : a = 0 ∧ b = 0 then by 

Proof state:
α : Type u_1
G₀ : Type u_2
inst✝¹ : CommGroupWithZero G₀
inst✝ : DecidableEq G₀
a b : G₀
h : a = 0 ∧ b = 0
⊢ normalize (gcd a b) = gcd a b

Next tactic:
simp [if_pos h]
instance (priority := 100) : NormalizedGCDMonoid G₀ where
  normUnit x := if h : x = 0 then 1 else (Units.mk0 x h)⁻¹
  normUnit_zero := dif_pos rfl
  normUnit_mul := fun {x y} x0 y0 => Units.eq_iff.1 (by
    -- Porting note: need `dsimp only`, also `simp` reaches maximum heartbeat
    -- by Units.eq_iff.mp (by simp only [x0, y0, mul_comm])
    dsimp only
    split_ifs with h
    · rw [mul_eq_zero] at h
      cases h
      · exact absurd ‹x = 0› x0
      · exact absurd ‹y = 0› y0
    · rw [Units.mk0_mul, mul_inv_rev, mul_comm] )
  normUnit_coe_units u := by
    -- Porting note: need `dsimp only`
    dsimp only
    rw [dif_neg (Units.ne_zero _), Units.mk0_val]
  gcd a b := if a = 0 ∧ b = 0 then 0 else 1
  lcm a b := if a = 0 ∨ b = 0 then 0 else 1
  gcd_dvd_left a b := by
    -- Porting note: need `dsimp only`
    dsimp only
    split_ifs with h
    · rw [h.1]
    · exact one_dvd _
  gcd_dvd_right a b := by
    -- Porting note: need `dsimp only`
    dsimp only
    split_ifs with h
    · rw [h.2]
    · exact one_dvd _
  dvd_gcd := fun {a b c} hac hab => by
    -- Porting note: need `dsimp only`
    dsimp only
    split_ifs with h
    · apply dvd_zero
    · rw [not_and_or] at h
      cases h
      · refine' isUnit_iff_dvd_one.mp (isUnit_of_dvd_unit _ (IsUnit.mk0 _ ‹c ≠ 0›))
        exact hac
      · refine' isUnit_iff_dvd_one.mp (isUnit_of_dvd_unit _ (IsUnit.mk0 _ ‹b ≠ 0›))
        exact hab
  gcd_mul_lcm a b := by
    by_cases ha : a = 0
    · simp only [ha, true_and, true_or, ite_true, mul_zero, zero_mul]
      exact Associated.refl _
    · by_cases hb : b = 0
      · simp only [hb, and_true, or_true, ite_true, mul_zero]
        exact Associated.refl _
      -- Porting note: need `dsimp only`
      · dsimp only
        rw [if_neg (not_and_of_not_left _ ha), one_mul, if_neg (not_or_of_not ha hb)]
        exact (associated_one_iff_isUnit.mpr ((IsUnit.mk0 _ ha).mul (IsUnit.mk0 _ hb))).symm
  lcm_zero_left b := if_pos (Or.inl rfl)
  lcm_zero_right a := if_pos (Or.inr rfl)
  -- `split_ifs` wants to split `normalize`, so handle the cases manually
  normalize_gcd a b := if h : a = 0 ∧ b = 0 then by simp [if_pos h] else by 

Proof state:
α : Type u_1
G₀ : Type u_2
inst✝¹ : CommGroupWithZero G₀
inst✝ : DecidableEq G₀
a b : G₀
h : ¬(a = 0 ∧ b = 0)
⊢ normalize (gcd a b) = gcd a b

Next tactic:
simp [if_neg h]
instance (priority := 100) : NormalizedGCDMonoid G₀ where
  normUnit x := if h : x = 0 then 1 else (Units.mk0 x h)⁻¹
  normUnit_zero := dif_pos rfl
  normUnit_mul := fun {x y} x0 y0 => Units.eq_iff.1 (by
    -- Porting note: need `dsimp only`, also `simp` reaches maximum heartbeat
    -- by Units.eq_iff.mp (by simp only [x0, y0, mul_comm])
    dsimp only
    split_ifs with h
    · rw [mul_eq_zero] at h
      cases h
      · exact absurd ‹x = 0› x0
      · exact absurd ‹y = 0› y0
    · rw [Units.mk0_mul, mul_inv_rev, mul_comm] )
  normUnit_coe_units u := by
    -- Porting note: need `dsimp only`
    dsimp only
    rw [dif_neg (Units.ne_zero _), Units.mk0_val]
  gcd a b := if a = 0 ∧ b = 0 then 0 else 1
  lcm a b := if a = 0 ∨ b = 0 then 0 else 1
  gcd_dvd_left a b := by
    -- Porting note: need `dsimp only`
    dsimp only
    split_ifs with h
    · rw [h.1]
    · exact one_dvd _
  gcd_dvd_right a b := by
    -- Porting note: need `dsimp only`
    dsimp only
    split_ifs with h
    · rw [h.2]
    · exact one_dvd _
  dvd_gcd := fun {a b c} hac hab => by
    -- Porting note: need `dsimp only`
    dsimp only
    split_ifs with h
    · apply dvd_zero
    · rw [not_and_or] at h
      cases h
      · refine' isUnit_iff_dvd_one.mp (isUnit_of_dvd_unit _ (IsUnit.mk0 _ ‹c ≠ 0›))
        exact hac
      · refine' isUnit_iff_dvd_one.mp (isUnit_of_dvd_unit _ (IsUnit.mk0 _ ‹b ≠ 0›))
        exact hab
  gcd_mul_lcm a b := by
    by_cases ha : a = 0
    · simp only [ha, true_and, true_or, ite_true, mul_zero, zero_mul]
      exact Associated.refl _
    · by_cases hb : b = 0
      · simp only [hb, and_true, or_true, ite_true, mul_zero]
        exact Associated.refl _
      -- Porting note: need `dsimp only`
      · dsimp only
        rw [if_neg (not_and_of_not_left _ ha), one_mul, if_neg (not_or_of_not ha hb)]
        exact (associated_one_iff_isUnit.mpr ((IsUnit.mk0 _ ha).mul (IsUnit.mk0 _ hb))).symm
  lcm_zero_left b := if_pos (Or.inl rfl)
  lcm_zero_right a := if_pos (Or.inr rfl)
  -- `split_ifs` wants to split `normalize`, so handle the cases manually
  normalize_gcd a b := if h : a = 0 ∧ b = 0 then by simp [if_pos h] else by simp [if_neg h]
  normalize_lcm a b := if h : a = 0 ∨ b = 0 then by 

Proof state:
α : Type u_1
G₀ : Type u_2
inst✝¹ : CommGroupWithZero G₀
inst✝ : DecidableEq G₀
a b : G₀
h : a = 0 ∨ b = 0
⊢ normalize (lcm a b) = lcm a b

Next tactic:
simp [if_pos h]
instance (priority := 100) : NormalizedGCDMonoid G₀ where
  normUnit x := if h : x = 0 then 1 else (Units.mk0 x h)⁻¹
  normUnit_zero := dif_pos rfl
  normUnit_mul := fun {x y} x0 y0 => Units.eq_iff.1 (by
    -- Porting note: need `dsimp only`, also `simp` reaches maximum heartbeat
    -- by Units.eq_iff.mp (by simp only [x0, y0, mul_comm])
    dsimp only
    split_ifs with h
    · rw [mul_eq_zero] at h
      cases h
      · exact absurd ‹x = 0› x0
      · exact absurd ‹y = 0› y0
    · rw [Units.mk0_mul, mul_inv_rev, mul_comm] )
  normUnit_coe_units u := by
    -- Porting note: need `dsimp only`
    dsimp only
    rw [dif_neg (Units.ne_zero _), Units.mk0_val]
  gcd a b := if a = 0 ∧ b = 0 then 0 else 1
  lcm a b := if a = 0 ∨ b = 0 then 0 else 1
  gcd_dvd_left a b := by
    -- Porting note: need `dsimp only`
    dsimp only
    split_ifs with h
    · rw [h.1]
    · exact one_dvd _
  gcd_dvd_right a b := by
    -- Porting note: need `dsimp only`
    dsimp only
    split_ifs with h
    · rw [h.2]
    · exact one_dvd _
  dvd_gcd := fun {a b c} hac hab => by
    -- Porting note: need `dsimp only`
    dsimp only
    split_ifs with h
    · apply dvd_zero
    · rw [not_and_or] at h
      cases h
      · refine' isUnit_iff_dvd_one.mp (isUnit_of_dvd_unit _ (IsUnit.mk0 _ ‹c ≠ 0›))
        exact hac
      · refine' isUnit_iff_dvd_one.mp (isUnit_of_dvd_unit _ (IsUnit.mk0 _ ‹b ≠ 0›))
        exact hab
  gcd_mul_lcm a b := by
    by_cases ha : a = 0
    · simp only [ha, true_and, true_or, ite_true, mul_zero, zero_mul]
      exact Associated.refl _
    · by_cases hb : b = 0
      · simp only [hb, and_true, or_true, ite_true, mul_zero]
        exact Associated.refl _
      -- Porting note: need `dsimp only`
      · dsimp only
        rw [if_neg (not_and_of_not_left _ ha), one_mul, if_neg (not_or_of_not ha hb)]
        exact (associated_one_iff_isUnit.mpr ((IsUnit.mk0 _ ha).mul (IsUnit.mk0 _ hb))).symm
  lcm_zero_left b := if_pos (Or.inl rfl)
  lcm_zero_right a := if_pos (Or.inr rfl)
  -- `split_ifs` wants to split `normalize`, so handle the cases manually
  normalize_gcd a b := if h : a = 0 ∧ b = 0 then by simp [if_pos h] else by simp [if_neg h]
  normalize_lcm a b := if h : a = 0 ∨ b = 0 then by simp [if_pos h] else by 

Proof state:
α : Type u_1
G₀ : Type u_2
inst✝¹ : CommGroupWithZero G₀
inst✝ : DecidableEq G₀
a b : G₀
h : ¬(a = 0 ∨ b = 0)
⊢ normalize (lcm a b) = lcm a b

Next tactic:
simp [if_neg h]
@[simp]
theorem coe_normUnit {a : G₀} (h0 : a ≠ 0) : (↑(normUnit a) : G₀) = a⁻¹ := by 

Proof state:
α : Type u_1
G₀ : Type u_2
inst✝¹ : CommGroupWithZero G₀
inst✝ : DecidableEq G₀
a : G₀
h0 : a ≠ 0
⊢ ↑(normUnit a) = a⁻¹

Next tactic:
simp [normUnit, h0]
theorem normalize_eq_one {a : G₀} (h0 : a ≠ 0) : normalize a = 1 := by 

Proof state:
α : Type u_1
G₀ : Type u_2
inst✝¹ : CommGroupWithZero G₀
inst✝ : DecidableEq G₀
a : G₀
h0 : a ≠ 0
⊢ normalize a = 1

Next tactic:
simp [normalize_apply, h0]
instance EquivFunctorUnique : EquivFunctor Unique where
  map e := Equiv.uniqueCongr e
  map_refl' α := by 

Proof state:
α : Type ?u.3
⊢ (fun {α β} e => ⇑(uniqueCongr e)) (Equiv.refl α) = id

Next tactic:
simp [eq_iff_true_of_subsingleton]
instance EquivFunctorUnique : EquivFunctor Unique where
  map e := Equiv.uniqueCongr e
  map_refl' α := by simp [eq_iff_true_of_subsingleton]
  map_trans' := by 

Proof state:
⊢ ∀ {α β γ : Type ?u.3} (k : α ≃ β) (h : β ≃ γ),
    (fun {α β} e => ⇑(uniqueCongr e)) (k.trans h) =
      (fun {α β} e => ⇑(uniqueCongr e)) h ∘ (fun {α β} e => ⇑(uniqueCongr e)) k

Next tactic:
simp [eq_iff_true_of_subsingleton]
instance EquivFunctorPerm : EquivFunctor Perm where
  map e p := (e.symm.trans p).trans e
  map_refl' α := by 

Proof state:
α : Type ?u.3831
⊢ (fun {α β} e p => (e.symm.trans p).trans e) (Equiv.refl α) = id

Next tactic:
ext
instance EquivFunctorPerm : EquivFunctor Perm where
  map e p := (e.symm.trans p).trans e
  map_refl' α := by ext; 

Proof state:
case h.H
α : Type ?u.3831
x✝¹ : Perm α
x✝ : α
⊢ ((fun {α β} e p => (e.symm.trans p).trans e) (Equiv.refl α) x✝¹) x✝ = (id x✝¹) x✝

Next tactic:
simp
instance EquivFunctorPerm : EquivFunctor Perm where
  map e p := (e.symm.trans p).trans e
  map_refl' α := by ext; simp
  map_trans' _ _ := by 

Proof state:
α✝ β✝ γ✝ : Type ?u.3831
x✝¹ : α✝ ≃ β✝
x✝ : β✝ ≃ γ✝
⊢ (fun {α β} e p => (e.symm.trans p).trans e) (x✝¹.trans x✝) =
    (fun {α β} e p => (e.symm.trans p).trans e) x✝ ∘ (fun {α β} e p => (e.symm.trans p).trans e) x✝¹

Next tactic:
ext
instance EquivFunctorPerm : EquivFunctor Perm where
  map e p := (e.symm.trans p).trans e
  map_refl' α := by ext; simp
  map_trans' _ _ := by ext; 

Proof state:
case h.H
α✝ β✝ γ✝ : Type ?u.3831
x✝³ : α✝ ≃ β✝
x✝² : β✝ ≃ γ✝
x✝¹ : Perm α✝
x✝ : γ✝
⊢ ((fun {α β} e p => (e.symm.trans p).trans e) (x✝³.trans x✝²) x✝¹) x✝ =
    (((fun {α β} e p => (e.symm.trans p).trans e) x✝² ∘ (fun {α β} e p => (e.symm.trans p).trans e) x✝³) x✝¹) x✝

Next tactic:
simp
instance EquivFunctorFinset : EquivFunctor Finset where
  map e s := s.map e.toEmbedding
  map_refl' α := by 

Proof state:
α : Type ?u.6305
⊢ (fun {α β} e s => Finset.map (Equiv.toEmbedding e) s) (Equiv.refl α) = id

Next tactic:
ext
instance EquivFunctorFinset : EquivFunctor Finset where
  map e s := s.map e.toEmbedding
  map_refl' α := by ext; 

Proof state:
case h.a
α : Type ?u.6305
x✝ : Finset α
a✝ : α
⊢ a✝ ∈ (fun {α β} e s => Finset.map (Equiv.toEmbedding e) s) (Equiv.refl α) x✝ ↔ a✝ ∈ id x✝

Next tactic:
simp
instance EquivFunctorFinset : EquivFunctor Finset where
  map e s := s.map e.toEmbedding
  map_refl' α := by ext; simp
  map_trans' k h := by
    

Proof state:
α✝ β✝ γ✝ : Type ?u.6305
k : α✝ ≃ β✝
h : β✝ ≃ γ✝
⊢ (fun {α β} e s => Finset.map (Equiv.toEmbedding e) s) (k.trans h) =
    (fun {α β} e s => Finset.map (Equiv.toEmbedding e) s) h ∘ (fun {α β} e s => Finset.map (Equiv.toEmbedding e) s) k

Next tactic:
ext _ a
instance EquivFunctorFinset : EquivFunctor Finset where
  map e s := s.map e.toEmbedding
  map_refl' α := by ext; simp
  map_trans' k h := by
    ext _ a; 

Proof state:
case h.a
α✝ β✝ γ✝ : Type ?u.6305
k : α✝ ≃ β✝
h : β✝ ≃ γ✝
x✝ : Finset α✝
a : γ✝
⊢ a ∈ (fun {α β} e s => Finset.map (Equiv.toEmbedding e) s) (k.trans h) x✝ ↔
    a ∈
      ((fun {α β} e s => Finset.map (Equiv.toEmbedding e) s) h ∘
          (fun {α β} e s => Finset.map (Equiv.toEmbedding e) s) k)
        x✝

Next tactic:
simp
instance EquivFunctorFinset : EquivFunctor Finset where
  map e s := s.map e.toEmbedding
  map_refl' α := by ext; simp
  map_trans' k h := by
    ext _ a; simp; 

Proof state:
case h.a
α✝ β✝ γ✝ : Type ?u.6305
k : α✝ ≃ β✝
h : β✝ ≃ γ✝
x✝ : Finset α✝
a : γ✝
⊢ (∃ a_1 ∈ x✝, h (k a_1) = a) ↔ k.symm (h.symm a) ∈ x✝

Next tactic:
constructor
instance EquivFunctorFinset : EquivFunctor Finset where
  map e s := s.map e.toEmbedding
  map_refl' α := by ext; simp
  map_trans' k h := by
    ext _ a; simp; constructor <;> 

Proof state:
case h.a.mp
α✝ β✝ γ✝ : Type ?u.6305
k : α✝ ≃ β✝
h : β✝ ≃ γ✝
x✝ : Finset α✝
a : γ✝
⊢ (∃ a_1 ∈ x✝, h (k a_1) = a) → k.symm (h.symm a) ∈ x✝

Next tactic:
intro h'
instance EquivFunctorFinset : EquivFunctor Finset where
  map e s := s.map e.toEmbedding
  map_refl' α := by ext; simp
  map_trans' k h := by
    ext _ a; simp; constructor <;> 

Proof state:
case h.a.mpr
α✝ β✝ γ✝ : Type ?u.6305
k : α✝ ≃ β✝
h : β✝ ≃ γ✝
x✝ : Finset α✝
a : γ✝
⊢ k.symm (h.symm a) ∈ x✝ → ∃ a_2 ∈ x✝, h (k a_2) = a

Next tactic:
intro h'
instance EquivFunctorFinset : EquivFunctor Finset where
  map e s := s.map e.toEmbedding
  map_refl' α := by ext; simp
  map_trans' k h := by
    ext _ a; simp; constructor <;> intro h'
    · 

Proof state:
case h.a.mp
α✝ β✝ γ✝ : Type ?u.6305
k : α✝ ≃ β✝
h : β✝ ≃ γ✝
x✝ : Finset α✝
a : γ✝
h' : ∃ a_1 ∈ x✝, h (k a_1) = a
⊢ k.symm (h.symm a) ∈ x✝

Next tactic:
let ⟨a, ha₁, ha₂⟩ := h'
instance EquivFunctorFinset : EquivFunctor Finset where
  map e s := s.map e.toEmbedding
  map_refl' α := by ext; simp
  map_trans' k h := by
    ext _ a; simp; constructor <;> intro h'
    · let ⟨a, ha₁, ha₂⟩ := h'
      

Proof state:
case h.a.mp
α✝ β✝ γ✝ : Type ?u.6305
k : α✝ ≃ β✝
h : β✝ ≃ γ✝
x✝ : Finset α✝
a✝ : γ✝
h' : ∃ a ∈ x✝, h (k a) = a✝
a : α✝
ha₁ : a ∈ x✝
ha₂ : h (k a) = a✝
⊢ k.symm (h.symm a✝) ∈ x✝

Next tactic:
rw [← ha₂]
instance EquivFunctorFinset : EquivFunctor Finset where
  map e s := s.map e.toEmbedding
  map_refl' α := by ext; simp
  map_trans' k h := by
    ext _ a; simp; constructor <;> intro h'
    · let ⟨a, ha₁, ha₂⟩ := h'
      rw [← ha₂]; 

Proof state:
case h.a.mp
α✝ β✝ γ✝ : Type ?u.6305
k : α✝ ≃ β✝
h : β✝ ≃ γ✝
x✝ : Finset α✝
a✝ : γ✝
h' : ∃ a ∈ x✝, h (k a) = a✝
a : α✝
ha₁ : a ∈ x✝
ha₂ : h (k a) = a✝
⊢ k.symm (h.symm (h (k a))) ∈ x✝

Next tactic:
simp
instance EquivFunctorFinset : EquivFunctor Finset where
  map e s := s.map e.toEmbedding
  map_refl' α := by ext; simp
  map_trans' k h := by
    ext _ a; simp; constructor <;> intro h'
    · let ⟨a, ha₁, ha₂⟩ := h'
      rw [← ha₂]; simp; 

Proof state:
case h.a.mp
α✝ β✝ γ✝ : Type ?u.6305
k : α✝ ≃ β✝
h : β✝ ≃ γ✝
x✝ : Finset α✝
a✝ : γ✝
h' : ∃ a ∈ x✝, h (k a) = a✝
a : α✝
ha₁ : a ∈ x✝
ha₂ : h (k a) = a✝
⊢ a ∈ x✝

Next tactic:
apply ha₁