The rapid transition from star-formation to AGN dominated rest-frame UV light at z ~ 4

With the advent of deep optical-to-near-infrared extragalactic imaging on the degree scale, samples of high-redshift sources are being selected that contain both bright star-forming (SF) galaxies and faint active galactic nuclei (AGN). In this study we investigate the transition between SF and AGN-dominated systems at $z \simeq 4$ in the rest-frame UV. We find a rapid transition to AGN-dominated sources bright-ward of $M_{\rm UV} \simeq -23.2$. The effect is observed in the rest-frame UV morphology and size-luminosity relation, where extended clumpy systems become point-source dominated, and also in the available spectra for the sample. These results allow us to derive the rest-frame UV luminosity function for the SF and AGN-dominated sub-samples. We find the SF-dominated LF is best fit with a double-power law, with a lensed Schechter function being unable to explain the existence of extremely luminous SF galaxies at $M_{\rm UV} \simeq -23.5$. If we identify AGN-dominated sources according to a point-source morphology criterion we recover the relatively flat faint-end slope of the AGN LF determined in previous studies. If we instead separate the LF according to the current spectroscopic AGN fraction, we find a steeper faint-end slope of $\alpha = -1.83 \pm 0.11$. Using a simple model to predict the rest-frame AGN LF from the $z = 4 $ galaxy LF we find that the increasing impact of host galaxy light on the measured morphology of faint AGN can explain our observations.


INTRODUCTION
How supermassive black holes and their host galaxies co-evolve over cosmic time poses many fundamental questions within Astrophysics. The detection of luminous quasars at very high redshift (e.g. Fan et al. 2003;Willott et al. 2010a;Mortlock et al. 2011;Bañados et al. 2016Bañados et al. , 2018Yang et al. 2020) demonstrates that active black holes are present less than a Gyr after the Big Bang. Within the same epoch, the star-forming (SF) galaxy population is known to be building-up rapidly from measurements of the evolving rest-frame UV luminosity function (LF; e.g. Bouwens et al. 2015;Finkelstein et al. 2015;Bowler et al. 2020;Ono et al. 2018). Until recently, the populations of quasars and SF galaxies at redshifts = 4 − 8 have typically been treated as separate, due primarily to the disparate luminosity space occupied by the current samples. This is despite the majority of galaxies and quasars at very high-redshifts being selected based on the same spectral feature in optical/NIR survey data; the Lyman-continuum and/or the Lyman-break. The strong Lymanbreak in the spectral energy distribution (SED), which is redshifted into the optical filters at 3 and near-IR at 7, has allowed large samples of UV-bright galaxies and AGN 1 to be selected efficiently. In the last decade, the advent of intermediate surveys that probe areas up to a few hundred square degrees on the sky has led to the ★ E-mail: rebecca.bowler@physics.ox.ac.uk 1 In this work we use the more inclusive term AGN rather than quasar throughout. first samples that bridge both faint AGN as well as bright galaxies, filling in a previously unachievable parameter space in volume and luminosity (Matute et al. 2013;Kashikawa et al. 2015;Matsuoka et al. 2018b;Stevans et al. 2018;Ono et al. 2018;Adams et al. 2020). The properties of these intermediate luminosity sources are important for several reasons. Firstly, the existence of very UV bright, highly star-forming galaxies can challenge models of feedback and dust obscuration via the inferred steepness of the bright-end of the Lymanbreak galaxy (LBG) UV LF (e.g. Bower et al. 2012;Gonzalez-Perez et al. 2013;Bowler et al. 2014;Dayal et al. 2014;Clay et al. 2015). Furthermore, the uncertainty in the number of the brightest galaxies in combination with 'contamination' of these samples with faint-AGN or interloper populations can confuse the interpretation of the shape and evolution of the galaxy LF (e.g. Bowler et al. 2012;Bian et al. 2013). Secondly, the determination of the faint-end slope of the AGN LF is crucial for understanding if these sources played any significant role in reionizing the Universe at 7 (e.g. as advocated by Giallongo et al. 2015Giallongo et al. , 2019, see discussion in Parsa et al. 2018). Thirdly, samples of sources in which the AGN and stellar component both contribute measurably to the observed light give an insight into how and when black holes become intricately linked to their host galaxy (e.g. via measurements of the black-hole to bulge/stellar mass relation at very high-redshift; Willott et al. 2010b;Venemans et al. 2017).
While the rest-frame UV 4 AGN LF was first measured several decades ago (e.g. Warren et al. 1994; Richards et al. 2006;Masters et al. 2012;Ikeda et al. 2012), recent surveys have been able to select larger samples over a wider luminosity range, thus providing greater precision. In particular, there have been several successful campaigns to identify fainter sources at ≥ 4 with surveys such as the Subaru High-Exploration of Low-Luminosity Quasars (SHELLQs: Matsuoka et al. 2018a), the Infrared Medium Survey (IMS: Kim et al. 2019) and the Hyper-SuprimeCam Stragetic Survey Program (HSC-SSP; Akiyama et al. 2018). These studies have been able to constrain the faint-end 2 of the AGN LF for the first time at 4, however there remain large discrepancies in the derived faint-end slope which ranges from −1.3 (Matsuoka et al. 2018b;Akiyama et al. 2018) to as steep as −2 (McGreer et al. 2018;Giallongo et al. 2019;Shin et al. 2020). A key challenge in the robust determination of the number density of the lowest luminosity AGN is that faint-ward of a certain absolute UV magnitude ( UV −23; Stevans et al. 2018;Ono et al. 2018;Adams et al. 2020), LBGs become overwhelmingly more numerous. In response, AGN selection methodologies have typically included a condition that the source must be unresolved in imaging data, as expected for a source dominated by the central AGN. Despite this, the very faintest sources targeted by these studies have shown spectra that are typical of Lyman-break galaxies (e.g. Matsuoka et al. 2018b;Kashikawa et al. 2015). Furthermore, as studies probe fainter AGN in the rest-frame UV, it is unclear how the light from star-formation might impact the morphology (e.g. Gavignaud et al. 2006) and hence cause current selection procedures based on compactness to become incomplete. Thus a more detailed analysis of the properties of faint-AGN and bright galaxies is required.
In Adams et al. (2020) we selected a sample of LBGs and AGN at 4 from the COSMOS and XMM-LSS deep extragalactic fields using a photometric redshift analysis based on the groundbased optical to NIR photometry. The advantages of this sample over previous studies are i) we do not impose any condition on source size or morphology and hence we are complete to both point-sources and extended galaxies, ii) we exploit the NIR data which results in a very clean selection of 4 sources and iii) we have used two of the most widely studied deep fields where there is wealth of deep multi-wavelength data and spectroscopy available. Here we utilise this sample to investigate the properties of objects within the 'transition' regime between bright-AGN and the typical galaxy population at this redshift. We do this by looking at the morphology and size of the sources using both the available ground-based and wide-area Hubble Space Telescope (HST) mosaics in COSMOS. In addition we have compiled publicly available spectra for the sample and use this to further classify sources. The structure of the paper is as follows. In Section 2 we describe the variety of datasets we use, and in Section 3 we describe the size measurements and the results from the available archival spectra of the sample. In Section 4 we derive the AGN fraction from our data and estimate the separated SF and AGN-dominated LFs. We discuss our results in 5 and present a simple empirical model of the AGN LF which we use to interpret our results in Section 6. We end with conclusions in 7. Throughout this work we present magnitudes in the AB system (Oke 1974;Oke & Gunn 1983). The standard concordance cosmology is assumed, with 0 = 70 km s −1 Mpc −1 , Ω m = 0.3 and Ω Λ = 0.7. At = 2 The AGN LF is typically parameterised as a double-power law (DPL) of the form ∝ * /( ( / * ) + ( / * ) ). This functional form includes four free parameters, a bright and faint-end slope ( and ), a characteristic luminosity ( * ) and normalisation * . For fitting the rest-frame UV LF of LBGs a Schechter function is commonly assumed of the form ∝ * ( / * ) − / * . For the Schechter function the bright-end slope is replaced by an exponential decline bright-ward of * .  3.5, 4.0, 4.5] this cosmology implies that one arcsec corresponds to physical distances of [7.3, 7.0, 6.6] kpc.

SAMPLE SELECTION AND DATA
The sample of 4 galaxies and AGN we utilize in this work was selected in the COSMOS and XMM-LSS deep extragalactic fields. The selection was based on a photometric redshift fitting of the optical to NIR bands (u-band to ) from the available groundbased data. In this paper we further include HST ACS imaging and spectroscopic observations available in the public domain.

The sample
The full sample of 4 sources from Adams et al. (2020) consisted of 20064 (38722) sources in the COSMOS (XMM-LSS) fields brightward of the 50 percent completeness limit of UV −20. To be included in the sample the object must have a best-fitting photometric redshift in the range 3.5 < < 4.5 with either a galaxy or AGN SED. Stars were removed using a relative 2 cut, such that the galaxy or AGN template must have a better fit than the stellar model. In this work we refined this sample using the most up-to-date photometry in the fields. We matched the original catalogue with a new -band selected catalogue (created in an identical fashion) that included the deeper HSC DR2 data, and the UltraVISTA DR4 imaging. The matching process revealed a small number of artefacts that were removed in the newer HSC release. We also required the objects to satisfy the selection criterion described above when run on the new deeper photometry, and be brighter than 15 in the ground-basedband to ensure a robust morphology analysis. As a result of these steps we were left with a sample of 15126 (25592) sources in COSMOS (XMM-LSS). For the morphology analysis we required the sources to be covered by the HST/ACS mosaic in the COSMOS field. The sub-sample covered by this mosaic contained 13848 sources.

Imaging data
Within the COSMOS field we used the HST/Advanced Camera for Surveys (ACS) mosaic in the F814W filter (hereafter 814 : Koekemoer et al. 2007;Scoville et al. 2007;Massey et al. 2010). We obtained 10 × 10 arcsec 2 cut-outs 3 from this mosaic for each source in our COSMOS sample where the ACS data existed (corresponding to 96 percent of the sample). The ACS data has a pixel scale of 0.03 arcsec/pix, and a typical point-source full-width-at-halfmaximum (FWHM) of less than 0.1 arcsec. The COSMOS field is uniformly covered to single orbit depth, leading to a 5 depth of 27.0 (0.6 arcsecond diameter aperture). Both the COSMOS and XMM-LSS fields contain a wealth of data in the optical and NIR bands. In this study we measure the rest-frame UV size from the HSC and CFHT -bands. This allowed us to identify any potential systematics in the size measurement from using data of different depth and seeing. The HSC -band is available across both fields, with varying depth, while the CFHT -band is uniform in depth but is available for only a 1 deg 2 subsection of each field    Adams et al. (2020). The samples in the COSMOS and XMM-LSS fields are shown in the upper and lower plots respectively. The total sample of galaxies and AGN with best-fit photometric redshifts in the range 3.5 < < 4.5 are shown as the grey histogram. The spectroscopically confirmed sources are shown as the blue shaded histogram. In hatched blue we have highlighted the spectroscopic redshifts from the deep galaxy surveys of ALPINE and VUDS in COSMOS and VANDELS in XMM-LSS. The spectroscopic redshifts at brighter magnitudes are typically from magnitude limited surveys (e.g. SDSS, zCOSMOS; see Table A1).

Publicly available spectroscopy
We endeavoured to extract the publicly available spectroscopy for the sample. In both fields we initially matched to the compilation of spectroscopic redshifts created by the HSC team 4 , which we supplemented with additional catalogues from the VANDELS (Pentericci et al. 2018;McLure et al. 2018) in XMM-LSS, and the ALMA Large Program to INvestigate (ALPINE; Fèvre et al. 2019) and the Boutsia et al. (2018) sample of 4 AGN in COSMOS. In Fig. 1 we show the spectroscopically confirmed sources in comparison to the full sample as a function of absolute UV magnitude. In total we found a total of 63 and 236 high-redshift sources with secure spectroscopic flags in COSMOS and XMM-LSS respectively (76 and 270 with all flags) 5 . As part of this process we identified and removed 4 (12) 4 https://hsc-release.mtk.nao.ac.jp/doc/index.php/dr1_ specz/ Note that in this compilation, when a source had multiple redshifts from different surveys these were averaged. This can result in a stated redshift at < 3 when the source is securely at > 3. We corrected for this on a case-by-case basis. In addition we removed redshifts from 3D-HST as these are not purely spectroscopic, particularly at higher redshifts where there are few spectral features in the rest-frame optical. 5 Secure flags were typically 3 or 4, including flags that may have been modified for the presence of AGN (e.g. a flag of 14 in VVDS denotes a secure AGN) low-redshift interlopers in COSMOS (XMM-LSS). In COSMOS, 100 percent of the sources in our sample at UV < −23.5 are confirmed spectroscopically, partially due to the campaign of Boutsia et al. (2018). In XMM, we find a lower percentage of 42 percent in the same magnitude range. At the bright-end of our sample the spectroscopic redshifts come primarily from magnitude limited surveys including the Sloan Digital Sky Survey (SDSS; Eisenstein et al. 2011;Richards et al. 2002), zCOSMOS (Lilly et al. 2007), VIMOS VLT Deep Survey (VVDS; Le Fèvre et al. 2015) and Primus (Coil et al. 2011). At the faint-end of our survey the redshifts were obtained as specific follow-up for high-redshift galaxies. The ALPINE sample includes sources from the VIMOS Ultra Deep Survey (VUDS; Le Fèvre et al. 2015) and Deep Imaging Multi-Object Spectrograph (DEIMOS; Hasinger et al. 2018) follow-up of high-redshift sources that are spread over the COSMOS field. The VANDELS survey on the other hand, was limited to a smaller region of the field that overlaps with the HST Cosmic Assembly NIR Deep Extragalactic Legacy Survey (CANDELS; Grogin et al. 2011;Koekemoer et al. 2011) where extremely deep spectroscopic integrations were performed. Thus the VANDELS sources extend to fainter magnitudes than in ALPINE. At the faint-end of the survey 2 percent of our sample have been confirmed as part of these deep spectroscopic surveys. While we cross-matched our sample to all available spectroscopic redshifts, we were only able to obtain a subset of reduced spectra depending on the survey. We extracted all of the publicly available spectra from SDSS, zCOSMOS, VVDS and VANDELS for further analysis.

RESULTS
Armed with our sample of 4 sources in the COSMOS and XMM-LSS fields, we proceeded to measure their sizes and spectroscopic properties. As we are primarily concerned with the objects in the 'transition' regime where AGN and LBGs have similar number densities, this analysis focuses on the results at UV −22. At these bright magnitudes we have a larger proportion of spectroscopic follow-up from magnitude limited surveys and we are able to identify the source morphology at high S/N in the high-resolution HST data (e.g. even if the source fragments into several clumps the components are detected individually at > 5 ).

Visual morphology
We first visually inspected the 4 sources that had high-resolution imaging from the COSMOS HST/ACS 814 mosaic. In Fig. 2 we show postage-stamp images of the brightest 30 sources in our sample. The brightest eight sources have been spectroscopically confirmed as quasars (see Table A1) and as expected, these sources appear compact. As we go fainter in this sub-sample there is a dramatic change in the visual morphology, with the appearance of extended, clumpy, sources. For example objects ID793151, ID746876 and ID168777 are clearly resolved, with multiple-components that extend > 0.5 arcsec (> 3.5 kpc) from the centroid. This is as expected from the galaxy size-luminosity relation and extensive studies of similarly luminous sources at 3 (e.g. Law et al. 2012;Lotz et al. 2006) and > 5 (e.g. Jiang et al. 2013;Bowler et al. 2017). In the sources that are confirmed as AGN from their spectra, there is some evidence for weak extended emission (e.g. ID702265), which could be arising from the host galaxy. Furthermore, one of the sources (ID153468) that is a confirmed quasar from the available rest-frame UV spectrum in Boutsia et al. (2018), appears to be compact but resolved (which is also confirmed by quantitative measure of the size, see Section 4.1).   The stamps are 2 arcsec on a side (corresponding to ∼ 14 kpc at = 4), in the standard orientation of North to the top, and East to the left. The images have been scaled by surface brightness, from 2 (approximately 24mag/arcsec) to the peak. Contours have been added at intervals of 1mag starting at the peak, to highlight the central compactness of the sources. The ID number is shown in the bottom left and the UV is shown in the upper right. Sources that have been spectroscopically confirmed are labelled with an astericks in the bottom right corner. Note that all of the spectroscopically confirmed sources in this figure show strong quasar features in the spectra.
This demonstrates that the host galaxy light is contributing significantly to the rest-frame UV light from this source. We estimated the contribution from the host galaxy by simultaneously fitting a PSF and Sérsic profile (fixed to = 1.0; Law et al. 2012) to the image using GALFIT. The best-fit from this crude estimate was an equal contribution from the AGN and SF in this object. For the other visual point-sources in the data, we found that a PSF alone was adequate to fit the imaging. If we assume that the extended sources are SFdominated, whilst the point-sources are AGN dominated (which is likely given the high rate of AGN spectra found for these sources), then we see a rapid transition in the individual galaxy morphology that indicates a transition from AGN to SF dominated systems at UV −23. A transition at this magnitude is in good agreement with that predicted by the simultaneous AGN and LBG LF fitting of Adams et al. (2020) and we compare our results directly to this study in our analysis of the AGN fraction in Section 4.1.

Size-luminosity relation
Due to the clumpy nature of the sources in the HST 814 data, the sizes of these sources can be substantially biased depending on the chosen measurement technique. When running S E (SE; Bertin & Arnouts 1996) on these images for example, we found that the majority of the SF-dominated sources were de-blended into several component. This results in a severe underestimate of the individual sizes of the brightest galaxies in the sample. To get around this issue we proceeded to make high signal-to-noise stacks of the data over a range in UV .

Stacking procedure
We created stacks in both the high-resolution HST imaging and the ground-based HSC and CFHT -band data. In both cases masks were formed from the SEGMENTATION images created with SE. For the ground-based data we masked all sources that were not associated with the central source. In the HST/ACS data we recombined de-blended components by retaining all objects that were within a radius of 0.8 arcsec from the central coordinate defined by the ground-based centroid. Due to their close proximity, and the extended emission connecting clumps in many cases, we are confident these components are at the same redshift (see Fig. 2 and discussion in Bowler et al. 2017). If the separate components were galaxies at lower redshifts, we would expect these interloper sources to effect the ground-based optical to NIR photometry and thus be removed as interlopers by our SED fitting process. With our recombined source we then determined the new centroid of the detected pixels in this extended object as the barycentre or first order moment (as used in SE). With these masked and centred images we proceeded to stack the images using both an average and median stack for comparison. The size measurement we used was the half-light radius from SE. In the following plots we present the results derived from the median stack using the barycentre centroid, however we comment on any different results found using the other methods. We obtained errors on our stacked size measurements using bootstrap resampling. At the bright-end where there are very few sources in each bin this essentially measures the spread of the individual sizes in that bin.

Results
In Fig. 3 we show the observed sizes of the stack galaxy images, uncorrected for the PSF, as a function of UV for the ground-based and HST data. At the faint-end of our sample we find that the galaxy stacks are resolved even in the ground-based data, with measured half-light radii in the range 1/2 0.55-0.6 arcsec as compared to 1/2 0.4-0.45 arcsec for the PSF. As we move to brighter galaxy stacks there is a gentle increase in size until UV −22.5, where we see a drop to smaller sizes that are consistent with being unresolved. The results from the HSC -band and the CFHT -band are consistent within the errors for both fields. In COSMOS, where we also have the higher resolution imaging HST 814 data, the drop in size observed in the ground-based and HST data occurs at a consistent UV . The wider area covered by XMM-LSS can also explain the shallower decline in size bright-ward of UV = −23 as compared to the COS-MOS result, because this larger volume will result in rarer bright galaxies being detected. Indeed, we identify a spectroscopically confirmed galaxy at UV = −23.6 (see Section 3.3). In both COSMOS and XMM-LSS, the brightest sources all appeared as point-source in the ground-based data, however we found that in some cases the measured 1/2 was larger than expected due to blending with foreground galaxies.
In order to measure the size-luminosity relation we corrected for the effect of the PSF by subtracting in quadrature the 1/2 measured for stars in the imaging. This is an approximate correction for the PSF, however we use it for comparison with previous studies. The size-luminosity relation was measured from the HST/ACS data only, as these data provide the most robust size measurements due to the smaller effect of the PSF (which has 1/2 = 0.0725 arcsec). We then converted the 1/2 into a physical distance by assuming a redshift of = 4.0. The resulting size-luminosity relation derived from the HST/ACS data is shown in Fig. 4. As expected from this effective rescaling of the observed sizes shown in Fig. 3, we see a clear drop in size at UV < −22.5. To determine the size-luminosity relation from the sample we therefore fit to the points faint-ward of this magnitude, assuming the standard parameterisation of 1/2 ∝ (e.g. Shen et al. 2003). We find a best fitting slope of = 0.16 ± 0.03, with a normalisation given by 0 = 1.45 ± 0.02 at UV =  In the COSMOS plot we show the measured 1/2 from the HSC 814 -band as the black circles. The blue horizontal band shows the 1/2 measured for the ground-based PSF. The corresponding band for the ACS data is shown as the black/grey line. In all datasets we see a drop off in measured size at UV < −22.5, although this is less pronounced in XMM-LSS.
−21.0. If we use the SE single-component centroid (e.g. prior to recombining de-blended components), we derive an identical slope, but a lower normalisation of 0 = 1.36 ± 0.02. We find no difference in results when using an average stack instead of the median presented here. Our derived size-luminosity relation is consistent with that determined by Huang et al. (2013), who found = 0.22 ± 0.06, and Curtis-Lake et al. 2016 who found = 0.06 ± 0.11. We find an offset compared to the relation derived in Curtis-Lake et al. (2016), which we attribute to the different measurement of size used by that study.
By extrapolating our fitted size-luminosity relation to brighter magnitudes, it is evident that there is a dramatic drop in the observed sizes of 4 sources. We attribute this drop to the increasing contribution of point-sources bright-ward of UV = −22.5, in agreement with the visual morphologies shown in Fig Fig. 3, which cover a wider area than COSMOS and hence are likely to detect the presence of the rarest SF galaxies, there is evidence for extended sources up to UV −24.

Rest-frame UV spectroscopy
To inform further our classification of sources as SF or AGNdominated in the 'transition' region observed in the size-luminosity relation, we retrieved the publicly available spectra available for the sample. While the brightest sources in our sample are confirmed from magnitude limited surveys (e.g. SDSS, zCOSMOS), there is a dearth of spectra in the range −23.5 < UV < −22.5, as is visible in Fig. 1 and shown in Table A1. Nevertheless, we compiled the publicly available spectra and present the results for all sources brighter than UV = −22 in Fig. 5. We smoothed the spectra with a box-car filter of width 1000 km/s in the rest-frame, to highlight the spectral features above the noise. The brightest seven sources show broad emission lines of NV 1240Å, S IV 1393, 1402 and CIV 1548, 1550Å in addition to strong Lyman-emission, all of which are clear signatures of unobscured AGN spectra. In addition to the typical AGN spectra, we identify source that show the appearance of SF-dominated light in the rest-frame UV. Faint-ward of UV = −24 we see a majority of sources that show the appearance of SF-dominated light, with narrow Lyman-emission and absorption lines. Of particular interest is ID1448401 which is the most luminous source ( UV = −23.6) in this sub-sample to show a SF-dominated spectrum. We discuss the implications for the discovery of this object for the LF in Section 4. Within the SF-dominated objects, we see a large variation in the observed spectra, with some showing strong Lyman-and others showing a continuum break and no appreciable Lyman-emission.
The sources shown in Fig. 5 are particularly bright which makes it relatively straightforward to see the presence of SF or AGN-type features in the spectra. Even with this limited spectroscopic subsample, it is evident that there is a transition in the rest-frame UV spectra of 4 sources between −24.0 < UV < −22.0. Fainter than UV = −22.4 we find only one other spectrum that shows clear evidence of AGN signatures, both through a visual inspection of the smoothed data and through an analysis of the spectral flags provided by each survey. The spectrum of this faint AGN is shown in Fig 6. This source was observed as part of the VANDELS survey of the XMM-LSS field and has spec = 3.9407 and UV = −21.0. It lies outside the region of HST data from CANDELS, however it appears extended in the ground-based HSC I-band data, with a PSF uncorrected 1/2 = 0.77 arcsec. In the spectrum there are again strong emission lines of high-ionization species including CIV and HeII. In comparison to the brighter AGN shown in Fig. 5 however, ID520330 shows stronger and considerably narrower emission lines. We measured the FWHM of the CIV doublet in all of the spectra shown, both directly from the smoothed data and through fitting a simple model of two Gaussians at the doublet wavelengths (constrained to have the same normalisation and standard-deviation). Both methods produced consistent results within the errors. The result of this analysis was that the brighter AGN in our sample show CIV 2000-6000 km/s, as found for the general population of SDSS quasars for example (e.g. Vanden Berk et al. 2001). In contrast, the faint source ID520330 shows a significantly narrower width of = 1200 ± 100 km/s. Similarly, this faint source has the highest restframe equivalent width of CIV amongst the AGN spectra, showing 0 150 ± 30Å. This is to be compared with 0 20-90Å for the brighter sources. Emission lines of this width and strength are characteristic of obscured Type II AGN (e.g. Alexandroff et al. 2013), where only the narrow line region is observed. The fact that we see Type II signatures in the faintest source in the rest-frame UV is also to be expected, as the bright continuum from the AGN is obscured in this case. Thus for this source we are observing predominantly the host galaxy continuum, with the addition of AGN emission lines.

SEPARATING THE UV LF OF AGN AND LBGS
As expected, the brightest sources in our 4 sample appear to be AGN-dominated in the rest-frame UV, showing a point-source morphology in the HST/ACS imaging and strong quasar features in the rest-frame UV spectra. Faint-ward of UV −22.5 however, the sources become extended, with spectra that are dominated by the light from young stars. In the 'transition' regime between these AGN and SF-dominated objects, we find evidence for a mixture of these two classes in our sample. In this Section we use these observations to infer the rest-frame UV LF of the two components, with the assumption that the majority of the sources in our sample can be separated into either an AGN or SF-dominated category. The existence of a slightly extended source that shows the rest-frame UV spectrum of an AGN (see Section 3.1) demonstrates that this assumption will break down depending on how AGN are distributed in the underlying galaxy population. We discuss this issue further in Section 6.

AGN fraction
To separate AGN and galaxies in our sample we define an AGN fraction ( AGN ) as a function of absolute UV magnitude. We first define a quantitative measure of AGN-dominated sources from the 814 -band high-resolution images by assigning objects with a 1/2 < 0.1 arcsec as AGN. In addition, we determined a comparison AGN from the visual morphology of the brightest sources. Despite this being more subjective than a size cut we found very close agreement between these two measures. As a final check we also used GALFIT to fit . A compilation of rest-frame UV spectra of the brightest sources in the 4 sample. The spectra have been shifted into the rest-frame according to the spectroscopic redshift provided by each survey, and are ordered by absolute UV magnitude with the brightest source at the top left. The raw data is shown as the coloured background and a box-car filtered spectrum in shown in black. Each spectrum (which was originally in units of erg/s/Å) was normalised to a peak flux of 1.0, and has been presented offset in the vertical direction for clarity. On the left of each spectrum is a label presenting the ID number and the absolute UV magnitude of the object. On the right of each spectrum is the name of the survey which obtained the data. We label common high-ionization emission lines with vertical dashed lines. the stacked images in each UV bin. We used a two component model consisting of a point-source and a Sérsic profile (with a fixed index of = 1). Reassuringly the AGN fraction of each stack, as defined by the ratio of the flux in the point-source compared to the total flux, agreed very well with the size cut. Hence we are confident that the derived AGN fraction from the source morphology does not depend significantly on the method used to derive it. Faint-ward of UV = −22, the smaller mean sizes of galaxies coupled with the scatter in the galaxy size-luminosity relation makes it more challenging to separate compact galaxies from point-sources using a size criterion. Hence we do not present measurements of the morphologybased AGN for sources faintward of UV = −22. We also defined an AGN fraction from archival spectra for a sub-set of our sample. Using the spectra presented in Fig. 5 we identified AGN-dominated sources according to the presence of strong emission lines of CIV, NV and HeII. Due to the small number of sources with spectra we used wider bins than for our morphology measurement. We determined the centre of each bin by taking the average source luminosity to negate any bias in the distribution of sources within that bin. Faintward of −22.0 we find only one source which has AGN signatures in the available spectroscopy sample. This source is identified as a Type II AGN (ID520330) in which the rest-frame UV continuum is dominated by the host-galaxy light and we therefore define this source as SF-dominated (as discussed in Section 6.3).
We present the derived AGN measurements in Fig. 7 2. This is also visually apparent in the stacked HST/ACS images (top of Fig. 7), where at UV −23 the stack is clearly extended (although with less flux in the wings) while at UV −23.8 the image is consistent with being a point-source. Comparing to previous estimates of the AGN at 4 we find good agreement with the spectroscopy measurements of Ono et al. (2018), who used predominantly archival redshifts with spectroscopic flags to determine the AGN fraction. The advantage of our method of AGN classification from the full spectrum is that we are not sensitive to differences between AGN classifications between spectroscopic surveys. We find a brighter transition magnitude than that of Sobral et al. (2018), who found a drop in the fraction of AGN at UV = −21.5 at 2-3. This study was based on the follow-up of strong Lyman-emitters rather than LBGs, and hence it could be expected that this pre-selection for strong line-emitters would preferentially detect AGN at fainter magnitudes. We note however, that in Sobral et al. (2018) the AGN fraction at UV > −22.5 is determined from sources predominantly from a detection of the NV line with low S/N ( 3.0), their classification as AGN is somewhat uncertain.
At −23 < UV < −22 we see a slight difference in the derived AGN fraction from our morphological and spectroscopic measurements. From a morphology cut we measure AGN = 0.06 +0.03 −0.02 at UV = −22.5 while with spectroscopic data we find AGN = 0.25 +0.17 −0.12 . Although the errors are large, due predominantly to the small number statistics for the spectroscopic sub-sample, a difference between the AGN between a strict morphological selection and spectroscopic identification could be expected in this magnitude range. This is a consequence of the increasing importance of host galaxy light at fainter UV magnitudes, and we present a toy model that can explain these observations in Section 6. Alternatively the slight difference found could be due to bias in the spectroscopic measurement, as arguably the strong emission lines from AGN and the compactness of the emission could make them easier to identify in spectroscopic measurements. In the range −23 < UV < −22 we find no difference between the sizes of the spectroscopically confirmed sources and our full sample, suggesting that we are not biased to compact sources. In this magnitude range we find 10 sources with archival spectroscopy, four from the VANDELS survey and six from VVDS (of which eight with secure flags are shown in Fig. 5). While VVDS is a purely I-band magnitude limited survey, VANDELS selected against compact sources over 50 percent of the survey area that was covered by HST imaging , and hence VANDELS should be biased against AGN. If we measure the AGN in the VVDS and VANDELS survey separately, we find AGN = 0.25 +0.25 −0.15 for both surveys when secure flags are used, indicating that there is no clear bias within the limitations of small number statistics. Two of the VVDS spectra were not included in our initial AGN fraction calculation as they have poor quality flags. If we assume these objects are SF-dominated, under the assumption that AGN features are easier to identify, then we obtain a lower AGN = 0.20 +0.15 −0.10 in this magnitude range. This value is still higher than that derived from our morphology measurement, however larger spectroscopic samples are clearly required to determine if there is a real discrepancy between the AGN found from a strict morphological cut in contrast to a classification from spectroscopy.
In Fig. 7 we also present the predicted AGN fraction from the simultaneous fitting of the combined AGN and LBG LF presented in Adams et al. (2020). Adams et al. (2020) assumed either a Schechter function or DPL form for the LBG LF in addition to a single power-law (PL) to model the faint-end of the AGN. Without any further information about the nature of the sources, both models produced a good fit for the observed UV LF over −26 < UV < −20 (see left panel of Fig. 8). In comparison to our derived AGN we see that the Schechter function form of the LBG LF predicts a steeper decline in the fraction of AGN at fainter magnitudes than a DPL model, due to the exponential drop-off at the bright-end of this parameterisation. Note that the position of this drop depends on the position of the 'knee' in the LF, which is strongly constrained by the number density of sources UV > −21. Both our measurements of the AGN fraction deviate from this steeper Schechter prediction at UV ∼ −24, as do the results of Ono et al. (2018), suggesting that a DPL is the more appropriate function to describe the LBG LF at 4.

The Luminosity Function
In the previous section we compared the observed AGN to that expected from the fitting of the full AGN + LBG rest-frame UV LF. In this section we instead use the AGN derived in this study to separate the LF results of Adams et al. (2020) into AGN and SF-dominated subsamples. Because we could only classify a small fraction of the full sample using the morphology and spectroscopy data (e.g. because high-resolution imaging was only available in COSMOS, and the spectroscopy data only covers ∼ 1 percent of the sample), we elected to apply the AGN to the data points from Adams et al. (2020) as opposed to recalculating the LF from a significantly smaller sample. We determined the separate LFs by using the AGN fractions derived from the morphology and spectroscopy results separately.
To interpolate the AGN we fit a constrained model to our binned AGN fraction points shown in Fig. 7. The model consisted of two power-laws to approximate the overlap between the bright-end of the galaxy LF and the faint-end of the AGN LF without over-fitting the data. Due to the difference in the AGN derived from using the morphological and spectroscopic data, we find differences in the separate LFs for the AGN and SF dominated sources as shown in the two right-hand plots in Fig. 8. We present the results of fitting the separated AGN and SFdominated LFs with different parameterisations in Fig. 8. The best-fit parameters are presented in Table 1 in comparison to the LF parameters derived from the simultaneous fit of Adams et al. (2020). The AGN fractions derived from these fits in comparison to the results of Adams et al. (2020) are presented in Appendix B. We fit our separated AGN-dominated UV LFs using a single power-law, as we do not extend faint-ward of the apparent LF knee at UV ∼ −26. For the SF LF we fit using both a Schechter function or a DPL. If we focus first on the SF-dominated results, we find that the separation of sources using a morphology or spectroscopy criterion makes only a marginal difference to the derived LF. This is evident in the fitting results presented in Table 1, where the values are well within the 1 errors in the different scenarios. We also find good consistency with the Schechter and DPL parameters from Adams et al. (2020), which is to be expected as the LBG fit is predominantly constrained by the data-points at UV > −22. We checked that the impact of strong gravitational lensing on a Schechter function fit could not reproduce the number of bright sources by applying the methodology of Mason et al. (2015); Barone-Nugent et al. (2015). The excess that results from the lensing is shown in Fig. 8 and is too small to account for the number density we find at UV < −23.
In contrast to the SF-dominated LF, the faint-end of the AGNdominated LF depends more significantly on the assumed AGN . If we use a morphology criterion we find a shallow slope ( = −1.19±0.05) due to the rapid drop in point-source dominated sources faint-ward of UV −23. In this case, we find close agreement with the results of Akiyama et al. (2018), who derived a faint-end slope of = −1.30 ± 0.05. This is to be expected given that Akiyama et al. (2018) identified AGN based on a compactness criterion in the ground-based HSC data. If instead we use our spectroscopic criterion in determining AGN we find a significantly steeper slope of the faint-end of the AGN LF of = −1.85±0.05. In this case our data points start to diverge from the Akiyama et al. (2018) points, due to a higher proportion of AGN-dominated sources at faint magnitudes in this parameterisation (see Fig. 7). Adams et al. (2020) found = −1.66 +0.29 −0.58 in the fit of a DPL (LBG component) with a PL (AGN component). The large error on this value is a consequence of the degeneracy between the bright-end slope of the LBG LF and the AGN faint-end slope. Our measurement of the slope of the faint-end of the AGN LF is more constrained by the data-points at UV −24, which allows us to find a best-fit that is shallower, but still consistent within 1.5 , from the Adams et al. (2020) result.

DISCUSSION
In this work we have investigated the transition in the properties of 4 sources at UV −23, where the number densities of faint-AGN and bright-galaxies converge. From our imaging data we observe a change in the source morphology, through a sharp drop  Fig. 8. The upper part of the table shows the results when separating according to a morphological criterion, while the lower part shows the results when AGN are identified according to their spectra. The first column indicates the sub-sample that was fit to (SF-dominated or AGN-dominated). For the SF case, we show the results for a Schechter function and DPL fit in the first and second row. The fit to the AGN case was performed with a single power law, with the normalisation calculated at a fixed UV highlighted with an asterick. The second and third column denote the characteristic absolute magnitude and normalisation. The fourth column show the faint-end slope for the SF and AGN fits, and the final column shows the bright-end slope for the DPL fit.  in the average size of sources in the size-luminosity relation that is also seen in the individual source morphology. We also see a change in the features present in the available rest-frame UV spectra for the sample. The absolute UV magnitude at which this transition occurs corresponds to the point of rapid decline in the bright-end of the galaxy LF. Furthermore, the form of the increase in the AGN fraction to brighter magnitudes depends on the shape of the galaxy LF brightward of the knee in the function ( UV −21; see Table 1). There has been an ongoing discussion on the shape of the rest-frame UV at high-redshifts. While the UV LF at 4 has typically been fitted by a Schechter function (e.g. McLure et al. 2013;Finkelstein et al. 2015;Bouwens et al. 2015), recent results have demonstrated an excess of highly luminous galaxies in relation to the Schechter function predictions (Bowler et al. 2014;Ono et al. 2018;Bowler et al. 2020). In our derived AGN fraction, and in the corresponding SF-dominated LFs, we have found evidence for a shallower decline in the number density of the brightest SF galaxies at 4. Most strikingly, the discovery of an extremely bright source at UV = −23.6 with no evidence for AGN spectral features (ID1448401 in Fig. 5) supports a AGN 0.8 (range within the errors of 0.38-0.95) at this magnitude, which leads to a number density of sources well in excess of the Schechter function prediction. This finding is potentially in conflict with studies that have found support for a Schechter function form at 3-4 (van der Burg et al. 2010;Hathi et al. 2010;Bian et al. 2013;Parsa et al. 2016), however it is only recently that the datasets available at 4 have had sufficient volume to adequately constrain the number density of the rarest galaxies/faint-AGN. If we fit our SFdominated LF with a DPL, the results are in good agreement with the evolution in the DPL parameters derived in Bowler et al. (2015Bowler et al. ( , 2020, who found a steady steepening of the bright-end from 9 to 5 consistent with the increasing impact of dust. If this steepening is due to dust obscuration in the most highly star-forming galaxies, then the effects of this dust should be observable both in the colours of bright LBGs and directly via reprocessed emission in the far-infrared. Interestingly, the brightest spectroscopically confirmed LBG in our sample (ID1448401) shows a very blue rest-frame UV continuum (rest-frame UV slope ∝ ; −2). From the observed colourmagnitude relation at this redshift, this source would be expected to show a redder slope with −1.4 (Lee et al. 2011;Bouwens et al. 2014). Rogers et al. (2014) demonstrated that at 5 there is an increased scatter in the rest-frame UV slopes of LBGs to brighter magnitudes, and thus it is plausible that this LBG is a rare example of a highly star-forming galaxy ( 80 M /yr; Madau et al. 1998) with little dust attenuation at this redshift. Thus while overall the increased production and attenuation of dust in the most highly SF galaxies from 9-4 could cause a steepening of the bright-end slope of the rest-frame UV LF, this does not preclude the existence of galaxies with high-SFRs and a lack of dust obscuration within this epoch.

The faint-end of the AGN UV LF
There has been a renewed interest in recent years on the slope of the faint-end of the rest-frame UV LF of AGN. This was motivated by the claimed detection of high-redshift X-ray sources by Giallongo et al. (2015), who used their data to suggest that UV-faint AGN could contribute significantly to the process of reionization at > 6. Such an analysis relies on the integral of an extrapolated restframe UV LF to determine the total number of ionizing photons that can be produced by AGN at very high-redshifts. The subsequent studies of Boutsia et al. (2018) and Giallongo et al. (2019) have further claimed an excess in sources at the faint-end of the 4. While several works have called these results into question (e.g. Parsa et al. 2018;McGreer et al. 2018;Cowie et al. 2020) at > 4, the determination of an accurate slope of the faint-end of the AGN LF remains of interest. Our observations demonstrate that the derived slope of the 4 AGN LF depends strongly on the selection method. We can reproduce the flatter slope found in Akiyama et al. (2018) by using a criterion on morphology to separate AGN-dominated sources from the full 4 LF. If instead we use a spectroscopic determination of AGN to estimate the AGN LF, we derive a steeper faint-end slope ( ∼ −1.8). The rest-frame UV spectroscopic features of AGN are strong and broad emission lines (e.g. Fig. 5), while LBGs are expected to show absorption features or potentially weak nebular emission lines (Stark et al. 2014;Shapley et al. 2003;Steidel et al. 2016). Thus we expect any classification of a source as an AGN based on the rest-frame UV spectrum to be sensitive to not only the brightest AGN-dominated objects, but also objects in which the light from SF is significant. Instead, AGN selections that include a point-like morphology selection will exclude objects where the host galaxy UV light causes the source to be rejected as too extended. Given the wide range in imaging depths and compactness criterion used in different AGN selections, it is challenging to understand the incompleteness of previous studies due to this effect. It is clear however, from our study and other works (e.g. Matsuoka et al. 2018b), that faint-ward of UV −24 it is necessary to account for both AGN and SF-dominated sources.

Evolution of the AGN to SF transition into the EoR
Both the AGN and LBG rest-frame UV LFs are known to evolve rapidly at 4. In Bowler et al. (2020) we found evidence for a flattening of the bright-end slope with increasing redshift in the range = 5-10, with a corresponding evolution in * according to Δ * /Δ −0.5. This was interpreted as a result of decreased dust obscuration and mass quenching within the Epoch of Reionization (EoR). Such a change in shape would be imprinted onto the measured AGN fraction at these redshifts, with a predicted fainter transition magnitude and extended tail of highly luminous SF galaxies. This prediction is consistent with the tentative detection of weak AGN features in the rest-frame UV spectra of moderately bright LBGs at 6 (Laporte et al. 2017;Tilvi et al. 2016), as we predict a higher AGN to fainter magnitudes within this epoch. These detections however, are at odds with the expected number density of faint AGNs at 6, which have been shown to undergo an accelerated decline at > 5 (McGreer et al. 2013;Jiang et al. 2016). From the extrapolated number densities of high-redshift AGN, we do not expect that current LBG samples at ≥ 7 will contain any AGNdominated sources, as AGN are only expected to be more numerous than LBGs at UV ≤ −24 (see discussion in Bowler et al. 2014). This is consistent with the lack of point-sources found at 6-7, where it has been possible to gain high-resolution imaging of the brightest sources with HST (Jiang et al. 2013;Bowler et al. 2017). These somewhat conflicting results could be a result of weaker AGN residing within high-redshift LBGs, or misclassification of emission lines as AGN signatures. Taking the results of this study coupled with what is known about the evolving UV LFs to higher redshifts, we predict that AGN 'contamination' of rest-frame UV selection samples faint-ward of UV −23 will be minimal at ≥ 7.

A SIMPLE MODEL OF THE AGN UV LF
We created a toy model of the predicted rest-frame UV LF of AGN to aid in the interpretation of our observations. The model takes the observed UV LF of LBGs and uses this, via simple empirical relations, to estimate the luminosity and number density of UVbright AGN at the same epoch.

Method
For each galaxy of a given absolute UV magnitude, we first estimate the stellar mass according to the relation found by Duncan et al. (2014): log 10 ( ★ ) = (9.02 ± 0.02) ( UV + 19.5) − (0.45 ± 0.02). (1) The slope and normalisation of this relation is consistent between different studies (e.g. Salmon et al. 2015;Song et al. 2016; see figure  5 of Tacchella et al. 2018). This relation has been derived in the past to determine the stellar mass functions at high-redshift from the rest-frame UV LF, where the effect of scatter is essential in order to reproduce the observed mass and LFs (Stark et al. 2013;Duncan et al. 2014). We therefore include a scatter of 0.4 dex in the relationship above, which is consistent with that required in Duncan et al. (2014) and is at the upper end of the measured intrinsic scatter in the -★ relation (Curtis-Lake et al. 2020; Salmon et al. 2015). From the stellar mass we then estimate the black hole mass using the BH − ★ relation of the form: Here BH = log 10 ( BH )/ ★ gives the gradient of the relation and BH the intercept (defined at a mass of log 10 ( ★ /M ) = 11.0). The form or even existence of such a relationship at high-redshift is uncertain. We therefore consider two plausible scenarios based on previous results from both luminous quasars at high-redshift and low-redshift galaxies. The simplest scenario is one in which the black-hole mass is a constant fraction of the stellar mass at a given redshift. In this case (denoted model A hereafter) we set BH = 1.0 and BH = 9.0 + log 10 (1 + ) to give BH / ★ = 0.05 at = 4, as found in observations of high-redshift quasars (e.g. Venemans et al. 2017;Targett et al. 2012). The 1 + term follows observations and theoretical arguments for an increased BH to bulge-mass ratio at high-redshifts (e.g. Venemans et al. 2015;Croton 2006;Wyithe & Loeb 2003). Such high ratios of BH / ★ may not be representative of the AGN population at this redshift (e.g due to selection effects), hence we treat this scenario as an extreme case. An alternative scenario is one in which black holes in more massive galaxies are over-developed, whereas those in less massive sources are a smaller fraction of the stellar mass. Such a scenario has been measured at lowredshift by Reines & Volonteri (2015). In this case (denoted as model B hereafter) we set BH = 1.4 and BH = 8.95 + log 10 (1 + ). Scatter is also significant in the BH -★ relation (e.g.see Hirschmann et al. 2010;Volonteri & Reines 2016), and we therefore include an intrinsic scatter of 0.3 dex. The result of these steps is a relationship between the UV of a LBG and the estimated BH . The BH can then be converted into an estimated bolometric luminosity using an assumption on the Eddington ratio. We assume a log-normal distribution of mean = 0.6 and = 0.3 dex as found by Willott et al. 2010b (see also Kelly & Shen 2013). Finally we convert the bolometric luminosity into a UV luminosity by assuming a bolometric correction (taken to be 4.4; Runnoe et al. 2012;Mortlock et al. 2011). From a single UV from SF we thus obtain a spread in the predicted total absolute UV magnitude due to the addition of an unobscured black hole ( UV,BH ).
Following these steps resulted in a simulated AGN LF with a relative flat shape at the bright-end. This is in contrast with the knee in the function around ★ ∼ −26 found in observations. This effect arises in our model from the creation of infeasibly massive black holes and galaxies, due to the application of scatter in the relations between UV , ★ and BH . While the form of the bright-end of the AGN LF does not impact the results of this work, we nevertheless impose a crude cut in the stellar and black-hole masses to remove these unrealistic sources. We take a limiting stellar mass of log 10 ( ★ ) = 10.8 from the characteristic mass of high-redshift galaxies (e.g. Ilbert et al. 2013;McLeod et al. 2020), and impose an upper limit on the black-hole mass of log 10 ( BH ) = 9.5 to approximate the drop in the (uncertain) black-hole mass functions at 4 (e.g. Shankar et al. 2009;Kelly & Merloni 2012). If a model galaxy/black hole exceeds these mass limits due to scatter, we allocate a lower mass at random according to the relations described above. The result of this simple process is a knee in the AGN LF in good agreement with the observations. We calculate the results of this analysis for both the Schechter and DPL form presented in Adams et al. (2020), where they fitted to only points at UV > −22.0 to ensure that the results were not influenced by AGN-dominated sources. The resulting AGN LF depends only weakly on the assumed shape of the LBG LF because the majority of the simulated AGN are hosted in galaxies with > −22.0 where there is good agreement between the Schechter and DPL fits. In contrast, the ratio of AGN to SF-dominated sources at UV ∼ −23 does rely on the LBG LF shape, as it depends on how steeply the LBG LF drops-off at the bright-end (see Section 5).
To obtain a predicted AGN LF that matches the number density of quasars known at 4 we include two factors to modulate the number of LBGs that host an AGN. The first is the obscured fraction, which describes how many 'on' AGN are not bright in the rest-frame UV continuum (e.g. are obscured Type II AGN). We fixed obsc. = 0.6 (Ueda et al. 2014;Vito et al. 2018). The second modulating factor is the fraction of galaxies that host an active black hole, which is a proxy for the duty cycle of AGN activity. The active was determined in our model as the factor required to bring the predicted AGN LF in agreement with the observed AGN LF in the range −27 < UV < −24. We find active = 0.0007 for model A and active = 0.003 for model B. Note that active is not directly comparable to the duty cycle of AGN activity, as it is the fraction of AGN that appear bright in the rest-frame UV rather than the fraction of active black holes. . The grey dashed line shows the DPL fit to the rest-frame UV LF for starforming galaxies from Adams et al. (2020). The result of applying empirical scaling relations, with scatter, to this galaxy LF results in the AGN prediction shown as the black line. The effect of scatter is highlighted as the gold shaded region, such that the lower edge of this shading would be the prediction with no scatter. The red solid line shows the predicted obscured Type II AGN LF, and the blue dotted line shows the expected LF for sources in which BH / SF > 12.5. The red dashed line shows the predicted AGN LF without the UV emission from the host galaxy. The open circles show the measurements from Adams et al. (2020) and the grey filled circles show the results from Akiyama et al. (2018), who imposed a criterion on the source morphology.

Results
We present the results of this analysis in comparison with the observed LBG and AGN rest-frame UV LF in Fig. 9. Despite the simplicity of the model, it does a reasonable job at reproducing the shape of the observed 4 AGN LF at luminosities bright-ward of UV −23.5. A striking feature of the predicted LFs shown in Fig. 9 is the dominant role of scatter which is well known to be important from observations of the brightest quasars (e.g. Venemans et al. 2017;Willott et al. 2013;Targett et al. 2012). Furthermore, both models predict a similarly steep faint-end slope consistent with that found by other empirical predictions (e.g. Veale et al. 2014;Ren et al. 2020;Delvecchio et al. 2020). For sources around UV −23, our two models give different predictions for the importance of scatter in the observed galaxies. This has consequences for the expected morphology and spectroscopic properties of sources around this magnitude. The AGN LFs from our toy model do not show the flattening observed in the results of Akiyama et al. (2018) faint-ward of UV −24. Akiyama et al. (2018) used a moment based measure to select compact sources in ground-based HSC data, while our model does not make any assumption about the size or morphology of each model galaxy/AGN. If we impose the condition that the AGN luminosity must be a certain multiple of the stellar light (e.g. BH / SF 10) then we are able to reproduce the flattening found in the data, but only in the case where the black-hole mass is an increasing fraction of the stellar mass (model B). The magnitude of the cut is motivated by previous studies comparing the host galaxy and AGN emission in the rest-frame UV and optical for sources selected as quasars (typically Δ = 2-3 mag; Jahnke et al. 2004;Schramm et al. 2008;Goto et al. 2009;Mechtley et al. 2016;Lawther et al. 2018) When fitting the Akiyama et al. (2018) points with the ratio as a free parameter, we found a best-fit ratio of BH / SF = 12.5 ± 0.5 for model B. The drop in the AGN LF in this case is due to the host galaxy rest-frame UV light becoming significant at UV > −23. Such a cut is incomplete to fainter AGN (relative to their host galaxy UV emission) and therefore results in an artificial flattening in the observed AGN LF as shown in Fig. 9. If instead black holes populate host galaxies as in our model A, where the effect of scatter in shaping the observed AGN LF at fainter magnitudes is dominant, then such a flattening is not predicted with this relative luminosity cut. The effect can also be seen in Fig. 10 where we compare the observed AGN to that predicted from our model. These results demonstrate that the morphological and spectroscopic properties of sources around UV −23 gives important information about how active black holes are distributed within host galaxies. If the rest-frame UV is always dominated by light from the AGN, then selections based on a point-sources condition will be complete (model A). Such a selection will not be feasible to fainter magnitudes however, due to LBGs themselves becoming more compact. If instead the host galaxy light can become important at fainter magnitudes, as in our model B, then we see a distinct incompleteness in point-source selections for AGN at UV > −23. In this case it becomes essential to define the relative 'AGN-strength' that is being included with a given selection methodology, to fully understand what population is being measured.

Obscured Type-II AGN
So far in this work we have considered only unobscured Type I AGN, which we expect to contribute significantly to the rest-frame UV continuum luminosity of the source. In the orientation-based unified model of AGN we also expect obscured Type II-like AGN, where the presence of an AGN is only observable in the UV via narrow emis-  sion lines. In our model of the AGN LF as derived from the LBG LF, we can predict the number density of these obscured sources.
Interestingly, our preferred model (model B), which can better explain our observations of the AGN and the observed flattening of the faint-end slope found by Akiyama et al. (2018), also predicts an increased contribution of obscured AGN at UV > −22. This is a natural consequence of our assumed active and obscured fractions of galaxies in the model. In model B we expect to see an increased contribution from obscured AGN at fainter magnitudes, with the number densities of 'obscured' and 'unobscured' sources becoming comparable (within a factor of < 5) at UV −21. While there are many assumptions and uncertainties in this prediction, we note that faintward of UV = −22 we detect one source with clear AGN signatures in the compilation of spectra for our sample. This source, ID520330, appears to be an obscured Type II source (Fig. 6) at UV = −21.
From this one object we estimate the number density of obscured AGN at this magnitude is around = 7 ± 7 × 10 −6 /mag/Mpc 3 , which despite the huge uncertainties is within a factor of ten from our model prediction (model B: Fig. 9). These arguments demonstrate that there is still considerable uncertainty in the faint-end of the 4 AGN UV LF depending on how AGN are defined and on the selection procedure. Given the large samples of 4 sources available to-date from deep optical/NIR surveys (e.g. Adams et al. 2020;Ono et al. 2018;Bouwens et al. 2015), the next steps to overcome this challenge do not require substantial increases in sample size. Rather, in this work we have demonstrated that with a combination of magnitude limited spectroscopic follow-up, coupled with high-resolution imaging, it will be possible to probe the connection between faint-AGN and their galaxy hosts.

CONCLUSIONS
We present the size, morphology and spectroscopic properties of a sample of 3.5 < < 4.5 galaxies and AGN selected based on a photometric redshift fitting analysis in Adams et al. (2020). The broad magnitude range probed by the parent sample (−26 UV −20) allows us to uniquely probe the transition between SF-and AGNdominated sources. We use both ground-based and HST imaging data to identify the changes in morphology and size, and archival spectra to detect signatures of AGN in the rest-frame UV spectrum.
The key conclusions of this study are as follows.
• We find the expected galaxy size-luminosity relation up to an absolute UV magnitude of UV = −22.5, beyond which we observe a steep downturn due to the increasing presence of objects with a point-source morphology. The effect is seen in both the highresolution HST 814 imaging and the ground-based data. We find that brightest galaxies in the sample have a highly irregular structure as expected from previous works.
• The existence of archival spectra for a sub-set of our sample allows us to identify SF and AGN dominated sources from the restframe UV spectral signatures. At the bright-end of our sample we see clear AGN signatures in the available spectra, while deep spectroscopy from targeted high-redshift surveys show the expected features of LBGs. We identify a very bright source UV = −23.6 ( 80 M /yr) that shows no evidence for an AGN contribution to the rest-frame UV light.
• We combine the morphology/size and spectroscopy information to estimate the AGN fraction as a function of UV . We find a steep transition at UV −23.2 where the number of bright galaxies drops while AGN-dominated sources become ubiquitous. We find a slight tension in the AGN derived independently from our morphology and spectroscopy data at UV −22.5, with the spectroscopy results finding a higher fraction by a factor of ∼ 5.
• We use this AGN fraction to estimate the separated AGN and SF-dominated rest-frame UV LFs at 4. We find the bright-end of the SF-dominated LF to be described by a DPL with a bright-end slope of = −5.15 ± 0.10. Our LBG UV LF is consistent with that expected from the observed steepening in from 9-5 found by Bowler et al. (2020), which can be explained by an increased effect of dust attenuation in the most highly star-forming galaxies.
• We find that the slope of the faint-end of the AGN LF depends on how we determine the AGN fraction. If we impose a point-source morphology criterion, as in several recent studies of faint AGN, then we find a shallow slope with = −1.19 ± 0.05. Conversely, if we derive the AGN number density using the spectroscopic results we find a steeper slope of = −1.83 ± 0.11.
• A simple model of the AGN LF, derived using empirical relations applied to the LBG UV LF at = 4, can provide a good description of the transition from AGN to SF-dominated sources. By applying a criterion on the relative emission from the AGN and host galaxy ( BH / SF > 15), we are able to reproduce the observed flattening of the = 4 AGN LF at UV < −22 found by Akiyama et al. (2018). This flattening is only predicted in the case that the light from SF becomes significant in comparison to the AGN in less massive galaxies.
Our results demonstrate that while the increasingly large samples of 4 sources have resulted in low statistical errors on the restframe UV LF of AGN, there remain considerable systemic uncertainties on the faint-end of this function. In particular, the commonly imposed point-source criterion in the selection of AGN samples at these redshifts can result in incomplete samples of active sources at UV > −24 due to the impact of the host galaxy. The degree of this incompleteness depends on how active black holes populate the underlying galaxy distribution and how these active sources appear in the rest-frame UV light accessible in optical datasets. Upcom-ing wide-area high-resolution imaging (e.g. from Euclid; Laureĳs et al. 2012) with extensive spectroscopic follow-up (e.g. from degreescale multi-object spectrographs like the William Herschel Telescope Enhanced Area Velocity Explorer; Dalton et al. 2012 and the Multi-Object Optical and Near-infrared Spectrograph; Cirasuolo 2014) will be a powerful combination to understand further the co-evolution of galaxies and AGN at high redshifts. Table A1. The spectroscopically confirmed high-redshift sources from the full 4 sample. We present the objects with UV < −22.0, with the COSMOS and XMM-LSS sources in the upper and lower part of the table respectively. The first column is the source ID number followed by the R.A. and Declination. In column 3 we present the total HSC -band apparent magnitude followed by the best-fitting photometric redshift with a Galaxy and QSO template in columns 4 and 5. In brackets after the photometric redshift is the 2 of the fit. The final two columns denote the absolute UV magnitude followed by a note indicating the origin of the spectroscopic measurement. KB18 corresponds to Boutsia et al. (2018), zCOS to zCOSMOS, PR to Primus, VAN to VANDELS. We denote with an asterick the objects for which we were able to obtain the rest-frame UV spectrum, presented in Section 3.3.  Adams et al. (2020). The blue (orange) lines show the results from this work, where we have separated SF and AGN-dominated sources according to the morphology (spectra). We reproduce our observed AGN points as in Fig. 7.