Metamath Proof Explorer


Theorem stoweid

Description: This theorem proves the Stone-Weierstrass theorem for real-valued functions: let J be a compact topology on T , and C be the set of real continuous functions on T . Assume that A is a subalgebra of C (closed under addition and multiplication of functions) containing constant functions and discriminating points (if r and t are distinct points in T , then there exists a function h in A such that h(r) is distinct from h(t) ). Then, for any continuous function F and for any positive real E , there exists a function f in the subalgebra A , such that f approximates F up to E ( E represents the usual ε value). As a classical example, given any a, b reals, the closed interval T = [ a , b ] could be taken, along with the subalgebra A of real polynomials on T , and then use this theorem to easily prove that real polynomials are dense in the standard metric space of continuous functions on [ a , b ] . The proof and lemmas are written following BrosowskiDeutsh p. 89 (through page 92). Some effort is put in avoiding the use of the axiom of choice. (Contributed by Glauco Siliprandi, 20-Apr-2017)

Ref Expression
Hypotheses stoweid.1 𝑡 𝐹
stoweid.2 𝑡 𝜑
stoweid.3 𝐾 = ( topGen ‘ ran (,) )
stoweid.4 ( 𝜑𝐽 ∈ Comp )
stoweid.5 𝑇 = 𝐽
stoweid.6 𝐶 = ( 𝐽 Cn 𝐾 )
stoweid.7 ( 𝜑𝐴𝐶 )
stoweid.8 ( ( 𝜑𝑓𝐴𝑔𝐴 ) → ( 𝑡𝑇 ↦ ( ( 𝑓𝑡 ) + ( 𝑔𝑡 ) ) ) ∈ 𝐴 )
stoweid.9 ( ( 𝜑𝑓𝐴𝑔𝐴 ) → ( 𝑡𝑇 ↦ ( ( 𝑓𝑡 ) · ( 𝑔𝑡 ) ) ) ∈ 𝐴 )
stoweid.10 ( ( 𝜑𝑥 ∈ ℝ ) → ( 𝑡𝑇𝑥 ) ∈ 𝐴 )
stoweid.11 ( ( 𝜑 ∧ ( 𝑟𝑇𝑡𝑇𝑟𝑡 ) ) → ∃ 𝐴 ( 𝑟 ) ≠ ( 𝑡 ) )
stoweid.12 ( 𝜑𝐹𝐶 )
stoweid.13 ( 𝜑𝐸 ∈ ℝ+ )
Assertion stoweid ( 𝜑 → ∃ 𝑓𝐴𝑡𝑇 ( abs ‘ ( ( 𝑓𝑡 ) − ( 𝐹𝑡 ) ) ) < 𝐸 )

Proof

Step Hyp Ref Expression
1 stoweid.1 𝑡 𝐹
2 stoweid.2 𝑡 𝜑
3 stoweid.3 𝐾 = ( topGen ‘ ran (,) )
4 stoweid.4 ( 𝜑𝐽 ∈ Comp )
5 stoweid.5 𝑇 = 𝐽
6 stoweid.6 𝐶 = ( 𝐽 Cn 𝐾 )
7 stoweid.7 ( 𝜑𝐴𝐶 )
8 stoweid.8 ( ( 𝜑𝑓𝐴𝑔𝐴 ) → ( 𝑡𝑇 ↦ ( ( 𝑓𝑡 ) + ( 𝑔𝑡 ) ) ) ∈ 𝐴 )
9 stoweid.9 ( ( 𝜑𝑓𝐴𝑔𝐴 ) → ( 𝑡𝑇 ↦ ( ( 𝑓𝑡 ) · ( 𝑔𝑡 ) ) ) ∈ 𝐴 )
10 stoweid.10 ( ( 𝜑𝑥 ∈ ℝ ) → ( 𝑡𝑇𝑥 ) ∈ 𝐴 )
11 stoweid.11 ( ( 𝜑 ∧ ( 𝑟𝑇𝑡𝑇𝑟𝑡 ) ) → ∃ 𝐴 ( 𝑟 ) ≠ ( 𝑡 ) )
12 stoweid.12 ( 𝜑𝐹𝐶 )
13 stoweid.13 ( 𝜑𝐸 ∈ ℝ+ )
14 simpr ( ( 𝜑𝑇 = ∅ ) → 𝑇 = ∅ )
15 10 ralrimiva ( 𝜑 → ∀ 𝑥 ∈ ℝ ( 𝑡𝑇𝑥 ) ∈ 𝐴 )
16 1re 1 ∈ ℝ
17 id ( 𝑥 = 1 → 𝑥 = 1 )
18 17 mpteq2dv ( 𝑥 = 1 → ( 𝑡𝑇𝑥 ) = ( 𝑡𝑇 ↦ 1 ) )
19 18 eleq1d ( 𝑥 = 1 → ( ( 𝑡𝑇𝑥 ) ∈ 𝐴 ↔ ( 𝑡𝑇 ↦ 1 ) ∈ 𝐴 ) )
20 19 rspccv ( ∀ 𝑥 ∈ ℝ ( 𝑡𝑇𝑥 ) ∈ 𝐴 → ( 1 ∈ ℝ → ( 𝑡𝑇 ↦ 1 ) ∈ 𝐴 ) )
21 15 16 20 mpisyl ( 𝜑 → ( 𝑡𝑇 ↦ 1 ) ∈ 𝐴 )
22 21 adantr ( ( 𝜑𝑇 = ∅ ) → ( 𝑡𝑇 ↦ 1 ) ∈ 𝐴 )
23 14 22 stoweidlem9 ( ( 𝜑𝑇 = ∅ ) → ∃ 𝑓𝐴𝑡𝑇 ( abs ‘ ( ( 𝑓𝑡 ) − ( 𝐹𝑡 ) ) ) < if ( 𝐸 ≤ ( 1 / 4 ) , 𝐸 , ( 1 / 4 ) ) )
24 nfv 𝑓 𝜑
25 nfv 𝑓 ¬ 𝑇 = ∅
26 24 25 nfan 𝑓 ( 𝜑 ∧ ¬ 𝑇 = ∅ )
27 nfv 𝑡 ¬ 𝑇 = ∅
28 2 27 nfan 𝑡 ( 𝜑 ∧ ¬ 𝑇 = ∅ )
29 eqid ( 𝑡𝑇 ↦ ( ( 𝐹𝑡 ) − inf ( ran 𝐹 , ℝ , < ) ) ) = ( 𝑡𝑇 ↦ ( ( 𝐹𝑡 ) − inf ( ran 𝐹 , ℝ , < ) ) )
30 4 adantr ( ( 𝜑 ∧ ¬ 𝑇 = ∅ ) → 𝐽 ∈ Comp )
31 7 adantr ( ( 𝜑 ∧ ¬ 𝑇 = ∅ ) → 𝐴𝐶 )
32 8 3adant1r ( ( ( 𝜑 ∧ ¬ 𝑇 = ∅ ) ∧ 𝑓𝐴𝑔𝐴 ) → ( 𝑡𝑇 ↦ ( ( 𝑓𝑡 ) + ( 𝑔𝑡 ) ) ) ∈ 𝐴 )
33 9 3adant1r ( ( ( 𝜑 ∧ ¬ 𝑇 = ∅ ) ∧ 𝑓𝐴𝑔𝐴 ) → ( 𝑡𝑇 ↦ ( ( 𝑓𝑡 ) · ( 𝑔𝑡 ) ) ) ∈ 𝐴 )
34 10 adantlr ( ( ( 𝜑 ∧ ¬ 𝑇 = ∅ ) ∧ 𝑥 ∈ ℝ ) → ( 𝑡𝑇𝑥 ) ∈ 𝐴 )
35 11 adantlr ( ( ( 𝜑 ∧ ¬ 𝑇 = ∅ ) ∧ ( 𝑟𝑇𝑡𝑇𝑟𝑡 ) ) → ∃ 𝐴 ( 𝑟 ) ≠ ( 𝑡 ) )
36 12 adantr ( ( 𝜑 ∧ ¬ 𝑇 = ∅ ) → 𝐹𝐶 )
37 4re 4 ∈ ℝ
38 4pos 0 < 4
39 37 38 elrpii 4 ∈ ℝ+
40 39 a1i ( 𝜑 → 4 ∈ ℝ+ )
41 40 rpreccld ( 𝜑 → ( 1 / 4 ) ∈ ℝ+ )
42 13 41 ifcld ( 𝜑 → if ( 𝐸 ≤ ( 1 / 4 ) , 𝐸 , ( 1 / 4 ) ) ∈ ℝ+ )
43 42 adantr ( ( 𝜑 ∧ ¬ 𝑇 = ∅ ) → if ( 𝐸 ≤ ( 1 / 4 ) , 𝐸 , ( 1 / 4 ) ) ∈ ℝ+ )
44 neqne ( ¬ 𝑇 = ∅ → 𝑇 ≠ ∅ )
45 44 adantl ( ( 𝜑 ∧ ¬ 𝑇 = ∅ ) → 𝑇 ≠ ∅ )
46 13 rpred ( 𝜑𝐸 ∈ ℝ )
47 4ne0 4 ≠ 0
48 37 47 rereccli ( 1 / 4 ) ∈ ℝ
49 48 a1i ( 𝜑 → ( 1 / 4 ) ∈ ℝ )
50 46 49 ifcld ( 𝜑 → if ( 𝐸 ≤ ( 1 / 4 ) , 𝐸 , ( 1 / 4 ) ) ∈ ℝ )
51 3re 3 ∈ ℝ
52 3ne0 3 ≠ 0
53 51 52 rereccli ( 1 / 3 ) ∈ ℝ
54 53 a1i ( 𝜑 → ( 1 / 3 ) ∈ ℝ )
55 13 rpxrd ( 𝜑𝐸 ∈ ℝ* )
56 41 rpxrd ( 𝜑 → ( 1 / 4 ) ∈ ℝ* )
57 xrmin2 ( ( 𝐸 ∈ ℝ* ∧ ( 1 / 4 ) ∈ ℝ* ) → if ( 𝐸 ≤ ( 1 / 4 ) , 𝐸 , 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r ( ( ( 𝜑𝑓𝐴 ) ∧ 𝑡𝑇 ) → if ( 𝐸 ≤ ( 1 / 4 ) , 𝐸 , ( 1 / 4 ) ) ≤ 𝐸 )
73 7 ad2antrr ( ( ( 𝜑𝑓𝐴 ) ∧ 𝑡𝑇 ) → 𝐴𝐶 )
74 simplr ( ( ( 𝜑𝑓𝐴 ) ∧ 𝑡𝑇 ) → 𝑓𝐴 )
75 73 74 sseldd ( ( ( 𝜑𝑓𝐴 ) ∧ 𝑡𝑇 ) → 𝑓𝐶 )
76 3 5 6 75 fcnre ( ( ( 𝜑𝑓𝐴 ) ∧ 𝑡𝑇 ) → 𝑓 : 𝑇 ⟶ ℝ )
77 simpr ( ( ( 𝜑𝑓𝐴 ) ∧ 𝑡𝑇 ) → 𝑡𝑇 )
78 76 77 jca ( ( ( 𝜑𝑓𝐴 ) ∧ 𝑡𝑇 ) → ( 𝑓 : 𝑇 ⟶ ℝ ∧ 𝑡𝑇 ) )
79 ffvelrn ( ( 𝑓 : 𝑇 ⟶ ℝ ∧ 𝑡𝑇 ) → ( 𝑓𝑡 ) ∈ ℝ )
80 recn ( ( 𝑓𝑡 ) ∈ ℝ → ( 𝑓𝑡 ) ∈ ℂ )
81 78 79 80 3syl ( ( ( 𝜑𝑓𝐴 ) ∧ 𝑡𝑇 ) → ( 𝑓𝑡 ) ∈ ℂ )
82 12 ad2antrr ( ( ( 𝜑𝑓𝐴 ) ∧ 𝑡𝑇 ) → 𝐹𝐶 )
83 3 5 6 82 fcnre ( ( ( 𝜑𝑓𝐴 ) ∧ 𝑡𝑇 ) → 𝐹 : 𝑇 ⟶ ℝ )
84 83 77 jca ( ( ( 𝜑𝑓𝐴 ) ∧ 𝑡𝑇 ) → ( 𝐹 : 𝑇 ⟶ ℝ ∧ 𝑡𝑇 ) )
85 ffvelrn ( ( 𝐹 : 𝑇 ⟶ ℝ ∧ 𝑡𝑇 ) → ( 𝐹𝑡 ) ∈ ℝ )
86 recn ( ( 𝐹𝑡 ) ∈ ℝ → ( 𝐹𝑡 ) ∈ ℂ )
87 84 85 86 3syl ( ( ( 𝜑𝑓𝐴 ) ∧ 𝑡𝑇 ) → ( 𝐹𝑡 ) ∈ ℂ )
88 81 87 subcld ( ( ( 𝜑𝑓𝐴 ) ∧ 𝑡𝑇 ) → ( ( 𝑓𝑡 ) − ( 𝐹𝑡 ) ) ∈ ℂ )
89 88 abscld ( ( ( 𝜑𝑓𝐴 ) ∧ 𝑡𝑇 ) → ( abs ‘ ( ( 𝑓𝑡 ) − ( 𝐹𝑡 ) ) ) ∈ ℝ )
90 16 37 47 3pm3.2i ( 1 ∈ ℝ ∧ 4 ∈ ℝ ∧ 4 ≠ 0 )
91 redivcl ( ( 1 ∈ ℝ ∧ 4 ∈ ℝ ∧ 4 ≠ 0 ) → ( 1 / 4 ) ∈ ℝ )
92 90 91 mp1i ( 𝜑 → ( 1 / 4 ) ∈ ℝ )
93 46 92 ifcld ( 𝜑 → if ( 𝐸 ≤ ( 1 / 4 ) , 𝐸 , ( 1 / 4 ) ) ∈ ℝ )
94 93 ad2antrr ( ( ( 𝜑𝑓𝐴 ) ∧ 𝑡𝑇 ) → if ( 𝐸 ≤ ( 1 / 4 ) , 𝐸 , ( 1 / 4 ) ) ∈ ℝ )
95 46 ad2antrr ( ( ( 𝜑𝑓𝐴 ) ∧ 𝑡𝑇 ) → 𝐸 ∈ ℝ )
96 ltletr ( ( ( abs ‘ ( ( 𝑓𝑡 ) − ( 𝐹𝑡 ) ) ) ∈ ℝ ∧ if ( 𝐸 ≤ ( 1 / 4 ) , 𝐸 , ( 1 / 4 ) ) ∈ ℝ ∧ 𝐸 ∈ ℝ ) → ( ( ( abs ‘ ( ( 𝑓𝑡 ) − ( 𝐹𝑡 ) ) ) < if ( 𝐸 ≤ ( 1 / 4 ) , 𝐸 , ( 1 / 4 ) ) ∧ if ( 𝐸 ≤ ( 1 / 4 ) , 𝐸 , ( 1 / 4 ) ) ≤ 𝐸 ) → ( abs ‘ ( ( 𝑓𝑡 ) − ( 𝐹𝑡 ) ) ) < 𝐸 ) )
97 89 94 95 96 syl3anc ( ( ( 𝜑𝑓𝐴 ) ∧ 𝑡𝑇 ) → ( ( ( abs ‘ ( ( 𝑓𝑡 ) − ( 𝐹𝑡 ) ) ) < if ( 𝐸 ≤ ( 1 / 4 ) , 𝐸 , ( 1 / 4 ) ) ∧ if ( 𝐸 ≤ ( 1 / 4 ) , 𝐸 , ( 1 / 4 ) ) ≤ 𝐸 ) → ( abs ‘ ( ( 𝑓𝑡 ) − ( 𝐹𝑡 ) ) ) < 𝐸 ) )
98 72 97 mpan2d ( ( ( 𝜑𝑓𝐴 ) ∧ 𝑡𝑇 ) → ( ( abs ‘ ( ( 𝑓𝑡 ) − ( 𝐹𝑡 ) ) ) < if ( 𝐸 ≤ ( 1 / 4 ) , 𝐸 , ( 1 / 4 ) ) → ( abs ‘ ( ( 𝑓𝑡 ) − ( 𝐹𝑡 ) ) ) < 𝐸 ) )
99 69 98 ralimdaa ( ( 𝜑𝑓𝐴 ) → ( ∀ 𝑡𝑇 ( abs ‘ ( ( 𝑓𝑡 ) − ( 𝐹𝑡 ) ) ) < if ( 𝐸 ≤ ( 1 / 4 ) , 𝐸 , ( 1 / 4 ) ) → ∀ 𝑡𝑇 ( abs ‘ ( ( 𝑓𝑡 ) − ( 𝐹𝑡 ) ) ) < 𝐸 ) )
100 99 reximdva ( 𝜑 → ( ∃ 𝑓𝐴𝑡𝑇 ( abs ‘ ( ( 𝑓𝑡 ) − ( 𝐹𝑡 ) ) ) < if ( 𝐸 ≤ ( 1 / 4 ) , 𝐸 , ( 1 / 4 ) ) → ∃ 𝑓𝐴𝑡𝑇 ( abs ‘ ( ( 𝑓𝑡 ) − ( 𝐹𝑡 ) ) ) < 𝐸 ) )
101 67 100 mpd ( 𝜑 → ∃ 𝑓𝐴𝑡𝑇 ( abs ‘ ( ( 𝑓𝑡 ) − ( 𝐹𝑡 ) ) ) < 𝐸 )