no goals
M : Type w
A : Set M
L : Language
inst✝¹ : Structure L M
α : Type u₁
β : Type u_1
B : Set M
s✝ : Set (α → M)
s : Set (β → M)
h : Definable A L s
f : α ↪ β
inst✝ : Finite β
⊢ Definable A L ((fun g => g ∘ ↑f) '' s)
classical
  cases nonempty_fintype β
  refine'
    (congr rfl (ext fun x => _)).mp
      (((h.image_comp_equiv (Equiv.Set.sumCompl (range f))).image_comp_equiv
            (Equiv.sumCongr (Equiv.ofInjective f f.injective)
              (Fintype.equivFin (↥((range f)ᶜ))).symm)).image_comp_sum_inl_fin
        _)
  simp only [mem_preimage, mem_image, exists_exists_and_eq_and]
  refine' exists_congr fun y => and_congr_right fun _ => Eq.congr_left (funext fun a => _)
  simp
case intro
M : Type w
A : Set M
L : Language
inst✝¹ : Structure L M
α : Type u₁
β : Type u_1
B : Set M
s✝ : Set (α → M)
s : Set (β → M)
h : Definable A L s
f : α ↪ β
inst✝ : Finite β
val✝ : Fintype β
⊢ Definable A L ((fun g => g ∘ ↑f) '' s)
M : Type w
A : Set M
L : Language
inst✝¹ : Structure L M
α : Type u₁
β : Type u_1
B : Set M
s✝ : Set (α → M)
s : Set (β → M)
h : Definable A L s
f : α ↪ β
inst✝ : Finite β
⊢ Definable A L ((fun g => g ∘ ↑f) '' s)
cases nonempty_fintype β
case intro
M : Type w
A : Set M
L : Language
inst✝¹ : Structure L M
α : Type u₁
β : Type u_1
B : Set M
s✝ : Set (α → M)
s : Set (β → M)
h : Definable A L s
f : α ↪ β
inst✝ : Finite β
val✝ : Fintype β
x : α → M
⊢ x ∈
      (fun g => g ∘ Sum.inl) ''
        ((fun g =>
            g ∘
              ↑(Equiv.sumCongr (Equiv.ofInjective ↑f (_ : Function.Injective ↑f))
                  (Fintype.equivFin ↑(range ↑fᶜ)).symm)) ''
          ((fun g => g ∘ ↑(Equiv.Set.sumCompl (range ↑f))) '' s)) ↔
    x ∈ (fun g => g ∘ ↑f) '' s
case intro
M : Type w
A : Set M
L : Language
inst✝¹ : Structure L M
α : Type u₁
β : Type u_1
B : Set M
s✝ : Set (α → M)
s : Set (β → M)
h : Definable A L s
f : α ↪ β
inst✝ : Finite β
val✝ : Fintype β
⊢ Definable A L ((fun g => g ∘ ↑f) '' s)
refine'
  (congr rfl (ext fun x => _)).mp
    (((h.image_comp_equiv (Equiv.Set.sumCompl (range f))).image_comp_equiv
          (Equiv.sumCongr (Equiv.ofInjective f f.injective)
            (Fintype.equivFin (↥((range f)ᶜ))).symm)).image_comp_sum_inl_fin
      _)
case intro
M : Type w
A : Set M
L : Language
inst✝¹ : Structure L M
α : Type u₁
β : Type u_1
B : Set M
s✝ : Set (α → M)
s : Set (β → M)
h : Definable A L s
f : α ↪ β
inst✝ : Finite β
val✝ : Fintype β
x : α → M
⊢ (∃ a,
      a ∈ s ∧
        ((a ∘ ↑(Equiv.Set.sumCompl (range ↑f))) ∘
              ↑(Equiv.sumCongr (Equiv.ofInjective ↑f (_ : Function.Injective ↑f))
                  (Fintype.equivFin ↑(range ↑fᶜ)).symm)) ∘
            Sum.inl =
          x) ↔
    ∃ x_1, x_1 ∈ s ∧ x_1 ∘ ↑f = x
case intro
M : Type w
A : Set M
L : Language
inst✝¹ : Structure L M
α : Type u₁
β : Type u_1
B : Set M
s✝ : Set (α → M)
s : Set (β → M)
h : Definable A L s
f : α ↪ β
inst✝ : Finite β
val✝ : Fintype β
x : α → M
⊢ x ∈
      (fun g => g ∘ Sum.inl) ''
        ((fun g =>
            g ∘
              ↑(Equiv.sumCongr (Equiv.ofInjective ↑f (_ : Function.Injective ↑f))
                  (Fintype.equivFin ↑(range ↑fᶜ)).symm)) ''
          ((fun g => g ∘ ↑(Equiv.Set.sumCompl (range ↑f))) '' s)) ↔
    x ∈ (fun g => g ∘ ↑f) '' s
simp only [mem_preimage, mem_image, exists_exists_and_eq_and]
case intro
M : Type w
A : Set M
L : Language
inst✝¹ : Structure L M
α : Type u₁
β : Type u_1
B : Set M
s✝ : Set (α → M)
s : Set (β → M)
h : Definable A L s
f : α ↪ β
inst✝ : Finite β
val✝ : Fintype β
x : α → M
y : β → M
x✝ : y ∈ s
a : α
⊢ (((y ∘ ↑(Equiv.Set.sumCompl (range ↑f))) ∘
          ↑(Equiv.sumCongr (Equiv.ofInjective ↑f (_ : Function.Injective ↑f)) (Fintype.equivFin ↑(range ↑fᶜ)).symm)) ∘
        Sum.inl)
      a =
    (y ∘ ↑f) a
case intro
M : Type w
A : Set M
L : Language
inst✝¹ : Structure L M
α : Type u₁
β : Type u_1
B : Set M
s✝ : Set (α → M)
s : Set (β → M)
h : Definable A L s
f : α ↪ β
inst✝ : Finite β
val✝ : Fintype β
x : α → M
⊢ (∃ a,
      a ∈ s ∧
        ((a ∘ ↑(Equiv.Set.sumCompl (range ↑f))) ∘
              ↑(Equiv.sumCongr (Equiv.ofInjective ↑f (_ : Function.Injective ↑f))
                  (Fintype.equivFin ↑(range ↑fᶜ)).symm)) ∘
            Sum.inl =
          x) ↔
    ∃ x_1, x_1 ∈ s ∧ x_1 ∘ ↑f = x
refine' exists_congr fun y => and_congr_right fun _ => Eq.congr_left (funext fun a => _)
no goals
case intro
M : Type w
A : Set M
L : Language
inst✝¹ : Structure L M
α : Type u₁
β : Type u_1
B : Set M
s✝ : Set (α → M)
s : Set (β → M)
h : Definable A L s
f : α ↪ β
inst✝ : Finite β
val✝ : Fintype β
x : α → M
y : β → M
x✝ : y ∈ s
a : α
⊢ (((y ∘ ↑(Equiv.Set.sumCompl (range ↑f))) ∘
          ↑(Equiv.sumCongr (Equiv.ofInjective ↑f (_ : Function.Injective ↑f)) (Fintype.equivFin ↑(range ↑fᶜ)).symm)) ∘
        Sum.inl)
      a =
    (y ∘ ↑f) a
simp